x86/pvh: do not forward MADT Local APIC NMI structures to dom0

Currently Xen will passthrough any Local APIC NMI Structure found in
the native ACPI MADT table to a PVH dom0.  This is wrong because PVH
doesn't have access to the physical local APIC, and instead gets an
emulated local APIC by Xen, that doesn't have the LINT0 or LINT1
pins wired to anything.  Furthermore the ACPI Processor UIDs used in
the APIC NMI Structures are likely to not match the ones generated by
Xen for the Local x2APIC Structures, creating confusion to dom0.

Fix this by removing the logic to passthrough the Local APIC NMI
Structure for PVH dom0.

Fixes: 1d74282c45 ('x86: setup PVHv2 Dom0 ACPI tables')
Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
master commit: b39e638525
master date: 2022-12-02 10:33:40 +0100
This commit is contained in:
Roger Pau Monné authored and Jan Beulich committed 2022-12-08 10:10:50 +01:00
1 parent b6b3dc8d88
commit 09849cdd25
1 file changed
+1 -33
+1 -33
View File
@@ -58,9 +58,6 @@
static unsigned int __initdata acpi_intr_overrides;
static struct acpi_madt_interrupt_override __initdata *intsrcovr;
static unsigned int __initdata acpi_nmi_sources;
static struct acpi_madt_nmi_source __initdata *nmisrc;
static unsigned int __initdata order_stats[MAX_ORDER + 1];
static void __init print_order_stats(const struct domain *d)
@@ -761,25 +758,6 @@ static int __init acpi_set_intr_ovr(struct acpi_subtable_header *header,
return 0;
}
static int __init acpi_count_nmi_src(struct acpi_subtable_header *header,
const unsigned long end)
{
acpi_nmi_sources++;
return 0;
}
static int __init acpi_set_nmi_src(struct acpi_subtable_header *header,
const unsigned long end)
{
const struct acpi_madt_nmi_source *src =
container_of(header, struct acpi_madt_nmi_source, header);
*nmisrc = *src;
nmisrc++;
return 0;
}
static int __init pvh_setup_acpi_madt(struct domain *d, paddr_t *addr)
{
struct acpi_table_madt *madt;
@@ -795,16 +773,11 @@ static int __init pvh_setup_acpi_madt(struct domain *d, paddr_t *addr)
acpi_table_parse_madt(ACPI_MADT_TYPE_INTERRUPT_OVERRIDE,
acpi_count_intr_ovr, UINT_MAX);
/* Count number of NMI sources in the MADT. */
acpi_table_parse_madt(ACPI_MADT_TYPE_NMI_SOURCE, acpi_count_nmi_src,
UINT_MAX);
max_vcpus = dom0_max_vcpus();
/* Calculate the size of the crafted MADT. */
size = sizeof(*madt);
size += sizeof(*io_apic) * nr_ioapics;
size += sizeof(*intsrcovr) * acpi_intr_overrides;
size += sizeof(*nmisrc) * acpi_nmi_sources;
size += sizeof(*x2apic) * max_vcpus;
madt = xzalloc_bytes(size);
@@ -860,12 +833,7 @@ static int __init pvh_setup_acpi_madt(struct domain *d, paddr_t *addr)
acpi_table_parse_madt(ACPI_MADT_TYPE_INTERRUPT_OVERRIDE, acpi_set_intr_ovr,
acpi_intr_overrides);
/* Setup NMI sources. */
nmisrc = (void *)intsrcovr;
acpi_table_parse_madt(ACPI_MADT_TYPE_NMI_SOURCE, acpi_set_nmi_src,
acpi_nmi_sources);
ASSERT(((void *)nmisrc - (void *)madt) == size);
ASSERT(((void *)intsrcovr - (void *)madt) == size);
madt->header.length = size;
/*
* Calling acpi_tb_checksum here is a layering violation, but
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.