From nobody Sat Nov 23 15:40:02 2024 Received: from mail-pf1-f201.google.com (mail-pf1-f201.google.com [209.85.210.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 94D5D21EBAC for ; Tue, 12 Nov 2024 23:23:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.201 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731453810; cv=none; b=XbCqL3taUzQzPfcZ2yJaDyyGYGKLpfGEeZ1MK9RPD1SKubgBu9Lre4L2ue+FHFjRpdIMn/cM5Rt/OPJFMGOOoYDGyZr2seGTbKlv9/fBw6D+gMDAGdNHT2QR1Gov5gjIK60p6eSunm4ts5cXstHTyjj27hq5UzVnCWaFDtJWuDI= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1731453810; c=relaxed/simple; bh=YSlU6X6JKLSeLbKMBuH/mDkE4l3HevChh3sRmgLUBXI=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=u0LI4VxH3EPjOqIWRRPQJ3k91axpwodpbxWbJcVqmUBAKJdWpF2KMHLVrRb1yul33s13x29SkzfstjG0RSoGJyTNU7K5szmDrQhK6ZMf9Q1teA4D9Uo7BTQHARMMH9iulzI8X8+NTs0gVKvwFdo4F+Ot3q3KxH4x9dDuJJ3xa/Y= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--dionnaglaze.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=1O9C3TMG; arc=none smtp.client-ip=209.85.210.201 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--dionnaglaze.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="1O9C3TMG" Received: by mail-pf1-f201.google.com with SMTP id d2e1a72fcca58-71e578061ffso7341124b3a.1 for ; Tue, 12 Nov 2024 15:23:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1731453806; x=1732058606; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=OuDWJG60RHXCqzpUFxAGPdqK8IqvXAJsitjiTXr/4nE=; b=1O9C3TMG+iTQoIKcUXKvgnQLeCkN6Oz7UldGVF3DN5ta0TRKP0ukY4L5HYWj4IImgt kHquRf26fByKDfTVtJn3i+vrsjKdbtz8i4bnmkmJd26+3FnVa14681KtWbsLyRIXkBpw 1padD4NhaVsPFNXRQk7XTLWxtSt4uDCoyTa9f8TrDS9uExPvVvTMZmSMh6Vq8InmJ3oZ E/MEfbbnlFjQLTp221EwPsoS4ZS2npAZN9ybf+jHVq/UaNgdO6Nc+9YaeacDdICEiC8f vAKTUkjIaE5e1GqJ2dQAMaRR6T80wAjjqYXSGtiKQVyFloaF4thBqtwZvFvZ2t0zrFnT bcpA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1731453806; x=1732058606; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=OuDWJG60RHXCqzpUFxAGPdqK8IqvXAJsitjiTXr/4nE=; b=IO3bJnRojvM/61Np8Iup6gCIXWKmIxJ6zr2vL4QXzole6WFWCDVRzg1cwXUTUoPFlw djpRGMfxrScaO2Tz7TfpZC6RMX09MfZ0nPmaDp5vw13E0Rt4PyF5zjiE6eNkNQLTszLL VNfbfhAXhrsKqGw9m+FMYFxoTzQXg3VgKI1tsqkDdXDNvWvK0Tmfzit6/Qk3yiItSjgB RZYZeA85W45lp1SbORsweYdVRI7GAzxbaRoGDhACsM3aKCMIadWk/hnB4F+1QeaqprWv Ae5jacafMWGYvkn6o0ElXl1E5OyhOUOmwPSB0Zjx9Fiqn7CIu6V0qecWdKgfkVYXcNIH LTww== X-Gm-Message-State: AOJu0YzSIr5cVoRLt6S/PMzX6maw+ZkMOBbTwVvZ9NQh+uDQmFbVwB/Z Ww3s6VQr/+6w2bX8+dSfLN8z34ddESSIYN1njVYn7q4VkSaCvjH3b97qSoqBjcl42Fp+ZW4hOK9 wmsPPIcL9Gea6YpkRWg75jyLMqBAFMrUTKNnI9Ey2bVeBu+Fu71NfTHWsB4cGMLnvq2TVD0uDIj /96wjz5oYIK9avWEVfAn+R84P69hgXsIqq189kN71dDTRkQDilG26MvA3J7OkymOelWrY= X-Google-Smtp-Source: AGHT+IE6zPnpQVIS7blTj/Vhu9TTjYHNmJoBXH4WGKbfY0DY+2UePrQxclpNCjF7vH3HqWjU/xgzhv/gANZuiZaWCA== X-Received: from dionnaglaze.c.googlers.com ([fda3:e722:ac3:cc00:36:e7b8:ac13:c9e8]) (user=dionnaglaze job=sendgmr) by 2002:a62:ee0d:0:b0:720:2e1a:de with SMTP id d2e1a72fcca58-7244a4fcc54mr33020b3a.1.1731453804651; Tue, 12 Nov 2024 15:23:24 -0800 (PST) Date: Tue, 12 Nov 2024 23:22:47 +0000 In-Reply-To: <20241112232253.3379178-1-dionnaglaze@google.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20241112232253.3379178-1-dionnaglaze@google.com> X-Mailer: git-send-email 2.47.0.277.g8800431eea-goog Message-ID: <20241112232253.3379178-9-dionnaglaze@google.com> Subject: [PATCH v6 8/8] KVM: SVM: Delay legacy platform initialization on SNP From: Dionna Glaze To: linux-kernel@vger.kernel.org, x86@kernel.org, Sean Christopherson , Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" Cc: linux-coco@lists.linux.dev, Dionna Glaze , Ashish Kalra , Tom Lendacky , John Allen , Herbert Xu , "David S. Miller" , Michael Roth , Luis Chamberlain , Russ Weight , Danilo Krummrich , Greg Kroah-Hartman , "Rafael J. Wysocki" , Tianfei zhang , Alexey Kardashevskiy , kvm@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" When no SEV or SEV-ES guests are active, then the firmware can be updated while (SEV-SNP) VM guests are active. CC: Sean Christopherson CC: Paolo Bonzini CC: Thomas Gleixner CC: Ingo Molnar CC: Borislav Petkov CC: Dave Hansen CC: Ashish Kalra CC: Tom Lendacky CC: John Allen CC: Herbert Xu CC: "David S. Miller" CC: Michael Roth CC: Luis Chamberlain CC: Russ Weight CC: Danilo Krummrich CC: Greg Kroah-Hartman CC: "Rafael J. Wysocki" CC: Tianfei zhang CC: Alexey Kardashevskiy Co-developed-by: Ashish Kalra Signed-off-by: Ashish Kalra Reviewed-by: Ashish Kalra Signed-off-by: Dionna Glaze --- arch/x86/kvm/svm/sev.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/arch/x86/kvm/svm/sev.c b/arch/x86/kvm/svm/sev.c index 5e6d1f1c14dfd..507ed87749f55 100644 --- a/arch/x86/kvm/svm/sev.c +++ b/arch/x86/kvm/svm/sev.c @@ -444,7 +444,11 @@ static int __sev_guest_init(struct kvm *kvm, struct kv= m_sev_cmd *argp, if (ret) goto e_no_asid; =20 - init_args.probe =3D false; + /* + * Setting probe will skip SEV/SEV-ES platform initialization for an SEV-= SNP guest in order + * for SNP firmware hotloading to be available when only SEV-SNP VMs are = running. + */ + init_args.probe =3D vm_type !=3D KVM_X86_SEV_VM && vm_type !=3D KVM_X86_S= EV_ES_VM; ret =3D sev_platform_init(&init_args); if (ret) goto e_free; --=20 2.47.0.277.g8800431eea-goog