linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Michael Roth <michael.roth@amd.com>
To: Borislav Petkov <bp@alien8.de>
Cc: Brijesh Singh <brijesh.singh@amd.com>, <x86@kernel.org>,
	<linux-kernel@vger.kernel.org>, <kvm@vger.kernel.org>,
	<linux-efi@vger.kernel.org>,
	<platform-driver-x86@vger.kernel.org>,
	<linux-coco@lists.linux.dev>, <linux-mm@kvack.org>,
	Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Joerg Roedel <jroedel@suse.de>,
	Tom Lendacky <thomas.lendacky@amd.com>,
	"H. Peter Anvin" <hpa@zytor.com>,
	Ard Biesheuvel <ardb@kernel.org>,
	Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	"Vitaly Kuznetsov" <vkuznets@redhat.com>,
	Jim Mattson <jmattson@google.com>,
	"Andy Lutomirski" <luto@kernel.org>,
	Dave Hansen <dave.hansen@linux.intel.com>,
	Sergio Lopez <slp@redhat.com>, Peter Gonda <pgonda@google.com>,
	"Peter Zijlstra" <peterz@infradead.org>,
	Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>,
	David Rientjes <rientjes@google.com>,
	Dov Murik <dovmurik@linux.ibm.com>,
	Tobin Feldman-Fitzthum <tobin@ibm.com>,
	Vlastimil Babka <vbabka@suse.cz>,
	"Kirill A . Shutemov" <kirill@shutemov.name>,
	Andi Kleen <ak@linux.intel.com>,
	"Dr . David Alan Gilbert" <dgilbert@redhat.com>,
	<brijesh.ksingh@gmail.com>, <tony.luck@intel.com>,
	<marcorr@google.com>,
	<sathyanarayanan.kuppuswamy@linux.intel.com>
Subject: Re: [PATCH v9 37/43] x86/sev: Add SEV-SNP feature detection/setup
Date: Mon, 7 Feb 2022 23:25:42 -0600	[thread overview]
Message-ID: <20220208052542.3g6nskck7uhjnfji@amd.com> (raw)
In-Reply-To: <YgAjq3mSudt+G+6Y@zn.tnic>

On Sun, Feb 06, 2022 at 08:38:19PM +0100, Borislav Petkov wrote:
> On Fri, Jan 28, 2022 at 11:17:58AM -0600, Brijesh Singh wrote:
> > +static __init struct cc_blob_sev_info *snp_find_cc_blob(struct boot_params *bp)
> > +{
> > +	struct cc_blob_sev_info *cc_info;
> > +
> > +	/* Boot kernel would have passed the CC blob via boot_params. */
> > +	if (bp->cc_blob_address) {
> > +		cc_info = (struct cc_blob_sev_info *)(unsigned long)bp->cc_blob_address;
> > +		goto found_cc_info;
> > +	}
> 
> What is the difference here, why aren't you looking for the blob in an
> EFI table?
> 
> Even if you're booted directly by firmware, there should still be EFI
> there or?
> 
> And if so, then I think you should share some of the code through
> sev-shared.c so that there's not so much duplication...

In order to scan EFI this early in the boot of kernel proper, we'd need
to pull in the helpers from arch/x86/boot/compressed/efi.c, since the
normal EFI facilities don't get set up until later. It's doable, but
since any entry via boot/compressed kernel will have already done that
work and stashed it in boot_params->cc_blob_address, it seems like it
would only introduce more complexity and potential for breakage.

For direct entry to kernel proper, our thinking is that it would be for
things like the PVH entry path:

  https://stefano-garzarella.github.io/posts/2019-08-23-qemu-linux-kernel-pvh/

which doesn't use EFI, or other container-focused applications which use
lightweight non-EFI firmwares like qboot. So to support direct entry into
kernel proper, relying on the CC blob setup_data structure instead seems
more suited for these cases, so that's why kernel proper only uses the
setup_data structure and relies on boot/compressed to handle EFI entry.

> 
> -- 
> Regards/Gruss,
>     Boris.
> 
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpeople.kernel.org%2Ftglx%2Fnotes-about-netiquette&amp;data=04%7C01%7Cmichael.roth%40amd.com%7Ccb8e665b2ed14dbd400c08d9e9a841ff%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637797731199858639%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000&amp;sdata=5Pd7PA4BdfnfWzcXpah8HkrtVfu4h6nUIR8b3mB%2BIxM%3D&amp;reserved=0


  parent reply	other threads:[~2022-02-08  5:26 UTC|newest]

Thread overview: 79+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-01-28 17:17 [PATCH v9 00/43] Add AMD Secure Nested Paging (SEV-SNP) Guest Support Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 01/43] KVM: SVM: Define sev_features and vmpl field in the VMSA Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 02/43] KVM: SVM: Create a separate mapping for the SEV-ES save area Brijesh Singh
     [not found]   ` <YfkvchuxmkHgnPWT@zn.tnic>
2022-02-09 15:02     ` Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 03/43] KVM: SVM: Create a separate mapping for the GHCB " Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 04/43] KVM: SVM: Update the SEV-ES save area mapping Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 05/43] x86/compressed/64: Detect/setup SEV/SME features earlier in boot Brijesh Singh
     [not found]   ` <Yfl3FaTGPxE7qMCq@zn.tnic>
2022-02-01 20:35     ` Michael Roth
     [not found]       ` <YfmmBykN2s0HsiAJ@zn.tnic>
2022-02-02  0:52         ` Michael Roth
     [not found]           ` <YfogFFOoHvCV+/2Y@zn.tnic>
2022-02-02 17:28             ` Michael Roth
2022-01-28 17:17 ` [PATCH v9 06/43] x86/sev: " Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 07/43] x86/mm: Extend cc_attr to include AMD SEV-SNP Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 08/43] x86/sev: Define the Linux specific guest termination reasons Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 09/43] x86/sev: Save the negotiated GHCB version Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 10/43] x86/sev: Check SEV-SNP features support Brijesh Singh
     [not found]   ` <YfmRBUtoWNb9BkuL@zn.tnic>
