]> xenbits.xensource.com Git - xen.git/commitdiff
x86/APIC: Switch flat driver to use phys dst for ext ints
authorMatthew Barnes <matthew.barnes@cloud.com>
Wed, 9 Oct 2024 07:54:48 +0000 (09:54 +0200)
committerJan Beulich <jbeulich@suse.com>
Wed, 9 Oct 2024 07:54:48 +0000 (09:54 +0200)
External interrupts via logical delivery mode in xAPIC do not benefit
from targeting multiple CPUs and instead simply bloat up the vector
space.

However the xAPIC flat driver currently uses logical delivery for
external interrupts.

This patch switches the xAPIC flat driver to use physical destination
mode for external interrupts, instead of logical destination mode.

This patch also applies the following non-functional changes:
- Remove now unused logical flat functions
- Expand GENAPIC_FLAT and GENAPIC_PHYS macros, and delete them.

Resolves: https://gitlab.com/xen-project/xen/-/issues/194
Signed-off-by: Matthew Barnes <matthew.barnes@cloud.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
xen/arch/x86/genapic/bigsmp.c
xen/arch/x86/genapic/default.c
xen/arch/x86/genapic/delivery.c
xen/arch/x86/include/asm/genapic.h

index e97e4453a033690913cc4e156928698d70e2b68b..b2e721845275058c3ffd8fe655adbfc4bc1af231 100644 (file)
@@ -46,5 +46,11 @@ static int __init cf_check probe_bigsmp(void)
 
 const struct genapic __initconst_cf_clobber apic_bigsmp = {
        APIC_INIT("bigsmp", probe_bigsmp),
-       GENAPIC_PHYS
+       .int_delivery_mode = dest_Fixed,
+       .int_dest_mode = 0, /* physical delivery */
+       .init_apic_ldr = init_apic_ldr_phys,
+       .vector_allocation_cpumask = vector_allocation_cpumask_phys,
+       .cpu_mask_to_apicid = cpu_mask_to_apicid_phys,
+       .send_IPI_mask = send_IPI_mask_phys,
+       .send_IPI_self = send_IPI_self_legacy
 };
index a968836a18784403d13f1266492e2ab05a545461..59c79afdb8fa96ae194784ad171051e555b957b7 100644 (file)
 /* should be called last. */
 const struct genapic __initconst_cf_clobber apic_default = {
        APIC_INIT("default", NULL),
-       GENAPIC_FLAT
+       .int_delivery_mode = dest_Fixed,
+       .int_dest_mode = 0, /* physical delivery */
+       .init_apic_ldr = init_apic_ldr_flat,
+       .vector_allocation_cpumask = vector_allocation_cpumask_phys,
+       .cpu_mask_to_apicid = cpu_mask_to_apicid_phys,
+       .send_IPI_mask = send_IPI_mask_flat,
+       .send_IPI_self = send_IPI_self_legacy
 };
index d1f99bf6834a52865f6c66e81fd5a9594ab3b8c1..3def78f380d37d4540e8a81ac3d4933617eee7b3 100644 (file)
@@ -19,16 +19,6 @@ void cf_check init_apic_ldr_flat(void)
        apic_write(APIC_LDR, val);
 }
 
-const cpumask_t *cf_check vector_allocation_cpumask_flat(int cpu)
-{
-       return &cpu_online_map;
-} 
-
-unsigned int cf_check cpu_mask_to_apicid_flat(const cpumask_t *cpumask)
-{
-       return cpumask_bits(cpumask)[0]&0xFF;
-}
-
 /*
  * PHYSICAL DELIVERY MODE (unicast to physical APIC IDs).
  */
index a694371c6d1623b6a96da5c24608ea472da0f0a9..4d39fb9a244b2c5ceea8fd4f111e3f3bb2b3cebd 100644 (file)
@@ -44,29 +44,11 @@ extern const struct genapic apic_bigsmp;
 void cf_check send_IPI_self_legacy(uint8_t vector);
 
 void cf_check init_apic_ldr_flat(void);
-unsigned int cf_check cpu_mask_to_apicid_flat(const cpumask_t *cpumask);
 void cf_check send_IPI_mask_flat(const cpumask_t *cpumask, int vector);
-const cpumask_t *cf_check vector_allocation_cpumask_flat(int cpu);
-#define GENAPIC_FLAT \
-       .int_delivery_mode = dest_LowestPrio, \
-       .int_dest_mode = 1 /* logical delivery */, \
-       .init_apic_ldr = init_apic_ldr_flat, \
-       .vector_allocation_cpumask = vector_allocation_cpumask_flat, \
-       .cpu_mask_to_apicid = cpu_mask_to_apicid_flat, \
-       .send_IPI_mask = send_IPI_mask_flat, \
-       .send_IPI_self = send_IPI_self_legacy
 
 void cf_check init_apic_ldr_phys(void);
 unsigned int cf_check cpu_mask_to_apicid_phys(const cpumask_t *cpumask);
 void cf_check send_IPI_mask_phys(const cpumask_t *mask, int vector);
 const cpumask_t *cf_check vector_allocation_cpumask_phys(int cpu);
-#define GENAPIC_PHYS \
-       .int_delivery_mode = dest_Fixed, \
-       .int_dest_mode = 0 /* physical delivery */, \
-       .init_apic_ldr = init_apic_ldr_phys, \
-       .vector_allocation_cpumask = vector_allocation_cpumask_phys, \
-       .cpu_mask_to_apicid = cpu_mask_to_apicid_phys, \
-       .send_IPI_mask = send_IPI_mask_phys, \
-       .send_IPI_self = send_IPI_self_legacy
 
 #endif