From: Paolo Bonzini <pbonzini@redhat.com>
To: Peter Feiner <pfeiner@google.com>,
jan.kiszka@siemens.com, kvm@vger.kernel.org
Subject: Re: [PATCH kvm-unit-tests 2/4] x86: vmx: fix vm{launch,resume} early exit logic
Date: Sat, 19 Mar 2016 10:18:50 +0100 [thread overview]
Message-ID: <56ED197A.3000702@redhat.com> (raw)
In-Reply-To: <e37de36e717fea8312ea6cfc18fbc99154120301.1458340713.git.pfeiner@google.com>
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
>
next prev parent reply other threads:[~2016-03-19 9:18 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-18 22:39 [PATCH kvm-unit-tests 0/4] x86: vmx: vm{launch,resume} improvements Peter Feiner
2016-03-18 22:39 ` [PATCH kvm-unit-tests 1/4] x86: vmx: fix vm{launch,resume} asm Peter Feiner
2016-03-18 22:39 ` [PATCH kvm-unit-tests 2/4] x86: vmx: fix vm{launch,resume} early exit logic Peter Feiner
2016-03-19 9:18 ` Paolo Bonzini [this message]
2016-03-19 9:20 ` Paolo Bonzini
2016-03-18 22:39 ` [PATCH kvm-unit-tests 3/4] x86: vmx: clean up vm{launch,resume} asm Peter Feiner
2016-03-18 22:39 ` [PATCH kvm-unit-tests 4/4] x86: vmx: better vm{launch,resume} error handling Peter Feiner
2016-03-19 9:23 ` [PATCH kvm-unit-tests 0/4] x86: vmx: vm{launch,resume} improvements Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=56ED197A.3000702@redhat.com \
--to=pbonzini@redhat.com \
--cc=jan.kiszka@siemens.com \
--cc=kvm@vger.kernel.org \
--cc=pfeiner@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.