2022-02-02 14:28     ` Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 11/43] x86/sev: Add a helper for the PVALIDATE instruction Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 12/43] x86/sev: Check the vmpl level Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 13/43] x86/compressed: Add helper for validating pages in the decompression stage Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 14/43] x86/compressed: Register GHCB memory when SEV-SNP is active Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 15/43] x86/sev: " Brijesh Singh
     [not found]   ` <YfpeSErxB9KHOd7m@zn.tnic>
2022-02-02 14:29     ` Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 16/43] x86/sev: Add helper for validating pages in early enc attribute changes Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 17/43] x86/kernel: Make the .bss..decrypted section shared in RMP table Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 18/43] x86/kernel: Validate ROM memory before accessing when SEV-SNP is active Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 19/43] x86/mm: Add support to validate memory when changing C-bit Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 20/43] x86/sev: Use SEV-SNP AP creation to start secondary CPUs Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 21/43] x86/head/64: Re-enable stack protection Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 22/43] x86/sev: Move MSR-based VMGEXITs for CPUID to helper Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 23/43] KVM: x86: Move lookup of indexed CPUID leafs " Brijesh Singh
     [not found]   ` <Yfvx0Rq8Tydyr/RO@zn.tnic>
2022-02-03 16:44     ` Michael Roth
2022-01-28 17:17 ` [PATCH v9 24/43] x86/compressed/acpi: Move EFI detection " Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 25/43] x86/compressed/acpi: Move EFI system table lookup " Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 26/43] x86/compressed/acpi: Move EFI config " Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 27/43] x86/compressed/acpi: Move EFI vendor " Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 28/43] x86/compressed/acpi: Move EFI kexec handling into common code Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 29/43] x86/boot: Add Confidential Computing type to setup_data Brijesh Singh
     [not found]   ` <Yf1Sn4AdPgIzpih9@zn.tnic>
2022-02-04 17:41     ` Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 30/43] KVM: SEV: Add documentation for SEV-SNP CPUID Enforcement Brijesh Singh
2022-02-07 23:48   ` Sean Christopherson
2022-02-08 14:54     ` Michael Roth
2022-02-08 15:11     ` Borislav Petkov
2022-01-28 17:17 ` [PATCH v9 31/43] x86/compressed/64: Add support for SEV-SNP CPUID table in #VC handlers Brijesh Singh
     [not found]   ` <Yf5XScto3mDXnl9u@zn.tnic>
2022-02-05 15:42     ` Michael Roth
2022-02-05 16:22     ` Michael Roth
     [not found]       ` <Yf/PN8rBy3m5seU9@zn.tnic>
