linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ashish Kalra <ashish.kalra@amd.com>
To: Paolo Bonzini <pbonzini@redhat.com>
Cc: cavery@redhat.com, kvm@vger.kernel.org,
	linux-kernel@vger.kernel.org, mlevitsk@redhat.com,
	vkuznets@redhat.com, wei.huang2@amd.com, thomas.lendacky@amd.com,
	brijesh.singh@amd.com, jon.grimm@amd.com
Subject: Re: [PATCH v2 1/2] KVM: SVM: Move asid to vcpu_svm
Date: Mon, 30 Nov 2020 21:06:15 +0000	[thread overview]
Message-ID: <20201130210615.GA1459@ashkalra_ubuntu_server> (raw)
In-Reply-To: <f27e877e-b82b-ec9e-270e-cf8f23130b0b@redhat.com>

Hello Paolo,

I believe one of my teammates is currently working on adding a KVM
selftest for SEV and SEV-ES.

Thanks,
Ashish

On Mon, Nov 30, 2020 at 03:41:41PM +0100, Paolo Bonzini wrote:
> On 29/11/20 10:41, Ashish Kalra wrote:
> > From: Ashish Kalra <ashish.kalra@amd.com>
> > 
> > This patch breaks SEV guests.
> > 
> > The patch stores current ASID in struct vcpu_svm and only moves it to VMCB in
> > svm_vcpu_run(), but by doing so, the ASID allocated for SEV guests and setup
> > in vmcb->control.asid by pre_sev_run() gets over-written by this ASID
> > stored in struct vcpu_svm and hence, VMRUN fails as SEV guest is bound/activated
> > on a different ASID then the one overwritten in vmcb->control.asid at VMRUN.
> > 
> > For example, asid#1 was activated for SEV guest and then vmcb->control.asid is
> > overwritten with asid#0 (svm->asid) as part of this patch in svm_vcpu_run() and
> > hence VMRUN fails.
> > 
> 
> Thanks Ashish, I've sent a patch to fix it.
> 
> Would it be possible to add a minimal SEV test to
> tools/testing/selftests/kvm?  It doesn't have to do full attestation etc.,
> if you can just write an "out" instruction using SEV_DBG_ENCRYPT and check
> that you can run it that's enough.
> 
> Paolo
> 

  reply	other threads:[~2020-11-30 21:07 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-11 18:48 [PATCH v2 0/2] KVM: SVM: Create separate vmcbs for L1 and L2 Cathy Avery
2020-10-11 18:48 ` [PATCH v2 1/2] KVM: SVM: Move asid to vcpu_svm Cathy Avery
2020-10-13  1:29   ` Sean Christopherson
2020-11-13 17:03     ` Paolo Bonzini
2020-11-13 16:57   ` Paolo Bonzini
2020-11-29  9:41     ` Ashish Kalra
2020-11-30 14:41       ` Paolo Bonzini
2020-11-30 21:06         ` Ashish Kalra [this message]
2020-10-11 18:48 ` [PATCH v2 2/2] KVM: SVM: Use a separate vmcb for the nested L2 guest Cathy Avery
2020-10-13  1:33   ` Sean Christopherson
2020-11-13 17:36     ` Paolo Bonzini
2020-11-13 17:58   ` Paolo Bonzini
2020-11-13 20:38     ` Paolo Bonzini
2020-11-17 11:03 ` [PATCH v2 0/2] KVM: SVM: Create separate vmcbs for L1 and L2 Paolo Bonzini

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20201130210615.GA1459@ashkalra_ubuntu_server \
    --to=ashish.kalra@amd.com \
    --cc=brijesh.singh@amd.com \
    --cc=cavery@redhat.com \
    --cc=jon.grimm@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mlevitsk@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=thomas.lendacky@amd.com \
    --cc=vkuznets@redhat.com \
    --cc=wei.huang2@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).