From: Roger Pau Monne <roger.pau@citrix.com>
To: xen-devel@lists.xenproject.org
Cc: Roger Pau Monne <roger.pau@citrix.com>,
Jan Beulich <jbeulich@suse.com>,
Andrew Cooper <andrew.cooper3@citrix.com>, Wei Liu <wl@xen.org>
Subject: [PATCH] x86/pvh: do not forward MADT Local APIC NMI structures to dom0
Date: Wed, 16 Nov 2022 17:42:16 +0100 [thread overview]
Message-ID: <20221116164216.7220-1-roger.pau@citrix.com> (raw)
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>
---
xen/arch/x86/hvm/dom0_build.c | 34 +---------------------------------
1 file changed, 1 insertion(+), 33 deletions(-)
diff --git a/xen/arch/x86/hvm/dom0_build.c b/xen/arch/x86/hvm/dom0_build.c
index 307edc6a8c..d44de7f2b2 100644
--- a/xen/arch/x86/hvm/dom0_build.c
+++ b/xen/arch/x86/hvm/dom0_build.c
@@ -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)
@@ -763,25 +760,6 @@ static int __init cf_check acpi_set_intr_ovr(
return 0;
}
-static int __init cf_check acpi_count_nmi_src(
- struct acpi_subtable_header *header, const unsigned long end)
-{
- acpi_nmi_sources++;
- return 0;
-}
-
-static int __init cf_check 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;
@@ -797,16 +775,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);
@@ -862,12 +835,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
--
2.37.3
next reply other threads:[~2022-11-16 16:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-11-16 16:42 Roger Pau Monne [this message]
2022-11-16 16:56 ` [PATCH] x86/pvh: do not forward MADT Local APIC NMI structures to dom0 Andrew Cooper
2022-11-16 17:25 ` Roger Pau Monné
2022-11-17 9:27 ` Jan Beulich
2022-11-17 10:23 ` Roger Pau Monné
2022-11-17 11:05 ` Jan Beulich
2022-11-17 11:35 ` Andrew Cooper
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20221116164216.7220-1-roger.pau@citrix.com \
--to=roger.pau@citrix.com \
--cc=andrew.cooper3@citrix.com \
--cc=jbeulich@suse.com \
--cc=wl@xen.org \
--cc=xen-devel@lists.xenproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.