Re: [PATCH] KVM: SVM: Add a dedicated INVD intercept routine

2020-09-24 Thread Paolo Bonzini
On 24/09/20 15:58, Vitaly Kuznetsov wrote: > does it sill make sense to intercept INVD when we just skip it? Would it > rather make sense to disable INVD intercept for SEV guests completely? If we don't intercept the processor would really invalidate the cache, that is certainly not what we want.

Re: [PATCH] KVM: SVM: Add a dedicated INVD intercept routine

2020-09-24 Thread Vitaly Kuznetsov
Tom Lendacky writes: > From: Tom Lendacky > > The INVD instruction intercept performs emulation. Emulation can't be done > on an SEV guest because the guest memory is encrypted. > > Provide a dedicated intercept routine for the INVD intercept. Within this > intercept routine just skip the instru

Re: [PATCH] KVM: SVM: Add a dedicated INVD intercept routine

2020-09-24 Thread Tom Lendacky
On 9/24/20 1:51 AM, Paolo Bonzini wrote: On 23/09/20 22:40, Tom Lendacky wrote: +static int invd_interception(struct vcpu_svm *svm) +{ + /* +* Can't do emulation on an SEV guest and INVD is emulated +* as a NOP, so just skip the instruction. +*/ + return (sev_

Re: [PATCH] KVM: SVM: Add a dedicated INVD intercept routine

2020-09-23 Thread Paolo Bonzini
On 23/09/20 22:40, Tom Lendacky wrote: >>> +static int invd_interception(struct vcpu_svm *svm) >>> +{ >>> + /* >>> +* Can't do emulation on an SEV guest and INVD is emulated >>> +* as a NOP, so just skip the instruction. >>> +*/ >>> + return (sev_guest(svm->vcpu.kvm)) >>> +

Re: [PATCH] KVM: SVM: Add a dedicated INVD intercept routine

2020-09-23 Thread Tom Lendacky
On 9/23/20 3:32 PM, Sean Christopherson wrote: > On Wed, Sep 23, 2020 at 03:27:39PM -0500, Tom Lendacky wrote: >> From: Tom Lendacky >> >> The INVD instruction intercept performs emulation. Emulation can't be done >> on an SEV guest because the guest memory is encrypted. >> >> Provide a dedicated

Re: [PATCH] KVM: SVM: Add a dedicated INVD intercept routine

2020-09-23 Thread Sean Christopherson
On Wed, Sep 23, 2020 at 03:27:39PM -0500, Tom Lendacky wrote: > From: Tom Lendacky > > The INVD instruction intercept performs emulation. Emulation can't be done > on an SEV guest because the guest memory is encrypted. > > Provide a dedicated intercept routine for the INVD intercept. Within this

[PATCH] KVM: SVM: Add a dedicated INVD intercept routine

2020-09-23 Thread Tom Lendacky
From: Tom Lendacky The INVD instruction intercept performs emulation. Emulation can't be done on an SEV guest because the guest memory is encrypted. Provide a dedicated intercept routine for the INVD intercept. Within this intercept routine just skip the instruction for an SEV guest, since it is