X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=arch%2Fx86_64%2Fkernel%2Fgenapic_xen.c;fp=arch%2Fx86_64%2Fkernel%2Fgenapic_xen.c;h=3079d649e24bc8ba65a7b666699aba57d04d9693;hb=16c70f8c1b54b61c3b951b6fb220df250fe09b32;hp=711c8237b8cec85b4893867874de0170d1503cd1;hpb=4e76c8a9fa413ccc09d3f7f664183dcce3555d57;p=linux-2.6.git diff --git a/arch/x86_64/kernel/genapic_xen.c b/arch/x86_64/kernel/genapic_xen.c index 711c8237b..3079d649e 100644 --- a/arch/x86_64/kernel/genapic_xen.c +++ b/arch/x86_64/kernel/genapic_xen.c @@ -10,7 +10,6 @@ * * Hacked to pieces for Xen by Chris Wright. */ -#include #include #include #include @@ -82,24 +81,6 @@ static void xen_init_apic_ldr(void) return; } -static void xen_send_IPI_allbutself(int vector) -{ - /* - * if there are no other CPUs in the system then - * we get an APIC send error if we try to broadcast. - * thus we have to avoid sending IPIs in this case. - */ - Dprintk("%s\n", __FUNCTION__); - if (num_online_cpus() > 1) - xen_send_IPI_shortcut(APIC_DEST_ALLBUT, vector, APIC_DEST_LOGICAL); -} - -static void xen_send_IPI_all(int vector) -{ - Dprintk("%s\n", __FUNCTION__); - xen_send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL); -} - static void xen_send_IPI_mask(cpumask_t cpumask, int vector) { unsigned long mask = cpus_addr(cpumask)[0]; @@ -118,6 +99,40 @@ static void xen_send_IPI_mask(cpumask_t cpumask, int vector) local_irq_restore(flags); } +static void xen_send_IPI_allbutself(int vector) +{ +#ifdef CONFIG_HOTPLUG_CPU + int hotplug = 1; +#else + int hotplug = 0; +#endif + /* + * if there are no other CPUs in the system then + * we get an APIC send error if we try to broadcast. + * thus we have to avoid sending IPIs in this case. + */ + Dprintk("%s\n", __FUNCTION__); + if (hotplug || vector == NMI_VECTOR) { + cpumask_t allbutme = cpu_online_map; + + cpu_clear(smp_processor_id(), allbutme); + + if (!cpus_empty(allbutme)) + xen_send_IPI_mask(allbutme, vector); + } else if (num_online_cpus() > 1) { + xen_send_IPI_shortcut(APIC_DEST_ALLBUT, vector, APIC_DEST_LOGICAL); + } +} + +static void xen_send_IPI_all(int vector) +{ + Dprintk("%s\n", __FUNCTION__); + if (vector == NMI_VECTOR) + xen_send_IPI_mask(cpu_online_map, vector); + else + xen_send_IPI_shortcut(APIC_DEST_ALLINC, vector, APIC_DEST_LOGICAL); +} + #ifdef CONFIG_XEN_PRIVILEGED_GUEST static int xen_apic_id_registered(void) { @@ -135,8 +150,7 @@ static unsigned int xen_cpu_mask_to_apicid(cpumask_t cpumask) static unsigned int phys_pkg_id(int index_msb) { - u32 ebx; - + int ebx; Dprintk("%s\n", __FUNCTION__); ebx = cpuid_ebx(1); return ((ebx >> 24) & 0xFF) >> index_msb;