Re: [PATCH] KVM: SVM: Make sure GHCB is mapped before updating

2021-04-08 Thread Tom Lendacky
On 4/8/21 11:14 AM, Paolo Bonzini wrote: > On 08/04/21 18:04, Tom Lendacky wrote: > +   if (!err || !sev_es_guest(vcpu->kvm) || > !WARN_ON_ONCE(svm->ghcb)) This should be WARN_ON_ONCE(!svm->ghcb), otherwise you'll get the right result, but get a stack trace immediately. >>> Do

Re: [PATCH] KVM: SVM: Make sure GHCB is mapped before updating

2021-04-08 Thread Paolo Bonzini
On 08/04/21 18:04, Tom Lendacky wrote: + if (!err || !sev_es_guest(vcpu->kvm) || !WARN_ON_ONCE(svm->ghcb)) This should be WARN_ON_ONCE(!svm->ghcb), otherwise you'll get the right result, but get a stack trace immediately. Doh, yep. Actually, because of the "or's", this needs to be: if (

Re: [PATCH] KVM: SVM: Make sure GHCB is mapped before updating

2021-04-08 Thread Tom Lendacky
On 4/7/21 4:07 PM, Sean Christopherson wrote: > On Wed, Apr 07, 2021, Tom Lendacky wrote: >> On 4/7/21 3:08 PM, Sean Christopherson wrote: >>> On Wed, Apr 07, 2021, Tom Lendacky wrote: From: Tom Lendacky The sev_vcpu_deliver_sipi_vector() routine will update the GHCB to inform >>

Re: [PATCH] KVM: SVM: Make sure GHCB is mapped before updating

2021-04-07 Thread Sean Christopherson
On Wed, Apr 07, 2021, Tom Lendacky wrote: > On 4/7/21 3:08 PM, Sean Christopherson wrote: > > On Wed, Apr 07, 2021, Tom Lendacky wrote: > >> From: Tom Lendacky > >> > >> The sev_vcpu_deliver_sipi_vector() routine will update the GHCB to inform > >> the caller of the AP Reset Hold NAE event that a

Re: [PATCH] KVM: SVM: Make sure GHCB is mapped before updating

2021-04-07 Thread Tom Lendacky
On 4/7/21 3:08 PM, Sean Christopherson wrote: > On Wed, Apr 07, 2021, Tom Lendacky wrote: >> From: Tom Lendacky >> >> The sev_vcpu_deliver_sipi_vector() routine will update the GHCB to inform >> the caller of the AP Reset Hold NAE event that a SIPI has been delivered. >> However, if a SIPI is perf

Re: [PATCH] KVM: SVM: Make sure GHCB is mapped before updating

2021-04-07 Thread Sean Christopherson
On Wed, Apr 07, 2021, Tom Lendacky wrote: > From: Tom Lendacky > > The sev_vcpu_deliver_sipi_vector() routine will update the GHCB to inform > the caller of the AP Reset Hold NAE event that a SIPI has been delivered. > However, if a SIPI is performed without a corresponding AP Reset Hold, > then

[PATCH] KVM: SVM: Make sure GHCB is mapped before updating

2021-04-07 Thread Tom Lendacky
From: Tom Lendacky The sev_vcpu_deliver_sipi_vector() routine will update the GHCB to inform the caller of the AP Reset Hold NAE event that a SIPI has been delivered. However, if a SIPI is performed without a corresponding AP Reset Hold, then the GHCB may not be mapped, which will result in a NUL