From: Vitaly Kuznetsov <vkuznets@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org,
Oliver Upton <oupton@google.com>
Subject: Re: [GIT PULL] KVM changes for Linux 5.6-rc4
Date: Tue, 03 Mar 2020 14:02:54 +0100 [thread overview]
Message-ID: <87tv35fv5t.fsf@vitty.brq.redhat.com> (raw)
In-Reply-To: <8fbeb3c2-9627-bf41-d798-bafba22073e3@redhat.com>
Paolo Bonzini <pbonzini@redhat.com> writes:
> On 02/03/20 19:40, Vitaly Kuznetsov wrote:
>>
>> qemu-system-x86-23579 [005] 22018.775584: kvm_exit: reason EPT_VIOLATION rip 0xfffff802987d6169 info 181 0
>> qemu-system-x86-23579 [005] 22018.775584: kvm_nested_vmexit: rip fffff802987d6169 reason EPT_VIOLATION info1 181 info2 0 int_info 0 int_info_err 0
>> qemu-system-x86-23579 [005] 22018.775585: kvm_page_fault: address febd0000 error_code 181
>> qemu-system-x86-23579 [005] 22018.775592: kvm_emulate_insn: 0:fffff802987d6169: f3 a5
>> qemu-system-x86-23579 [005] 22018.775593: kvm_emulate_insn: 0:fffff802987d6169: f3 a5 FAIL
>> qemu-system-x86-23579 [005] 22018.775596: kvm_inj_exception: #UD (0x0)
>>
>> We probably need to re-enable instruction emulation for something...
>
> This is a rep movsw instruction, it shouldn't be intercepted. I think
> we have a stale ctxt->intercept because the
>
> /* Fields above regs are cleared together. */
>
> comment is not true anymore since
>
> commit c44b4c6ab80eef3a9c52c7b3f0c632942e6489aa
> Author: Bandan Das <bsd@redhat.com>
> Date: Wed Apr 16 12:46:12 2014 -0400
>
> KVM: emulate: clean up initializations in init_decode_cache
>
Right you are,
a big hammer like
diff --git a/arch/x86/include/asm/kvm_emulate.h b/arch/x86/include/asm/kvm_emulate.h
index 2a8f2bd..52c9bce 100644
--- a/arch/x86/include/asm/kvm_emulate.h
+++ b/arch/x86/include/asm/kvm_emulate.h
@@ -324,14 +324,6 @@ struct x86_emulate_ctxt {
*/
/* current opcode length in bytes */
- u8 opcode_len;
- u8 b;
- u8 intercept;
- u8 op_bytes;
- u8 ad_bytes;
- struct operand src;
- struct operand src2;
- struct operand dst;
union {
int (*execute)(struct x86_emulate_ctxt *ctxt);
fastop_t fop;
@@ -343,6 +335,14 @@ struct x86_emulate_ctxt {
* or elsewhere
*/
bool rip_relative;
+ u8 opcode_len;
+ u8 b;
+ u8 intercept;
+ u8 op_bytes;
+ u8 ad_bytes;
+ struct operand src;
+ struct operand src2;
+ struct operand dst;
u8 rex_prefix;
u8 lock_prefix;
u8 rep_prefix;
seems to make the issue go away. (For those wondering why fielf
shuffling makes a difference: init_decode_cache() clears
[rip_relative, modrm) range) How did this even work before...
(I'm still looking at the code, stay tuned...)
--
Vitaly
next prev parent reply other threads:[~2020-03-03 13:03 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-24 18:57 [GIT PULL] KVM changes for Linux 5.6-rc4 Paolo Bonzini
2020-02-24 20:25 ` pr-tracker-bot
2020-03-02 18:40 ` Vitaly Kuznetsov
2020-03-03 10:58 ` Paolo Bonzini
2020-03-03 13:02 ` Vitaly Kuznetsov [this message]
2020-03-03 13:07 ` Paolo Bonzini
2020-03-03 13:38 ` Vitaly Kuznetsov
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=87tv35fv5t.fsf@vitty.brq.redhat.com \
--to=vkuznets@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=oupton@google.com \
--cc=pbonzini@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox