Message ID | e37de36e717fea8312ea6cfc18fbc99154120301.1458340713.git.pfeiner@google.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
On 18/03/2016 23:39, Peter Feiner wrote: > If vmlaunch or vmresume returns immediately, there's definitely been > an error -- rflags only needs to be consulted to determine what > error occurred. By setting fail=1 unconditionally, the test framework > will now detect problems with rflags *not* being set properly. You should still do the setbe, and follow it with orl $2, %0. Then if fail==2 there is a problem. Paolo > Signed-off-by: Peter Feiner <pfeiner@google.com> > --- > x86/vmx.c | 3 ++- > 1 file changed, 2 insertions(+), 1 deletion(-) > > diff --git a/x86/vmx.c b/x86/vmx.c > index b2e015f..27e85eb 100644 > --- a/x86/vmx.c > +++ b/x86/vmx.c > @@ -911,6 +911,7 @@ static int vmx_run() > u32 ret = 0, fail = 0; > > while (1) { > + > asm volatile ( > "mov %%rsp, %%rsi\n\t" > "mov %2, %%rdi\n\t" > @@ -926,7 +927,7 @@ static int vmx_run() > "vmresume\n\t" > "2: " > SAVE_GPR_C > - "setbe %0\n\t" > + "movl $1, %0\n\t" > "jmp 3f\n\t" > "vmx_return:\n\t" > SAVE_GPR_C > -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
On 19/03/2016 10:18, Paolo Bonzini wrote: > > > On 18/03/2016 23:39, Peter Feiner wrote: >> If vmlaunch or vmresume returns immediately, there's definitely been >> an error -- rflags only needs to be consulted to determine what >> error occurred. By setting fail=1 unconditionally, the test framework >> will now detect problems with rflags *not* being set properly. > > You should still do the setbe, and follow it with orl $2, %0. Then if > fail==2 there is a problem. Nevermind, this is checked already below. Paolo -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html
diff --git a/x86/vmx.c b/x86/vmx.c index b2e015f..27e85eb 100644 --- a/x86/vmx.c +++ b/x86/vmx.c @@ -911,6 +911,7 @@ static int vmx_run() u32 ret = 0, fail = 0; while (1) { + asm volatile ( "mov %%rsp, %%rsi\n\t" "mov %2, %%rdi\n\t" @@ -926,7 +927,7 @@ static int vmx_run() "vmresume\n\t" "2: " SAVE_GPR_C - "setbe %0\n\t" + "movl $1, %0\n\t" "jmp 3f\n\t" "vmx_return:\n\t" SAVE_GPR_C
If vmlaunch or vmresume returns immediately, there's definitely been an error -- rflags only needs to be consulted to determine what error occurred. By setting fail=1 unconditionally, the test framework will now detect problems with rflags *not* being set properly. Signed-off-by: Peter Feiner <pfeiner@google.com> --- x86/vmx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)