linux/arch/x86/coco/sev
Nikunj A Dadhania 9d8460a1c7 x86/sev: Remove redundant ghcbs_initialized checks around __sev_{get,put}_ghcb()
After

  3645eb7e39 ("x86/fred: Fix early boot failures on SEV-ES/SNP guests"),

__sev_{get,put}_ghcb() handle the early-boot GHCB fallback internally, making
the ghcbs_initialized guards in __set_pages_state() and
svsm_perform_call_protocol() redundant.

Remove them.

Also initialize state->ghcb to NULL in the early-boot path of
__sev_get_ghcb() so that the ghcb_state is well-defined for all callers,
even though __sev_put_ghcb() currently returns early before reading it.

No functional change intended.

Suggested-by: Tom Lendacky <thomas.lendacky@amd.com>
Signed-off-by: Nikunj A Dadhania <nikunj@amd.com>
Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de>
Reviewed-by: Tom Lendacky <thomas.lendacky@amd.com>
Link: https://patch.msgid.link/20260518102230.3394603-1-nikunj@amd.com
History 2026-05-19 13:31:29 -07:00
..
core.c x86/sev: Remove redundant ghcbs_initialized checks around __sev_{get,put}_ghcb() 2026-05-19 13:31:29 -07:00
internal.h x86/entry: Zap the #VC entry user and kernel macros 2026-05-04 11:18:41 +02:00
Makefile - Make the SEV internal header really internal and carve out the SVSM-specific 2026-02-10 19:19:06 -08:00
noinstr.c x86/sev: Remove redundant ghcbs_initialized checks around __sev_{get,put}_ghcb() 2026-05-19 13:31:29 -07:00
svsm.c x86/sev: Remove redundant ghcbs_initialized checks around __sev_{get,put}_ghcb() 2026-05-19 13:31:29 -07:00
vc-handle.c x86/entry: Zap the #VC entry user and kernel macros 2026-05-04 11:18:41 +02:00
vc-shared.c x86/coco/sev: Convert has_cpuflag() to use cpu_feature_enabled() 2025-11-11 16:42:31 +01:00