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

[PATCH 01/12] x86/apic: remove cpu_mask_to_apicid hook


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: Roger Pau Monne <roger.pau@xxxxxxxxxx>
  • Date: Thu, 20 Nov 2025 10:06:26 +0100
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; 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=A+3Za9LyGvxYALLsg1XgahqG2nvkE8DL7H3BT/GA2ww=; b=CDV3lOVpfTnH76E7KGr72V/LsoUuhy/+1EocokOLOTfA/a1AEttgbtNyEr18xEPaf6PVe/i3UQ8BqiVLOL2FmxBoXI8CBsxqO7GueJLuSr1fFPgVEw3AiiDRoliSP2HZgYsQ4pBWtghy0hpZkI28iiiydU0vowWYj1Utr4onUSmji+G/zBezvRqZsXyxsX/WTMkZG8f4fp0eD/QW+MKnZMrEGRAVRq5ygKnaFvQ2OS6nRd0qW0eivoYnkhlg8bGgMnmP0xhYrpzaSSl8RVKuYuiKklgFoNGRGP5S/Fbbq+qGNUMZylR8LTYAjtaqPyy0vBlgI6oe3NjHeS7GIl0nIQ==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CY3pp3KGq2x5i530EyvJPlUOEY9Ql9q8yyecWEhUvSLDXRMshLa+zG8myR9gADzCn6JQcqk2H3PLagLmtU1wFjs67GSBGZt7SMYRNdEv0RikyprjNeTK8KQDPPdRPZBMvxhyBiUNTangL+2GeH8UYtA4nyIdak029jbzVag9o91TG5TpgmKaRSMINM/2JJfTTG50fLXpKzJM/bdbmqGdBTETc1l2yMpdUxHA+d69s/or6jkSnpcA8adDoCwE0UVgW9Ztcu4vUdDVliGBmi7tLnevq9v2qD8nzHchNrnaTL2db2sD5EQacEs1nHFgDhkHSY663gvpHLHY0XuXUvyDRA==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Roger Pau Monne <roger.pau@xxxxxxxxxx>, Jan Beulich <jbeulich@xxxxxxxx>, Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Delivery-date: Thu, 20 Nov 2025 09:09:30 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

All implementations use the same hook.  No functional change intended.

Signed-off-by: Roger Pau Monné <roger.pau@xxxxxxxxxx>
---
 xen/arch/x86/genapic/bigsmp.c      |  1 -
 xen/arch/x86/genapic/default.c     |  1 -
 xen/arch/x86/genapic/delivery.c    |  2 +-
 xen/arch/x86/genapic/x2apic.c      |  2 --
 xen/arch/x86/include/asm/genapic.h | 13 +------------
 5 files changed, 2 insertions(+), 17 deletions(-)

diff --git a/xen/arch/x86/genapic/bigsmp.c b/xen/arch/x86/genapic/bigsmp.c
index ddb3a0b5d727..066feb4a1755 100644
--- a/xen/arch/x86/genapic/bigsmp.c
+++ b/xen/arch/x86/genapic/bigsmp.c
@@ -48,7 +48,6 @@ const struct genapic __initconst_cf_clobber apic_bigsmp = {
        APIC_INIT("bigsmp", probe_bigsmp),
        .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
 };
diff --git a/xen/arch/x86/genapic/default.c b/xen/arch/x86/genapic/default.c
index 16e1875f6378..ab9a292464d6 100644
--- a/xen/arch/x86/genapic/default.c
+++ b/xen/arch/x86/genapic/default.c
@@ -18,7 +18,6 @@ const struct genapic __initconst_cf_clobber apic_default = {
        APIC_INIT("default", NULL),
        .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
 };
diff --git a/xen/arch/x86/genapic/delivery.c b/xen/arch/x86/genapic/delivery.c
index 15100439be05..5d105e848502 100644
--- a/xen/arch/x86/genapic/delivery.c
+++ b/xen/arch/x86/genapic/delivery.c
@@ -35,7 +35,7 @@ const cpumask_t *cf_check vector_allocation_cpumask_phys(int 
cpu)
        return cpumask_of(cpu);
 }
 
-unsigned int cf_check cpu_mask_to_apicid_phys(const cpumask_t *cpumask)
+unsigned int cpu_mask_to_apicid(const cpumask_t *cpumask)
 {
        /* As we are using single CPU as destination, pick only one CPU here */
        return cpu_physical_id(cpumask_any(cpumask));
diff --git a/xen/arch/x86/genapic/x2apic.c b/xen/arch/x86/genapic/x2apic.c
index 58157c217ee8..f4709ab92950 100644
--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -142,7 +142,6 @@ static const struct genapic __initconst_cf_clobber 
apic_x2apic_phys = {
     APIC_INIT("x2apic_phys", NULL),
     .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_x2apic_phys,
     .send_IPI_self = send_IPI_self_x2apic
 };
@@ -162,7 +161,6 @@ static const struct genapic __initconst_cf_clobber 
apic_x2apic_mixed = {
      * hence are set to use Physical destination mode handlers.
      */
     .vector_allocation_cpumask = vector_allocation_cpumask_phys,
-    .cpu_mask_to_apicid = cpu_mask_to_apicid_phys,
 
     /*
      * The following fields are exclusively used by IPIs and hence are set to
diff --git a/xen/arch/x86/include/asm/genapic.h 
b/xen/arch/x86/include/asm/genapic.h
index 04d3f1de7a1f..6d979279bd2b 100644
--- a/xen/arch/x86/include/asm/genapic.h
+++ b/xen/arch/x86/include/asm/genapic.h
@@ -25,7 +25,6 @@ struct genapic {
 
        void (*init_apic_ldr)(void);
        const cpumask_t *(*vector_allocation_cpumask)(int cpu);
-       unsigned int (*cpu_mask_to_apicid)(const cpumask_t *cpumask);
        void (*send_IPI_mask)(const cpumask_t *mask, int vector);
     void (*send_IPI_self)(uint8_t vector);
 };
@@ -36,16 +35,6 @@ struct genapic {
 
 #define TARGET_CPUS ((const typeof(cpu_online_map) *)&cpu_online_map)
 #define init_apic_ldr() alternative_vcall(genapic.init_apic_ldr)
-#define cpu_mask_to_apicid(mask) ({ \
-       /* \
-        * There are a number of places where the address of a local variable \
-        * gets passed here. The use of ?: in alternative_call<N>() triggers an 
\
-        * "address of ... is always true" warning in such a case with at least 
\
-        * gcc 7 and 8. Hence the seemingly pointless local variable here. \
-        */ \
-       const cpumask_t *m_ = (mask); \
-       alternative_call(genapic.cpu_mask_to_apicid, m_); \
-})
 #define vector_allocation_cpumask(cpu) \
        alternative_call(genapic.vector_allocation_cpumask, cpu)
 
@@ -59,7 +48,7 @@ void cf_check init_apic_ldr_flat(void);
 void cf_check send_IPI_mask_flat(const cpumask_t *cpumask, int vector);
 
 void cf_check init_apic_ldr_phys(void);
-unsigned int cf_check cpu_mask_to_apicid_phys(const cpumask_t *cpumask);
+unsigned int cpu_mask_to_apicid(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);
 
-- 
2.51.0




 


Rackspace

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