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

Re: [Xen-devel] [PATCH] x86/APIC: reduce self-IPI related code



On 09/09/14 16:49, Jan Beulich wrote:
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>


--- 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_x
     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;
--- a/xen/arch/x86/smp.c
+++ b/xen/arch/x86/smp.c
@@ -124,21 +124,11 @@ static void __default_send_IPI_shortcut(
     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];
--- 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_cpuma
 	.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_cpuma
 	.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





_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
http://lists.xen.org/xen-devel

 


Rackspace

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