Re: [PATCH] kvm: x86: disable KVM_FAST_MMIO_BUS

2017-08-17 Thread Michael S. Tsirkin
On Thu, Aug 17, 2017 at 03:51:31PM +0200, Radim Krčmář wrote: > 2017-08-17 01:31+0300, Michael S. Tsirkin: > > On Wed, Aug 16, 2017 at 11:25:35PM +0200, Paolo Bonzini wrote: > > > On 16/08/2017 21:59, Michael S. Tsirkin wrote: > > > > On Wed, Aug 16, 2017 at 09:03:17PM +0200, Radim Krčmář wrote: >

Re: [PATCH] kvm: x86: disable KVM_FAST_MMIO_BUS

2017-08-17 Thread Michael S. Tsirkin
On Thu, Aug 17, 2017 at 11:00:01AM +0200, Paolo Bonzini wrote: > >> and also not a page table walk---just in case. > > > > I still don't get it, sorry. Let's assume for the sake of argument > > that it's a PT walk causing the MMIO access. Just why do you think > > that it makes sense to skip the i

Re: [PATCH] kvm: x86: disable KVM_FAST_MMIO_BUS

2017-08-17 Thread Radim Krčmář
2017-08-17 01:31+0300, Michael S. Tsirkin: > On Wed, Aug 16, 2017 at 11:25:35PM +0200, Paolo Bonzini wrote: > > On 16/08/2017 21:59, Michael S. Tsirkin wrote: > > > On Wed, Aug 16, 2017 at 09:03:17PM +0200, Radim Krčmář wrote: > > how about we blacklist nested virt for this optimization? > > >

Re: [PATCH] kvm: x86: disable KVM_FAST_MMIO_BUS

2017-08-17 Thread Radim Krčmář
2017-08-17 14:14+0200, Paolo Bonzini: > On 17/08/2017 11:00, Paolo Bonzini wrote: > > On 17/08/2017 00:31, Michael S. Tsirkin wrote: > >> On Wed, Aug 16, 2017 at 11:25:35PM +0200, Paolo Bonzini wrote: > >>> Yes, I agree. EMULTYPE_SKIP is fine because failed decoding still > >>> causes an exception

Re: [PATCH] kvm: x86: disable KVM_FAST_MMIO_BUS

2017-08-17 Thread Paolo Bonzini
On 17/08/2017 11:00, Paolo Bonzini wrote: > On 17/08/2017 00:31, Michael S. Tsirkin wrote: >> On Wed, Aug 16, 2017 at 11:25:35PM +0200, Paolo Bonzini wrote: >>> Yes, I agree. EMULTYPE_SKIP is fine because failed decoding still >>> causes an exception to be injected. Maybe it's better to gate the

Re: [PATCH] kvm: x86: disable KVM_FAST_MMIO_BUS

2017-08-17 Thread Paolo Bonzini
On 17/08/2017 00:31, Michael S. Tsirkin wrote: > On Wed, Aug 16, 2017 at 11:25:35PM +0200, Paolo Bonzini wrote: >> Yes, I agree. EMULTYPE_SKIP is fine because failed decoding still >> causes an exception to be injected. Maybe it's better to gate the >> EMULTYPE_SKIP emulation on the exit qualific

Re: [PATCH] kvm: x86: disable KVM_FAST_MMIO_BUS

2017-08-17 Thread David Hildenbrand
On 16.08.2017 14:07, Radim Krčmář wrote: > 2017-08-16 13:22+0200, Paolo Bonzini: >> Microsoft pointed out privately to me that KVM's handling of >> KVM_FAST_MMIO_BUS is invalid. Using skip_emulation_instruction is invalid >> in EPT misconfiguration vmexit handlers, because neither EPT violations >

Re: [PATCH] kvm: x86: disable KVM_FAST_MMIO_BUS

2017-08-16 Thread Michael S. Tsirkin
On Wed, Aug 16, 2017 at 11:25:35PM +0200, Paolo Bonzini wrote: > On 16/08/2017 21:59, Michael S. Tsirkin wrote: > > On Wed, Aug 16, 2017 at 09:03:17PM +0200, Radim Krčmář wrote: > >> 2017-08-16 19:19+0200, Paolo Bonzini: > >>> On 16/08/2017 18:50, Michael S. Tsirkin wrote: > On Wed, Aug 16, 20

