]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - arch/x86/include/asm/mshyperv.h
Merge branch 'x86/urgent' into x86/hyperv
[linux.git] / arch / x86 / include / asm / mshyperv.h
index da25642940d31b491bcc0d60674cd3ba378acf2e..19886fef1dfc2c5c747ef4798048318c7214bd43 100644 (file)
@@ -9,6 +9,8 @@
 #include <asm/hyperv-tlfs.h>
 #include <asm/nospec-branch.h>
 
+#define VP_INVAL       U32_MAX
+
 struct ms_hyperv_info {
        u32 features;
        u32 misc_features;
@@ -20,7 +22,6 @@ struct ms_hyperv_info {
 
 extern struct ms_hyperv_info ms_hyperv;
 
-
 /*
  * Generate the guest ID.
  */
@@ -315,6 +316,8 @@ static inline int cpumask_to_vpset(struct hv_vpset *vpset,
         */
        for_each_cpu(cpu, cpus) {
                vcpu = hv_cpu_number_to_vp_number(cpu);
+               if (vcpu == VP_INVAL)
+                       return -1;
                vcpu_bank = vcpu / 64;
                vcpu_offset = vcpu % 64;
                __set_bit(vcpu_offset, (unsigned long *)