]> xenbits.xensource.com Git - people/royger/xen.git/commitdiff
x86/Kconfig: add selection of default x2APIC destination mode
authorRoger Pau Monne <roger.pau@citrix.com>
Wed, 22 Jun 2022 12:26:48 +0000 (14:26 +0200)
committerRoger Pau Monne <roger.pau@citrix.com>
Wed, 22 Jun 2022 12:42:39 +0000 (14:42 +0200)
Allow selecting the default x2APIC destination mode from Kconfig.
Note the default destination mode is still Logical (Cluster) mode.

Signed-off-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/Kconfig
xen/arch/x86/genapic/x2apic.c

index 1e31edc99f9d498d59e1fcf1fbc07c165c27d418..f560dc13f430cdcff4e56962b4037f05e7bbf574 100644 (file)
@@ -226,6 +226,35 @@ config XEN_ALIGN_2M
 
 endchoice
 
+choice
+       prompt "x2APIC default destination mode"
+       default X2APIC_LOGICAL
+       ---help---
+         Specify default destination mode for x2APIC.
+
+         If unsure, choose "Logical".
+
+config X2APIC_LOGICAL
+       bool "Logical mode"
+       ---help---
+         Use Logical Destination mode.
+
+         When using this mode APICs are addressed using the Logical
+         Destination mode, which allows for optimized IPI sending,
+         but also reduces the amount of vectors available for external
+         interrupts when compared to physical mode.
+
+config X2APIC_PHYS
+       bool "Physical mode"
+       ---help---
+         Use Physical Destination mode.
+
+         When using this mode APICs are addressed using the Physical
+         Destination mode, which allows using all dynamic vectors on
+         each CPU independently.
+
+endchoice
+
 config GUEST
        bool
 
index de5032f2020ac65cc35219d693864ef587dc255b..4b9bbe2f3ed2da58e2e5efb4bd5eb2202f406729 100644 (file)
@@ -228,7 +228,7 @@ static struct notifier_block x2apic_cpu_nfb = {
    .notifier_call = update_clusterinfo
 };
 
-static s8 __initdata x2apic_phys = -1; /* By default we use logical cluster mode. */
+static int8_t __initdata x2apic_phys = -1;
 boolean_param("x2apic_phys", x2apic_phys);
 
 const struct genapic *__init apic_x2apic_probe(void)
@@ -241,7 +241,9 @@ const struct genapic *__init apic_x2apic_probe(void)
          * the usage of the high 16 bits to hold the cluster ID.
          */
         x2apic_phys = !iommu_intremap ||
-                      (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL);
+                      (acpi_gbl_FADT.flags & ACPI_FADT_APIC_PHYSICAL) ||
+                      (IS_ENABLED(CONFIG_X2APIC_PHYS) &&
+                       !(acpi_gbl_FADT.flags & ACPI_FADT_APIC_CLUSTER));
     }
     else if ( !x2apic_phys )
         switch ( iommu_intremap )