Re: [PATCH] kvm: x86: disable KVM_FAST_MMIO_BUS

2017-08-16 Thread Paolo Bonzini
On 16/08/2017 21:59, Michael S. Tsirkin wrote: > On Wed, Aug 16, 2017 at 09:03:17PM +0200, Radim Krčmář wrote: >> 2017-08-16 19:19+0200, Paolo Bonzini: >>> On 16/08/2017 18:50, Michael S. Tsirkin wrote: On Wed, Aug 16, 2017 at 03:30:31PM +0200, Paolo Bonzini wrote: > While you can filter o

Re: [PATCH] kvm: x86: disable KVM_FAST_MMIO_BUS

2017-08-16 Thread Michael S. Tsirkin
On Wed, Aug 16, 2017 at 09:03:17PM +0200, Radim Krčmář wrote: > 2017-08-16 19:19+0200, Paolo Bonzini: > > On 16/08/2017 18:50, Michael S. Tsirkin wrote: > >> On Wed, Aug 16, 2017 at 03:30:31PM +0200, Paolo Bonzini wrote: > >>> While you can filter out instruction fetches, that's not enough. A data

Re: [PATCH] kvm: x86: disable KVM_FAST_MMIO_BUS

2017-08-16 Thread Michael S. Tsirkin
On Wed, Aug 16, 2017 at 07:19:28PM +0200, Paolo Bonzini wrote: > On 16/08/2017 18:50, Michael S. Tsirkin wrote: > > On Wed, Aug 16, 2017 at 03:30:31PM +0200, Paolo Bonzini wrote: > >> While you can filter out instruction fetches, that's not enough. A data > >> read could happen because someone poi

Re: [PATCH] kvm: x86: disable KVM_FAST_MMIO_BUS

2017-08-16 Thread Radim Krčmář
2017-08-16 19:19+0200, Paolo Bonzini: > On 16/08/2017 18:50, Michael S. Tsirkin wrote: >> On Wed, Aug 16, 2017 at 03:30:31PM +0200, Paolo Bonzini wrote: >>> While you can filter out instruction fetches, that's not enough. A data >>> read could happen because someone pointed the IDT to MMIO area, a

Re: [PATCH] kvm: x86: disable KVM_FAST_MMIO_BUS

2017-08-16 Thread Paolo Bonzini
On 16/08/2017 18:50, Michael S. Tsirkin wrote: > On Wed, Aug 16, 2017 at 03:30:31PM +0200, Paolo Bonzini wrote: >> While you can filter out instruction fetches, that's not enough. A data >> read could happen because someone pointed the IDT to MMIO area, and who >> knows what the VM-exit instructio

Re: [PATCH] kvm: x86: disable KVM_FAST_MMIO_BUS

2017-08-16 Thread Michael S. Tsirkin
On Wed, Aug 16, 2017 at 03:30:31PM +0200, Paolo Bonzini wrote: > On 16/08/2017 15:16, Michael S. Tsirkin wrote: > > On Wed, Aug 16, 2017 at 03:05:51PM +0200, Paolo Bonzini wrote: > >> On 16/08/2017 14:58, Michael S. Tsirkin wrote: > >>> On Wed, Aug 16, 2017 at 01:22:49PM +0200, Paolo Bonzini wrote:

Re: [PATCH] kvm: x86: disable KVM_FAST_MMIO_BUS

2017-08-16 Thread Paolo Bonzini
> We actually know what to expect (a write) so we could maybe > optimize this some more with a dedicated function just for this. We don't know the addressing mode, the size or the source (immediate vs. register), so no. KVM is already doing a single translation and read no matter how long the in

Re: [PATCH] kvm: x86: disable KVM_FAST_MMIO_BUS

