]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - arch/x86/hyperv/hv_apic.c
Merge branch 'x86/urgent' into x86/hyperv
[linux.git] / arch / x86 / hyperv / hv_apic.c
index ee962784d25b7ef84a353ae0fc16e07182fdb4c1..0c3c9f8fee77bbeaf2db91072b32b3c70d9205ee 100644 (file)
@@ -31,6 +31,8 @@
 #include <asm/mshyperv.h>
 #include <asm/apic.h>
 
+#include <asm/trace/hyperv.h>
+
 static struct apic orig_apic;
 
 static u64 hv_apic_icr_read(void)
@@ -117,6 +119,8 @@ static bool __send_ipi_mask_ex(const struct cpumask *mask, int vector)
                ipi_arg->vp_set.format = HV_GENERIC_SET_SPARSE_4K;
                nr_bank = cpumask_to_vpset(&(ipi_arg->vp_set), mask);
        }
+       if (nr_bank < 0)
+               goto ipi_mask_ex_done;
        if (!nr_bank)
                ipi_arg->vp_set.format = HV_GENERIC_SET_ALL;
 
@@ -134,6 +138,8 @@ static bool __send_ipi_mask(const struct cpumask *mask, int vector)
        struct ipi_arg_non_ex ipi_arg;
        int ret = 1;
 
+       trace_hyperv_send_ipi_mask(mask, vector);
+
        if (cpumask_empty(mask))
                return true;
 
@@ -161,6 +167,9 @@ static bool __send_ipi_mask(const struct cpumask *mask, int vector)
 
        for_each_cpu(cur_cpu, mask) {
                vcpu = hv_cpu_number_to_vp_number(cur_cpu);
+               if (vcpu == VP_INVAL)
+                       return true;
+
                /*
                 * This particular version of the IPI hypercall can
                 * only target upto 64 CPUs.