2022-02-07 15:37         ` Michael Roth
2022-01-28 17:17 ` [PATCH v9 32/43] x86/boot: Add a pointer to Confidential Computing blob in bootparams Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 33/43] x86/compressed: Add SEV-SNP feature detection/setup Brijesh Singh
     [not found]   ` <Yf/6NhnS50UDv4xV@zn.tnic>
2022-02-08 13:50     ` Michael Roth
2022-02-08 15:02       ` Borislav Petkov
2022-01-28 17:17 ` [PATCH v9 34/43] x86/compressed: Use firmware-validated CPUID leaves for SEV-SNP guests Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 35/43] x86/compressed: Export and rename add_identity_map() Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 36/43] x86/compressed/64: Add identity mapping for Confidential Computing blob Brijesh Singh
2022-01-28 17:17 ` [PATCH v9 37/43] x86/sev: Add SEV-SNP feature detection/setup Brijesh Singh
     [not found]   ` <YgAjq3mSudt+G+6Y@zn.tnic>
2022-02-08  5:25     ` Michael Roth [this message]
2022-01-28 17:17 ` [PATCH v9 38/43] x86/sev: Use firmware-validated CPUID for SEV-SNP guests Brijesh Singh
2022-02-05 17:19   ` Michael Roth
     [not found]     ` <Yf/tQPqbP97lrVpg@zn.tnic>
2022-02-07 17:00       ` Michael Roth
2022-01-28 17:18 ` [PATCH v9 39/43] x86/sev: Provide support for SNP guest request NAEs Brijesh Singh
2022-02-01 20:17   ` Peter Gonda
2022-03-03 14:53     ` Brijesh Singh
2022-01-28 17:18 ` [PATCH v9 40/43] x86/sev: Register SEV-SNP guest request platform device Brijesh Singh
2022-02-01 20:21   ` Peter Gonda
2022-02-02 16:27     ` Brijesh Singh
2022-01-28 17:18 ` [PATCH v9 41/43] virt: Add SEV-SNP guest driver Brijesh Singh
2022-02-01 20:33   ` Peter Gonda
2022-02-06 22:39   ` Borislav Petkov
2022-02-07 14:41     ` Brijesh Singh
2022-01-28 17:18 ` [PATCH v9 42/43] virt: sevguest: Add support to derive key Brijesh Singh
2022-02-01 20:39   ` Peter Gonda
2022-02-02 22:31     ` Brijesh Singh
     [not found]   ` <YgDduR0mrptX5arB@zn.tnic>
2022-02-07 16:23     ` Brijesh Singh
2022-02-07 19:09       ` Dov Murik
2022-02-07 20:08         ` Brijesh Singh
2022-02-08  7:56           ` Dov Murik
2022-02-08 10:51             ` Borislav Petkov
2022-02-08 14:14             ` Brijesh Singh
2022-01-28 17:18 ` [PATCH v9 43/43] virt: sevguest: Add support to get extended report Brijesh Singh
2022-02-01 20:43   ` Peter Gonda

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=20220208052542.3g6nskck7uhjnfji@amd.com \
    --to=michael.roth@amd.com \
    --cc=ak@linux.intel.com \
    --cc=ardb@kernel.org \
    --cc=bp@alien8.de \
    --cc=brijesh.ksingh@gmail.com \
    --cc=brijesh.singh@amd.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=dgilbert@redhat.com \
    --cc=dovmurik@linux.ibm.com \
    --cc=hpa@zytor.com \
    --cc=jmattson@google.com \
    --cc=jroedel@suse.de \
    --cc=kirill@shutemov.name \
    --cc=kvm@vger.kernel.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-efi@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=luto@kernel.org \
    --cc=marcorr@google.com \
    --cc=mingo@redhat.com \
    --cc=pbonzini@redhat.com \
    --cc=peterz@infradead.org \
    --cc=pgonda@google.com \
    --cc=platform-driver-x86@vger.kernel.org \
    --cc=rientjes@google.com \
    --cc=sathyanarayanan.kuppuswamy@linux.intel.com \
    --cc=seanjc@google.com \
    --cc=slp@redhat.com \
    --cc=srinivas.pandruvada@linux.intel.com \
    --cc=tglx@linutronix.de \
    --cc=thomas.lendacky@amd.com \
    --cc=tobin@ibm.com \
    --cc=tony.luck@intel.com \
    --cc=vbabka@suse.cz \
    --cc=vkuznets@redhat.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).