Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-30 Thread Eduardo Habkost
On Wed, Nov 29, 2017 at 04:42:16PM -0200, Eduardo Habkost wrote: > On Wed, Nov 29, 2017 at 12:44:42PM +0100, Paolo Bonzini wrote: > > On 29/11/2017 12:44, Eduardo Habkost wrote: > > > On Mon, Nov 13, 2017 at 09:32:09AM +0100, Paolo Bonzini wrote: > > >> On 13/11/2017 08:15, Wanpeng Li wrote: > >

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-30 Thread Eduardo Habkost
On Wed, Nov 29, 2017 at 04:42:16PM -0200, Eduardo Habkost wrote: > On Wed, Nov 29, 2017 at 12:44:42PM +0100, Paolo Bonzini wrote: > > On 29/11/2017 12:44, Eduardo Habkost wrote: > > > On Mon, Nov 13, 2017 at 09:32:09AM +0100, Paolo Bonzini wrote: > > >> On 13/11/2017 08:15, Wanpeng Li wrote: > >

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-30 Thread Eduardo Habkost
On Wed, Nov 29, 2017 at 09:10:47PM -0200, Eduardo Habkost wrote: > On Wed, Nov 29, 2017 at 11:47:14PM +0100, Paolo Bonzini wrote: > > On 29/11/2017 19:42, Eduardo Habkost wrote: > > > The reproducer (not a full test case) is quite simple, see patch below. > > > > Great, thanks. I assume that the

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-30 Thread Eduardo Habkost
On Wed, Nov 29, 2017 at 09:10:47PM -0200, Eduardo Habkost wrote: > On Wed, Nov 29, 2017 at 11:47:14PM +0100, Paolo Bonzini wrote: > > On 29/11/2017 19:42, Eduardo Habkost wrote: > > > The reproducer (not a full test case) is quite simple, see patch below. > > > > Great, thanks. I assume that the

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-30 Thread Paolo Bonzini
On 30/11/2017 10:20, Wanpeng Li wrote: I'm considering trying to write one, but I don't want to duplicate work. >>> No, I haven't written one yet. >> The reproducer (not a full test case) is quite simple, see patch below. > I can also have a look if there is a formal test case. :) FWIW,

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-30 Thread Paolo Bonzini
On 30/11/2017 10:20, Wanpeng Li wrote: I'm considering trying to write one, but I don't want to duplicate work. >>> No, I haven't written one yet. >> The reproducer (not a full test case) is quite simple, see patch below. > I can also have a look if there is a formal test case. :) FWIW,

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-30 Thread Wanpeng Li
2017-11-30 2:42 GMT+08:00 Eduardo Habkost : > On Wed, Nov 29, 2017 at 12:44:42PM +0100, Paolo Bonzini wrote: >> On 29/11/2017 12:44, Eduardo Habkost wrote: >> > On Mon, Nov 13, 2017 at 09:32:09AM +0100, Paolo Bonzini wrote: >> >> On 13/11/2017 08:15, Wanpeng Li wrote: >> >>>

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-30 Thread Wanpeng Li
2017-11-30 2:42 GMT+08:00 Eduardo Habkost : > On Wed, Nov 29, 2017 at 12:44:42PM +0100, Paolo Bonzini wrote: >> On 29/11/2017 12:44, Eduardo Habkost wrote: >> > On Mon, Nov 13, 2017 at 09:32:09AM +0100, Paolo Bonzini wrote: >> >> On 13/11/2017 08:15, Wanpeng Li wrote: >> >>> 2017-11-10 17:49

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-29 Thread Eduardo Habkost
On Wed, Nov 29, 2017 at 11:47:14PM +0100, Paolo Bonzini wrote: > On 29/11/2017 19:42, Eduardo Habkost wrote: > > The reproducer (not a full test case) is quite simple, see patch below. > > Great, thanks. I assume that the patch doesn't fix it?!? I was so convinced that it was impossible for the

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-29 Thread Eduardo Habkost
On Wed, Nov 29, 2017 at 11:47:14PM +0100, Paolo Bonzini wrote: > On 29/11/2017 19:42, Eduardo Habkost wrote: > > The reproducer (not a full test case) is quite simple, see patch below. > > Great, thanks. I assume that the patch doesn't fix it?!? I was so convinced that it was impossible for the

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-29 Thread Paolo Bonzini
On 29/11/2017 19:42, Eduardo Habkost wrote: > The reproducer (not a full test case) is quite simple, see patch below. Great, thanks. I assume that the patch doesn't fix it?!? Paolo > Now, I've noticed something interesting when running the > reproducer: > > If the test_fetch_failure() call

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-29 Thread Paolo Bonzini
On 29/11/2017 19:42, Eduardo Habkost wrote: > The reproducer (not a full test case) is quite simple, see patch below. Great, thanks. I assume that the patch doesn't fix it?!? Paolo > Now, I've noticed something interesting when running the > reproducer: > > If the test_fetch_failure() call

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-29 Thread Eduardo Habkost
On Wed, Nov 29, 2017 at 12:44:42PM +0100, Paolo Bonzini wrote: > On 29/11/2017 12:44, Eduardo Habkost wrote: > > On Mon, Nov 13, 2017 at 09:32:09AM +0100, Paolo Bonzini wrote: > >> On 13/11/2017 08:15, Wanpeng Li wrote: > >>> 2017-11-10 17:49 GMT+08:00 Paolo Bonzini : >

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-29 Thread Eduardo Habkost
On Wed, Nov 29, 2017 at 12:44:42PM +0100, Paolo Bonzini wrote: > On 29/11/2017 12:44, Eduardo Habkost wrote: > > On Mon, Nov 13, 2017 at 09:32:09AM +0100, Paolo Bonzini wrote: > >> On 13/11/2017 08:15, Wanpeng Li wrote: > >>> 2017-11-10 17:49 GMT+08:00 Paolo Bonzini : > Sometimes, a processor

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-29 Thread Paolo Bonzini
On 29/11/2017 12:44, Eduardo Habkost wrote: > On Mon, Nov 13, 2017 at 09:32:09AM +0100, Paolo Bonzini wrote: >> On 13/11/2017 08:15, Wanpeng Li wrote: >>> 2017-11-10 17:49 GMT+08:00 Paolo Bonzini : Sometimes, a processor might execute an instruction while another

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-29 Thread Paolo Bonzini
On 29/11/2017 12:44, Eduardo Habkost wrote: > On Mon, Nov 13, 2017 at 09:32:09AM +0100, Paolo Bonzini wrote: >> On 13/11/2017 08:15, Wanpeng Li wrote: >>> 2017-11-10 17:49 GMT+08:00 Paolo Bonzini : Sometimes, a processor might execute an instruction while another processor is updating

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-29 Thread Eduardo Habkost
On Mon, Nov 13, 2017 at 09:32:09AM +0100, Paolo Bonzini wrote: > On 13/11/2017 08:15, Wanpeng Li wrote: > > 2017-11-10 17:49 GMT+08:00 Paolo Bonzini : > >> Sometimes, a processor might execute an instruction while another > >> processor is updating the page tables for that

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-29 Thread Eduardo Habkost
On Mon, Nov 13, 2017 at 09:32:09AM +0100, Paolo Bonzini wrote: > On 13/11/2017 08:15, Wanpeng Li wrote: > > 2017-11-10 17:49 GMT+08:00 Paolo Bonzini : > >> Sometimes, a processor might execute an instruction while another > >> processor is updating the page tables for that instruction's code page,

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-16 Thread Radim Krčmář
2017-11-13 09:32+0100, Paolo Bonzini: > On 13/11/2017 08:15, Wanpeng Li wrote: > > 2017-11-10 17:49 GMT+08:00 Paolo Bonzini : > >> Sometimes, a processor might execute an instruction while another > >> processor is updating the page tables for that instruction's code page, >

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-16 Thread Radim Krčmář
2017-11-13 09:32+0100, Paolo Bonzini: > On 13/11/2017 08:15, Wanpeng Li wrote: > > 2017-11-10 17:49 GMT+08:00 Paolo Bonzini : > >> Sometimes, a processor might execute an instruction while another > >> processor is updating the page tables for that instruction's code page, > >> but before the TLB

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-13 Thread Yanan Fu
; > <ehabk...@redhat.com> > Sent: Monday, November 13, 2017 4:32:09 PM > Subject: Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn > > On 13/11/2017 08:15, Wanpeng Li wrote: > > 2017-11-10 17:49 GMT+08:00 Paolo Bonzini <pbonz...@redhat.com>: > >&

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-13 Thread Yanan Fu
- Original Message - > From: "Paolo Bonzini" > To: "Wanpeng Li" > Cc: linux-kernel@vger.kernel.org, "kvm" , > y...@redhat.com, "Eduardo Habkost" > > Sent: Monday, November 13, 2017 4:32:09 PM > Subject: Re: [PATCH] KVM: x86

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-13 Thread Paolo Bonzini
On 13/11/2017 08:15, Wanpeng Li wrote: > 2017-11-10 17:49 GMT+08:00 Paolo Bonzini : >> Sometimes, a processor might execute an instruction while another >> processor is updating the page tables for that instruction's code page, >> but before the TLB shootdown completes. The

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-13 Thread Paolo Bonzini
On 13/11/2017 08:15, Wanpeng Li wrote: > 2017-11-10 17:49 GMT+08:00 Paolo Bonzini : >> Sometimes, a processor might execute an instruction while another >> processor is updating the page tables for that instruction's code page, >> but before the TLB shootdown completes. The interesting case

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-12 Thread Wanpeng Li
2017-11-10 17:49 GMT+08:00 Paolo Bonzini : > Sometimes, a processor might execute an instruction while another > processor is updating the page tables for that instruction's code page, > but before the TLB shootdown completes. The interesting case happens > if the page is in

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-12 Thread Wanpeng Li
2017-11-10 17:49 GMT+08:00 Paolo Bonzini : > Sometimes, a processor might execute an instruction while another > processor is updating the page tables for that instruction's code page, > but before the TLB shootdown completes. The interesting case happens > if the page is in the TLB. > > In

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-10 Thread Radim Krčmář
2017-11-10 10:49+0100, Paolo Bonzini: > Sometimes, a processor might execute an instruction while another > processor is updating the page tables for that instruction's code page, > but before the TLB shootdown completes. The interesting case happens > if the page is in the TLB. > > In general,

Re: [PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-10 Thread Radim Krčmář
2017-11-10 10:49+0100, Paolo Bonzini: > Sometimes, a processor might execute an instruction while another > processor is updating the page tables for that instruction's code page, > but before the TLB shootdown completes. The interesting case happens > if the page is in the TLB. > > In general,

[PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-10 Thread Paolo Bonzini
Sometimes, a processor might execute an instruction while another processor is updating the page tables for that instruction's code page, but before the TLB shootdown completes. The interesting case happens if the page is in the TLB. In general, the processor will succeed in executing the

[PATCH] KVM: x86: inject exceptions produced by x86_decode_insn

2017-11-10 Thread Paolo Bonzini
Sometimes, a processor might execute an instruction while another processor is updating the page tables for that instruction's code page, but before the TLB shootdown completes. The interesting case happens if the page is in the TLB. In general, the processor will succeed in executing the