[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 1/6][4.16?] x86/x2APIC: defer probe until after IOMMU ACPI table parsing


  • To: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Jan Beulich <jbeulich@xxxxxxxx>
  • Date: Fri, 5 Nov 2021 13:32:18 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=eD3TE16l92CP4qd/opwvhY7rtYk3soAjAnhlGWqnci8=; b=A+TVSN2Dttn7XP5CmPVy2ZeIfb+W8Ulo6DTDcLeJ5ySuZkosvRMjmelSqXosLnIef4r38q27kDs5vWE4X0IJxfzdGVLnWWpzaiIu5bo5zb0M4t+VoMsf54v3ojIOmFsizxP4DbCya8kJ92W6aMPacAsCWllL7sVoGOnQCMgf0TojxzzbpgfieDWYd+drT1DnXFzV3M3D/XwyPbWtnst4ppLGy+WIuMbpCkMgOwFoEG8C/IOq5BvcIk1Hejx+bF2z52S1gVsrVYi164QxVUZo1wMkxIhniy+D2+/brw6xfYskwBJVFmuswq1xvepcq9s04TiX+4QG1A+WyYOMqRLA3Q==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=Z6evdVd8b0/2GuxJZRcgSrT3jvoS3bVEdrh75B/I2OgHQnBTa+8o2djW+awmjNd546V4cxHSk6ILPTcK+kIyfnCWt4vs8e/CJjfnJmJY3pBudEhNUAmgrInKK5Ncql/mfgpwSpiJ7jKHsgZzqucF/j4RFnLa+/WeQ2oqd+bL0Ld8wiBXpk5TYgvq7gRmQ+ICTdFDAcE3ilJ3ql5+A0XMj/4TfrBMglq8o8a4G6KStHPFl4eKUrFaQBxrdqi45b5VRNa8YpRhlFD5bhtxWlfaxuSeKVlcrzttuQyYoBPSy3km2xGQmDObBVZ6Wum7AJuj7OUPxfldnLYvQ1CHzC74CQ==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Wei Liu <wl@xxxxxxx>, Roger Pau Monné <roger.pau@xxxxxxxxxx>, Ian Jackson <iwj@xxxxxxxxxxxxxx>
  • Delivery-date: Fri, 05 Nov 2021 12:32:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

While commit 46c4061cd2bf ("x86/IOMMU: mark IOMMU / intremap not in use
when ACPI tables are missing") deals with apic_x2apic_probe() as called
from x2apic_bsp_setup(), the check_x2apic_preenabled() path is similarly
affected: The call needs to occur after acpi_iommu_init(), such that
iommu_intremap getting disabled there can be properly taken into account
by apic_x2apic_probe().

Note that, for the time being (further cleanup patches following),
reversing the order of the calls to generic_apic_probe() and
acpi_boot_init() is not an option:
- acpi_process_madt() calls clustered_apic_check() and hence relies on
  genapic to have got filled before,
- generic_bigsmp_probe() (called from acpi_process_madt()) needs to
  occur after generic_apic_probe(),
- acpi_parse_madt() (called from acpi_process_madt()) calls
  acpi_madt_oem_check(), which wants to be after generic_apic_probe().

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
---
Based on code inspection only - I have no affected system and hence no
way to actually test the case.
---
v2: Don't move generic_apic_probe() invocation, instead pull out
    acpi_iommu_init() from acpi_boot_init().
---
4.16: While investigating the issue addressed by the referenced commit,
      a variant of that problem was identified when firmware pre-enables
      x2APIC mode. Whether that's something sane firmware would do when
      at the same time IOMMU(s) is/are disabled is unclear, so this may
      be a purely academical consideration. Working around the problem
      also ought to be as simple as passing "iommu=no-intremap" on the
      command line. Considering the fragility of the code (as further
      demonstrated by v1 having been completely wrong), it may therefore
      be advisable to defer this change until after branching.
      Nevertheless it will then be a backporting candidate, so
      considering to take it right away can't simply be put off.

--- a/xen/arch/x86/acpi/boot.c
+++ b/xen/arch/x86/acpi/boot.c
@@ -757,8 +757,6 @@ int __init acpi_boot_init(void)
 
        acpi_mmcfg_init();
 
-       acpi_iommu_init();
-
        erst_init();
 
        acpi_hest_init();
--- a/xen/arch/x86/setup.c
+++ b/xen/arch/x86/setup.c
@@ -1699,6 +1699,13 @@ void __init noreturn __start_xen(unsigne
 
     dmi_scan_machine();
 
+    /*
+     * IOMMU-related ACPI table parsing has to happen before APIC probing, for
+     * check_x2apic_preenabled() to be able to observe respective findings, in
+     * particular iommu_intremap having got turned off.
+     */
+    acpi_iommu_init();
+
     generic_apic_probe();
 
     mmio_ro_ranges = rangeset_new(NULL, "r/o mmio ranges",




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.