[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YiIc7aliqChnWThP@nazgul.tnic>
Date: Fri, 4 Mar 2022 15:06:49 +0100
From: Borislav Petkov <bp@...en8.de>
To: Brijesh Singh <brijesh.singh@....com>
Cc: x86@...nel.org, linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
linux-efi@...r.kernel.org, platform-driver-x86@...r.kernel.org,
linux-coco@...ts.linux.dev, linux-mm@...ck.org,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, Joerg Roedel <jroedel@...e.de>,
Tom Lendacky <thomas.lendacky@....com>,
"H. Peter Anvin" <hpa@...or.com>, Ard Biesheuvel <ardb@...nel.org>,
Paolo Bonzini <pbonzini@...hat.com>,
Sean Christopherson <seanjc@...gle.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
Jim Mattson <jmattson@...gle.com>,
Andy Lutomirski <luto@...nel.org>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Sergio Lopez <slp@...hat.com>, Peter Gonda <pgonda@...gle.com>,
Peter Zijlstra <peterz@...radead.org>,
Srinivas Pandruvada <srinivas.pandruvada@...ux.intel.com>,
David Rientjes <rientjes@...gle.com>,
Dov Murik <dovmurik@...ux.ibm.com>,
Tobin Feldman-Fitzthum <tobin@....com>,
Michael Roth <michael.roth@....com>,
Vlastimil Babka <vbabka@...e.cz>,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
Andi Kleen <ak@...ux.intel.com>,
"Dr . David Alan Gilbert" <dgilbert@...hat.com>,
brijesh.ksingh@...il.com, tony.luck@...el.com, marcorr@...gle.com,
sathyanarayanan.kuppuswamy@...ux.intel.com
Subject: Re: [PATCH v11 44/45] virt: sevguest: Add support to get extended
report
On Thu, Mar 03, 2022 at 10:47:20AM -0600, Brijesh Singh wrote:
> I did not fail on !req.cert_len, because my read of the GHCB spec says that
> additional data (certificate blob) is optional. A user could call
> SNP_GET_EXT_REPORT without asking for the extended certificate. In this
> case, SNP_GET_EXT_REPORT == SNP_GET_REPORT.
>
> Text from the GHCB spec section 4.1.8
> ---------------
> https://developer.amd.com/wp-content/resources/56421.pdf
>
> The SNP Extended Guest Request NAE event is very similar to the SNP Guest
> Request NAE event. The difference is related to the additional data that can
> be returned based on the guest request. Any SNP Guest Request that does not
> support returning additional data must execute as if invoked as an SNP Guest
> Request.
> --------------
Sorry, it is still not clear to me how
"without asking for the extended certificate" == !req.certs_len
That's not explained in the help text either. And ->certs_len is part of
the input structure but nowhere does it say that when that thing is 0,
the request will be downgraded to a SNP_GET_REPORT.
How is the user of this supposed to know?
And regardless, you can still streamline the code as in the example I
gave so that it is clear which values are checked and for which does the
request get failed...
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists