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

2021-04-01 Thread Vitaly Kuznetsov
Paolo Bonzini writes: > On 01/04/21 15:03, Vitaly Kuznetsov wrote: >>> + svm->sysenter_eip_hi = guest_cpuid_is_intel(vcpu) ? (data >> >>> 32) : 0; >> >> (Personal taste) I'd suggest we keep the whole 'sysenter_eip'/'sysenter_esp' >> even if we only use the upper 32 bits of it. That

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

2021-04-01 Thread Vitaly Kuznetsov
Maxim Levitsky writes: > 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

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

2021-04-01 Thread Paolo Bonzini
On 01/04/21 17:31, Vitaly Kuznetsov wrote: + svm->sysenter_eip_hi = guest_cpuid_is_intel(vcpu) ? (data >> 32) : 0; (Personal taste) I'd suggest we keep the whole 'sysenter_eip'/'sysenter_esp' even if we only use the upper 32 bits of it. That would reduce the code churn a little

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

2021-04-01 Thread Paolo Bonzini
On 01/04/21 15:03, Vitaly Kuznetsov wrote: + svm->sysenter_eip_hi = guest_cpuid_is_intel(vcpu) ? (data >> 32) : 0; (Personal taste) I'd suggest we keep the whole 'sysenter_eip'/'sysenter_esp' even if we only use the upper 32 bits of it. That would reduce the code churn a little

[PATCH v2 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 v2 2/2] KVM: nSVM: improve SYSENTER emulation on AMD

2021-04-01 Thread Maxim Levitsky
On Thu, 2021-04-01 at 15:03 +0200, Vitaly Kuznetsov wrote: > Maxim Levitsky writes: > > > 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