Re: [PATCH v2 2/2] kvm/vmx: Using hardware cpuid faulting to avoid emulation overhead

2019-03-20 Thread Xiaoyao Li
On Tue, 2019-03-19 at 17:09 -0700, Sean Christopherson wrote: > On Wed, Mar 20, 2019 at 01:51:28AM +0800, Xiaoyao Li wrote: > > On Tue, 2019-03-19 at 07:28 -0700, Sean Christopherson wrote: > > > On Tue, Mar 19, 2019 at 12:37:23PM +0800, Xiaoyao Li wrote: > > > > On Mon, 2019-03-18 at 09:38 -0700,

Re: [PATCH v2 2/2] kvm/vmx: Using hardware cpuid faulting to avoid emulation overhead

2019-03-19 Thread Sean Christopherson
On Wed, Mar 20, 2019 at 01:51:28AM +0800, Xiaoyao Li wrote: > On Tue, 2019-03-19 at 07:28 -0700, Sean Christopherson wrote: > > On Tue, Mar 19, 2019 at 12:37:23PM +0800, Xiaoyao Li wrote: > > > On Mon, 2019-03-18 at 09:38 -0700, Sean Christopherson wrote: > > > > On Mon, Mar 18, 2019 at 07:43:24PM

Re: [PATCH v2 2/2] kvm/vmx: Using hardware cpuid faulting to avoid emulation overhead

2019-03-19 Thread Xiaoyao Li
On Tue, 2019-03-19 at 07:28 -0700, Sean Christopherson wrote: > On Tue, Mar 19, 2019 at 12:37:23PM +0800, Xiaoyao Li wrote: > > On Mon, 2019-03-18 at 09:38 -0700, Sean Christopherson wrote: > > > On Mon, Mar 18, 2019 at 07:43:24PM +0800, Xiaoyao Li wrote: > > > > Current cpuid faulting of guest is

Re: [PATCH v2 2/2] kvm/vmx: Using hardware cpuid faulting to avoid emulation overhead

2019-03-19 Thread Sean Christopherson
On Tue, Mar 19, 2019 at 12:37:23PM +0800, Xiaoyao Li wrote: > On Mon, 2019-03-18 at 09:38 -0700, Sean Christopherson wrote: > > On Mon, Mar 18, 2019 at 07:43:24PM +0800, Xiaoyao Li wrote: > > > Current cpuid faulting of guest is purely emulated in kvm, which exploits > > > CPUID vm exit to inject

Re: [PATCH v2 2/2] kvm/vmx: Using hardware cpuid faulting to avoid emulation overhead

2019-03-18 Thread Xiaoyao Li
On Mon, 2019-03-18 at 09:38 -0700, Sean Christopherson wrote: > On Mon, Mar 18, 2019 at 07:43:24PM +0800, Xiaoyao Li wrote: > > Current cpuid faulting of guest is purely emulated in kvm, which exploits > > CPUID vm exit to inject #GP to guest. However, if host hardware cpu has > >

Re: [PATCH v2 2/2] kvm/vmx: Using hardware cpuid faulting to avoid emulation overhead

2019-03-18 Thread Sean Christopherson
On Mon, Mar 18, 2019 at 07:43:24PM +0800, Xiaoyao Li wrote: > Current cpuid faulting of guest is purely emulated in kvm, which exploits > CPUID vm exit to inject #GP to guest. However, if host hardware cpu has > X86_FEATURE_CPUID_FAULT, we can just use the hardware cpuid faulting for > guest to

[PATCH v2 2/2] kvm/vmx: Using hardware cpuid faulting to avoid emulation overhead

2019-03-18 Thread Xiaoyao Li
Current cpuid faulting of guest is purely emulated in kvm, which exploits CPUID vm exit to inject #GP to guest. However, if host hardware cpu has X86_FEATURE_CPUID_FAULT, we can just use the hardware cpuid faulting for guest to avoid the vm exit overhead. Note: cpuid faulting takes higher