[PATCH 2/2] KVM: nSVM: improve SYSENTER emulation on AMD

2021-04-01 Thread Maxim Levitsky
Currently to support Intel->AMD migration, if CPU vendor is GenuineIntel, we emulate the full 64 value for MSR_IA32_SYSENTER_{EIP|ESP} msrs, and we also emulate the sysenter/sysexit instruction in long mode. (Emulator does still refuse to emulate sysenter in 64 bit mode, on the ground that the

Re: [PATCH 2/2] KVM: nSVM: improve SYSENTER emulation on AMD

2021-03-16 Thread Maxim Levitsky
On Tue, 2021-03-16 at 09:16 +0100, Paolo Bonzini wrote: > On 15/03/21 19:19, Maxim Levitsky wrote: > > On Mon, 2021-03-15 at 18:56 +0100, Paolo Bonzini wrote: > > > On 15/03/21 18:43, Maxim Levitsky wrote: > > > > + if (!guest_cpuid_is_intel(vcpu)) { > > > > + /* > > > > +

Re: [PATCH 2/2] KVM: nSVM: improve SYSENTER emulation on AMD

2021-03-16 Thread Paolo Bonzini
On 15/03/21 19:19, Maxim Levitsky wrote: On Mon, 2021-03-15 at 18:56 +0100, Paolo Bonzini wrote: On 15/03/21 18:43, Maxim Levitsky wrote: + if (!guest_cpuid_is_intel(vcpu)) { + /* +* If hardware supports Virtual VMLOAD VMSAVE then enable it +

Re: [PATCH 2/2] KVM: nSVM: improve SYSENTER emulation on AMD

2021-03-15 Thread Maxim Levitsky
On Mon, 2021-03-15 at 18:56 +0100, Paolo Bonzini wrote: > On 15/03/21 18:43, Maxim Levitsky wrote: > > + if (!guest_cpuid_is_intel(vcpu)) { > > + /* > > +* If hardware supports Virtual VMLOAD VMSAVE then enable it > > +* in VMCB and clear intercepts to avoid

Re: [PATCH 2/2] KVM: nSVM: improve SYSENTER emulation on AMD

2021-03-15 Thread Paolo Bonzini
On 15/03/21 18:43, Maxim Levitsky wrote: + if (!guest_cpuid_is_intel(vcpu)) { + /* +* If hardware supports Virtual VMLOAD VMSAVE then enable it +* in VMCB and clear intercepts to avoid #VMEXIT. +*/ + if (vls) { +

[PATCH 2/2] KVM: nSVM: improve SYSENTER emulation on AMD

2021-03-15 Thread Maxim Levitsky
Currently to support Intel->AMD migration, if CPU vendor is GenuineIntel, we emulate full 64 value for MSR_IA32_SYSENTER_EIP/MSR_IA32_SYSENTER_ESP msrs, and we also emulate sysenter/sysexit instruction in long mode. (Emulator does still refuse to emulate sysenter in 64 bit mode, on the ground