Skip to contentSkip to conversation

fix 64-bit hvm guest migration

PATCH In review David Lively 2 participants 2 messages Oct 10, 2007 – Oct 11, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fix 64-bit hvm guest migration

Hi -
We (well, Robert) just (earlier today) noticed we couldn't migrate
64-bit guests with the 3.1.1 and unstable hypervisors. The culprit was a too-strict test on guest EFER bits, trivially fixed by the following patch, which applies to both unstable and 3.1.1. Sorry we didn't catch this before today ...

Dave

The sanity check for ctxt.msr_efer used to fail when EFER_LMA was set. This prevent migration of 64-bit guests.

xen/arch/x86/hvm/hvm.c +1 -2
diff -r e56402b6e155 xen/arch/x86/hvm/hvm.c
@@ -389,8 +389,7 @@ static int hvm_load_cpu_ctxt(struct doma
                  ctxt.msr_efer);
         return -EINVAL;
     }
-
-    if ( (ctxt.msr_efer & ~(EFER_LME | EFER_NX | EFER_SCE)) ||
+    if ( (ctxt.msr_efer & ~(EFER_LME | EFER_LMA | EFER_NX | EFER_SCE)) ||
          ((sizeof(long) != 8) && (ctxt.msr_efer & EFER_LME)) ||
          (!cpu_has_nx && (ctxt.msr_efer & EFER_NX)) ||
          (!cpu_has_syscall && (ctxt.msr_efer & EFER_SCE)) ||

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel

#1 lore raw

Yep, that's a very obvious bug. I'll slip the 3.1.1 release tag for it and get it pushed to the main public tree.

Thanks,
Keir

Quoted 32 lines · David Lively

Hi -
We (well, Robert) just (earlier today) noticed we couldn't migrate
64-bit guests with the 3.1.1 and unstable hypervisors. The culprit was a too-strict test on guest EFER bits, trivially fixed by the following patch, which applies to both unstable and 3.1.1. Sorry we didn't catch this before today ...

Dave

The sanity check for ctxt.msr_efer used to fail when EFER_LMA was set. This prevent migration of 64-bit guests.

diff -r e56402b6e155 xen/arch/x86/hvm/hvm.c

xen/arch/x86/hvm/hvm.c Wed Oct 10 11:37:02 2007 -0400 +1 -2
@@ -389,8 +389,7 @@ static int hvm_load_cpu_ctxt(struct doma
                  ctxt.msr_efer);
         return -EINVAL;
     }
-
-    if ( (ctxt.msr_efer & ~(EFER_LME | EFER_NX | EFER_SCE)) ||
+    if ( (ctxt.msr_efer & ~(EFER_LME | EFER_LMA | EFER_NX | EFER_SCE)) ||
          ((sizeof(long) != 8) && (ctxt.msr_efer & EFER_LME)) ||
          (!cpu_has_nx && (ctxt.msr_efer & EFER_NX)) ||
          (!cpu_has_syscall && (ctxt.msr_efer & EFER_SCE)) ||

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel