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

[Xen-changelog] [xen master] x86/APIC: reduce self-IPI related code



commit 7d203b337fb2dcd148d2df850e25b67c792d4d0b
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Fri Sep 12 13:48:37 2014 +0200
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Fri Sep 12 13:48:37 2014 +0200

    x86/APIC: reduce self-IPI related code
    
    send_IPI_self_{phys,flat}() were identical and send_IPI_self_x2apic()
    was misplaced and pointlessly (implictly) had a non-x2APIC code path.
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Reviewed-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
 xen/arch/x86/genapic/x2apic.c |    5 +++++
 xen/arch/x86/smp.c            |   12 +-----------
 xen/include/asm-x86/genapic.h |   11 ++++-------
 3 files changed, 10 insertions(+), 18 deletions(-)

diff --git a/xen/arch/x86/genapic/x2apic.c b/xen/arch/x86/genapic/x2apic.c
index b2cab03..9a3cfd9 100644
--- a/xen/arch/x86/genapic/x2apic.c
+++ b/xen/arch/x86/genapic/x2apic.c
@@ -92,6 +92,11 @@ static unsigned int cpu_mask_to_apicid_x2apic_cluster(const 
cpumask_t *cpumask)
     return dest;
 }
 
+static void send_IPI_self_x2apic(uint8_t vector)
+{
+    apic_wrmsr(APIC_SELF_IPI, vector);
+}
+
 static void send_IPI_mask_x2apic_phys(const cpumask_t *cpumask, int vector)
 {
     unsigned int cpu;
diff --git a/xen/arch/x86/smp.c b/xen/arch/x86/smp.c
index 0433f30..06a833e 100644
--- a/xen/arch/x86/smp.c
+++ b/xen/arch/x86/smp.c
@@ -124,21 +124,11 @@ static void __default_send_IPI_shortcut(unsigned int 
shortcut, int vector,
     apic_write_around(APIC_ICR, cfg);
 }
 
-void send_IPI_self_flat(int vector)
+void send_IPI_self_legacy(uint8_t vector)
 {
     __default_send_IPI_shortcut(APIC_DEST_SELF, vector, APIC_DEST_PHYSICAL);
 }
 
-void send_IPI_self_phys(int vector)
-{
-    __default_send_IPI_shortcut(APIC_DEST_SELF, vector, APIC_DEST_PHYSICAL);
-}
-
-void send_IPI_self_x2apic(int vector)
-{
-    apic_write(APIC_SELF_IPI, vector);    
-}
-
 void send_IPI_mask_flat(const cpumask_t *cpumask, int vector)
 {
     unsigned long mask = cpumask_bits(cpumask)[0];
diff --git a/xen/include/asm-x86/genapic.h b/xen/include/asm-x86/genapic.h
index ad2a4fb..5496ab0 100644
--- a/xen/include/asm-x86/genapic.h
+++ b/xen/include/asm-x86/genapic.h
@@ -37,7 +37,7 @@ struct genapic {
        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)(int vector);
+    void (*send_IPI_self)(uint8_t vector);
 };
 
 #define APICFUNC(x) .x = x
@@ -52,12 +52,12 @@ extern const struct genapic *genapic;
 extern const struct genapic apic_default;
 
 const cpumask_t *target_cpus_all(void);
+void send_IPI_self_legacy(uint8_t vector);
 
 void init_apic_ldr_flat(void);
 void clustered_apic_check_flat(void);
 unsigned int cpu_mask_to_apicid_flat(const cpumask_t *cpumask);
 void send_IPI_mask_flat(const cpumask_t *mask, int vector);
-void send_IPI_self_flat(int vector);
 const cpumask_t *vector_allocation_cpumask_flat(int cpu);
 #define GENAPIC_FLAT \
        .int_delivery_mode = dest_LowestPrio, \
@@ -68,13 +68,12 @@ const cpumask_t *vector_allocation_cpumask_flat(int cpu);
        .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_flat
+       .send_IPI_self = send_IPI_self_legacy
 
 void init_apic_ldr_phys(void);
 void clustered_apic_check_phys(void);
 unsigned int cpu_mask_to_apicid_phys(const cpumask_t *cpumask);
 void send_IPI_mask_phys(const cpumask_t *mask, int vector);
-void send_IPI_self_phys(int vector);
 const cpumask_t *vector_allocation_cpumask_phys(int cpu);
 #define GENAPIC_PHYS \
        .int_delivery_mode = dest_Fixed, \
@@ -85,8 +84,6 @@ const cpumask_t *vector_allocation_cpumask_phys(int cpu);
        .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_phys
-
-void send_IPI_self_x2apic(int vector);
+       .send_IPI_self = send_IPI_self_legacy
 
 #endif
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

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