Re: [PATCH v6 07/42] x86/sev: Add support for hypervisor feature VMGEXIT

Borislav Petkov
2021-10-13T14:02:49Z

On Fri, Oct 08, 2021 at 01:04:18PM -0500, Brijesh Singh wrote:
> Version 2 of GHCB specification introduced advertisement of a features
> that are supported by the hypervisor. Add support to query the HV
> features on boot.
>
> Version 2 of GHCB specification adds several new NAEs, most of them are
> optional except the hypervisor feature. Now that hypervisor feature NAE
> is implemented, so bump the GHCB maximum support protocol version.
>
> Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
> ---
> arch/x86/include/asm/sev-common.h | 3 +++
> arch/x86/include/asm/sev.h | 2 +-
> arch/x86/include/uapi/asm/svm.h | 2 ++
> arch/x86/kernel/sev-shared.c | 30 ++++++++++++++++++++++++++++++
> 4 files changed, 36 insertions(+), 1 deletion(-)

For the next version, when you add those variables, do this too pls:

diff --git a/arch/x86/kernel/sev-shared.c b/arch/x86/kernel/sev-shared.c
index 8ee27d07c1cd..7a2176e0d0ad 100644
--- a/arch/x86/kernel/sev-shared.c
+++ b/arch/x86/kernel/sev-shared.c
@@ -21,10 +21,10 @@
*
* GHCB protocol version negotiated with the hypervisor.
*/
-static u16 __ro_after_init ghcb_version;
+static u16 ghcb_version __ro_after_init;

/* Bitmap of SEV features supported by the hypervisor */
-static u64 __ro_after_init sev_hv_features;
+static u64 sev_hv_features __ro_after_init;

static bool __init sev_es_check_cpu_features(void)
{

I didn't realize this earlier but we put that annotation at the end.

Thx.

--
Regards/Gruss,
Boris.