2017-08-16 Thread Michael S. Tsirkin
On Wed, Aug 16, 2017 at 03:37:47PM +0200, Paolo Bonzini wrote: > On 16/08/2017 14:07, Radim Krčmář wrote: > > 2017-08-16 13:22+0200, Paolo Bonzini: > >> Microsoft pointed out privately to me that KVM's handling of > >> KVM_FAST_MMIO_BUS is invalid. Using skip_emulation_instruction is invalid > >>

Re: [PATCH] kvm: x86: disable KVM_FAST_MMIO_BUS

2017-08-16 Thread Michael S. Tsirkin
On Wed, Aug 16, 2017 at 03:30:31PM +0200, Paolo Bonzini wrote: > On 16/08/2017 15:16, Michael S. Tsirkin wrote: > > On Wed, Aug 16, 2017 at 03:05:51PM +0200, Paolo Bonzini wrote: > >> On 16/08/2017 14:58, Michael S. Tsirkin wrote: > >>> On Wed, Aug 16, 2017 at 01:22:49PM +0200, Paolo Bonzini wrote:

Re: [PATCH] kvm: x86: disable KVM_FAST_MMIO_BUS

2017-08-16 Thread Paolo Bonzini
On 16/08/2017 14:07, Radim Krčmář wrote: > 2017-08-16 13:22+0200, Paolo Bonzini: >> Microsoft pointed out privately to me that KVM's handling of >> KVM_FAST_MMIO_BUS is invalid. Using skip_emulation_instruction is invalid >> in EPT misconfiguration vmexit handlers, because neither EPT violations >

Re: [PATCH] kvm: x86: disable KVM_FAST_MMIO_BUS

2017-08-16 Thread Paolo Bonzini
On 16/08/2017 15:16, Michael S. Tsirkin wrote: > On Wed, Aug 16, 2017 at 03:05:51PM +0200, Paolo Bonzini wrote: >> On 16/08/2017 14:58, Michael S. Tsirkin wrote: >>> On Wed, Aug 16, 2017 at 01:22:49PM +0200, Paolo Bonzini wrote: Microsoft pointed out privately to me that KVM's handling of

Re: [PATCH] kvm: x86: disable KVM_FAST_MMIO_BUS

2017-08-16 Thread Michael S. Tsirkin
On Wed, Aug 16, 2017 at 03:05:51PM +0200, Paolo Bonzini wrote: > On 16/08/2017 14:58, Michael S. Tsirkin wrote: > > On Wed, Aug 16, 2017 at 01:22:49PM +0200, Paolo Bonzini wrote: > >> Microsoft pointed out privately to me that KVM's handling of > >> KVM_FAST_MMIO_BUS is invalid. Using skip_emulati

Re: [PATCH] kvm: x86: disable KVM_FAST_MMIO_BUS

2017-08-16 Thread Paolo Bonzini
On 16/08/2017 14:58, Michael S. Tsirkin wrote: > On Wed, Aug 16, 2017 at 01:22:49PM +0200, Paolo Bonzini wrote: >> Microsoft pointed out privately to me that KVM's handling of >> KVM_FAST_MMIO_BUS is invalid. Using skip_emulation_instruction is invalid >> in EPT misconfiguration vmexit handlers, b

Re: [PATCH] kvm: x86: disable KVM_FAST_MMIO_BUS

2017-08-16 Thread Michael S. Tsirkin
On Wed, Aug 16, 2017 at 01:22:49PM +0200, Paolo Bonzini wrote: > Microsoft pointed out privately to me that KVM's handling of > KVM_FAST_MMIO_BUS is invalid. Using skip_emulation_instruction is invalid > in EPT misconfiguration vmexit handlers, because neither EPT violations > nor misconfiguration

Re: [PATCH] kvm: x86: disable KVM_FAST_MMIO_BUS

2017-08-16 Thread Radim Krčmář
2017-08-16 13:22+0200, Paolo Bonzini: > Microsoft pointed out privately to me that KVM's handling of > KVM_FAST_MMIO_BUS is invalid. Using skip_emulation_instruction is invalid > in EPT misconfiguration vmexit handlers, because neither EPT violations > nor misconfigurations are listed in the manua