From: Liran Alon <LIRAN.ALON@ORACLE.COM>
To: Paolo Bonzini <pbonzini@redhat.com>,
rkrcmar@redhat.com, kvm@vger.kernel.org
Cc: idan.brown@ORACLE.COM, Liran Alon <liran.alon@ravellosystems.com>,
Konrad Rzeszutek Wilk <konrad.wilk@ORACLE.COM>
Subject: Re: [PATCH 3/3] KVM: x86: Don't re-execute instruction when not passing CR2 value
Date: Mon, 06 Nov 2017 12:48:20 +0200 [thread overview]
Message-ID: <5A003DF4.9060405@ORACLE.COM> (raw)
In-Reply-To: <db37e7b9-497f-14bc-9828-fa89ab0e9bf2@redhat.com>
On 06/11/17 11:21, Paolo Bonzini wrote:
> On 05/11/2017 15:21, Liran Alon wrote:
>> From: Liran Alon <liran.alon@ravellosystems.com>
>>
>> In case of instruction-decode failure or emulation failure,
>> x86_emulate_instruction() will call reexecute_instruction() which will
>> attempt to use the cr2 value passed to x86_emulate_instruction().
>> However, when x86_emulate_instruction() is called from
>> emulate_instruction(), cr2 is not passed (passed as 0) and therefore
>> it doesn't make sense to execute reexecute_instruction() logic at all.
>>
>> Fixes: 51d8b66199e9 ("KVM: cleanup emulate_instruction")
>>
>> Signed-off-by: Liran Alon <liran.alon@oracle.com>
>> Reviewed-by: Nikita Leshenko <nikita.leshchenko@oracle.com>
>> Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>> Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
>> ---
>> arch/x86/include/asm/kvm_host.h | 3 ++-
>> 1 file changed, 2 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/x86/include/asm/kvm_host.h b/arch/x86/include/asm/kvm_host.h
>> index c73e493adf07..bc1347949cef 100644
>> --- a/arch/x86/include/asm/kvm_host.h
>> +++ b/arch/x86/include/asm/kvm_host.h
>> @@ -1156,7 +1156,8 @@ int x86_emulate_instruction(struct kvm_vcpu *vcpu, unsigned long cr2,
>> static inline int emulate_instruction(struct kvm_vcpu *vcpu,
>> int emulation_type)
>> {
>> - return x86_emulate_instruction(vcpu, 0, emulation_type, NULL, 0);
>> + return x86_emulate_instruction(vcpu, 0,
>> + emulation_type | EMULTYPE_NO_REEXECUTE, NULL, 0);
>> }
>>
>> void kvm_enable_efer_bits(u64);
>>
>
> You can remove EMULTYPE_NO_REEXECUTE from handle_invalid_guest_state now.
Nice catch. Will remove it in next version of this commit. Thanks.
>
> Thanks,
>
> Paolo
>
next prev parent reply other threads:[~2017-11-06 10:48 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-11-05 14:21 [PATCH 0/3] KVM: x86: Various emulator fixes Liran Alon
2017-11-05 14:21 ` [PATCH 1/3] KVM: x86: Exit to user-mode on #UD intercept when emulator requires Liran Alon
2017-11-06 9:15 ` Paolo Bonzini
2017-11-05 14:21 ` [PATCH 2/3] KVM: x86: emulator: Return to user-mode on L1 CPL=0 emulation failure Liran Alon
2017-11-06 9:19 ` Paolo Bonzini
2017-11-06 13:25 ` Liran Alon
2017-11-06 13:50 ` Paolo Bonzini
2017-11-06 14:08 ` Liran Alon
2017-11-06 14:13 ` Paolo Bonzini
2017-11-05 14:21 ` [PATCH 3/3] KVM: x86: Don't re-execute instruction when not passing CR2 value Liran Alon
2017-11-06 9:21 ` Paolo Bonzini
2017-11-06 10:48 ` Liran Alon [this message]
-- strict thread matches above, loose matches on Subject: below --
2017-11-05 14:56 [PATCH 0/3] KVM: x86: Various emulator fixes Liran Alon
2017-11-05 14:56 ` [PATCH 3/3] KVM: x86: Don't re-execute instruction when not passing CR2 value Liran Alon
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=5A003DF4.9060405@ORACLE.COM \
--to=liran.alon@oracle.com \
--cc=idan.brown@ORACLE.COM \
--cc=konrad.wilk@ORACLE.COM \
--cc=kvm@vger.kernel.org \
--cc=liran.alon@ravellosystems.com \
--cc=pbonzini@redhat.com \
--cc=rkrcmar@redhat.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.