kvm.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sean Christopherson <seanjc@google.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: Ashish Kalra <ashish.kalra@amd.com>,
	Dionna Amalie Glaze <dionnaglaze@google.com>,
	pbonzini@redhat.com,  tglx@linutronix.de, mingo@redhat.com,
	bp@alien8.de,  dave.hansen@linux.intel.com, x86@kernel.org,
	hpa@zytor.com,  thomas.lendacky@amd.com, john.allen@amd.com,
	herbert@gondor.apana.org.au,  davem@davemloft.net,
	michael.roth@amd.com, kvm@vger.kernel.org,
	 linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org,
	 linux-coco@lists.linux.dev
Subject: Re: [PATCH v2 0/9] Move initializing SEV/SNP functionality to KVM
Date: Fri, 20 Dec 2024 08:25:10 -0800	[thread overview]
Message-ID: <Z2WaZvUPYNcP14Yp@google.com> (raw)
In-Reply-To: <Z2UvlXeG6Iqd9eFQ@redhat.com>

On Fri, Dec 20, 2024, Daniel P. Berrangé wrote:
> On Thu, Dec 19, 2024 at 04:04:45PM -0600, Kalra, Ashish wrote:
> > On 12/18/2024 7:11 PM, Kalra, Ashish wrote:
> > > But, i believe there is another alternative approach : 
> > > 
> > > - PSP driver can call SEV Shutdown right before calling DLFW_EX and then do
> > > a SEV INIT after successful DLFW_EX, in other words, we wrap DLFW_EX with 
> > > SEV_SHUTDOWN prior to it and SEV INIT post it. This approach will also allow
> > > us to do both SNP and SEV INIT at KVM module load time, there is no need to
> > > do SEV INIT lazily or on demand before SEV/SEV-ES VM launch.
> > > 
> > > This approach should work without any changes in qemu and also allow 
> > > SEV firmware hotloading without having any concerns about SEV INIT state.
> > > 
> > 
> > And to add here that SEV Shutdown will succeed with active SEV and SNP guests. 
> > 
> > SEV Shutdown (internally) marks all SEV asids as invalid and decommission all
> > SEV guests and does not affect SNP guests. 
> > 
> > So any active SEV guests will be implicitly shutdown and SNP guests will not be 
> > affected after SEV Shutdown right before doing SEV firmware hotloading and
> > calling DLFW_EX command. 
> > 
> > It should be fine to expect that there are no active SEV guests or any active
> > SEV guests will be shutdown as part of SEV firmware hotloading while keeping 
> > SNP guests running.
> 
> That's a pretty subtle distinction that I don't think host admins will
> be likely to either learn about or remember. IMHO if there are active
> SEV guests, the kernel should refuse the run the operation, rather
> than kill running guests. The host admin must decide whether it is
> appropriate to shutdown the guests in order to be able to run the
> upgrade.

+1 to this and what Dionna said.  Aside from being a horrible experience for
userspace, trying to forcefully stop actions from within the kernel gets ugly.

  reply	other threads:[~2024-12-20 16:25 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-12-16 23:56 [PATCH v2 0/9] Move initializing SEV/SNP functionality to KVM Ashish Kalra
2024-12-16 23:57 ` [PATCH v2 1/9] crypto: ccp: Move dev_info/err messages for SEV/SNP initialization Ashish Kalra
2024-12-27  8:58   ` Alexey Kardashevskiy
2024-12-16 23:57 ` [PATCH v2 2/9] crypto: ccp: Fix implicit SEV/SNP init and shutdown in ioctls Ashish Kalra
2024-12-27  8:59   ` Alexey Kardashevskiy
2024-12-16 23:58 ` [PATCH v2 3/9] crypto: ccp: Reset TMR size at SNP Shutdown Ashish Kalra
2024-12-27  9:07   ` Alexey Kardashevskiy
2025-01-03 17:00     ` Tom Lendacky
2025-01-07  2:59       ` Alexey Kardashevskiy
2024-12-16 23:58 ` [PATCH v2 4/9] crypto: ccp: Register SNP panic notifier only if SNP is enabled Ashish Kalra
2024-12-17 22:51   ` Dionna Amalie Glaze
2024-12-27  9:13   ` Alexey Kardashevskiy
2024-12-16 23:58 ` [PATCH v2 5/9] crypto: ccp: Add new SEV platform shutdown API Ashish Kalra
2024-12-16 23:59 ` [PATCH v2 6/9] crypto: ccp: Add new SEV/SNP " Ashish Kalra
2024-12-16 23:59 ` [PATCH v2 7/9] crypto: ccp: Add new SEV/SNP platform initialization API Ashish Kalra
2024-12-27 10:25   ` Alexey Kardashevskiy
2024-12-16 23:59 ` [PATCH v2 8/9] KVM: SVM: Add support to initialize SEV/SNP functionality in KVM Ashish Kalra
2024-12-27 10:36   ` Alexey Kardashevskiy
2024-12-17  0:00 ` [PATCH v2 9/9] crypto: ccp: Move SEV/SNP Platform initialization to KVM Ashish Kalra
2024-12-27 10:29   ` Alexey Kardashevskiy
2024-12-17 16:00 ` [PATCH v2 0/9] Move initializing SEV/SNP functionality " Dionna Amalie Glaze
2024-12-17 21:16   ` Kalra, Ashish
2024-12-17 21:37     ` Sean Christopherson
2024-12-17 23:16       ` Kalra, Ashish
2024-12-18 18:11         ` Daniel P. Berrangé
2024-12-18 19:10         ` Sean Christopherson
2024-12-19  1:11           ` Kalra, Ashish
2024-12-19 22:04             ` Kalra, Ashish
2024-12-19 23:12               ` Dionna Amalie Glaze
2024-12-20  8:49               ` Daniel P. Berrangé
2024-12-20 16:25                 ` Sean Christopherson [this message]
2024-12-20 19:52                   ` Kalra, Ashish

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=Z2WaZvUPYNcP14Yp@google.com \
    --to=seanjc@google.com \
    --cc=ashish.kalra@amd.com \
    --cc=berrange@redhat.com \
    --cc=bp@alien8.de \
    --cc=dave.hansen@linux.intel.com \
    --cc=davem@davemloft.net \
    --cc=dionnaglaze@google.com \
    --cc=herbert@gondor.apana.org.au \
    --cc=hpa@zytor.com \
    --cc=john.allen@amd.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-crypto@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=michael.roth@amd.com \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=x86@kernel.org \
    /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).