Re: [PATCH Part1 RFC v2 07/20] x86/sev: Define error codes for reason set 1.
From: Borislav Petkov <bp@alien8.de>
Date: 2021-05-18 11:05:29
Also in:
lkml
On Fri, Apr 30, 2021 at 07:16:03AM -0500, Brijesh Singh wrote:
Subject: Re: [PATCH Part1 RFC v2 07/20] x86/sev: Define error codes for reason set 1.
That patch title needs to be more generic, perhaps "...: Define the Linux-specific guest termination reasons"
quoted hunk ↗ jump to hunk
diff --git a/arch/x86/include/asm/sev-common.h b/arch/x86/include/asm/sev-common.h index 07b8612bf182..733fca403ae5 100644 --- a/arch/x86/include/asm/sev-common.h +++ b/arch/x86/include/asm/sev-common.h@@ -128,4 +128,9 @@ struct __packed snp_page_state_change { #define GHCB_RESP_CODE(v) ((v) & GHCB_MSR_INFO_MASK) +/* Linux specific reason codes (used with reason set 1) */ +#define GHCB_TERM_REGISTER 0 /* GHCB GPA registration failure */ +#define GHCB_TERM_PSC 1 /* Page State Change faiilure */
"failure"
quoted hunk ↗ jump to hunk
+#define GHCB_TERM_PVALIDATE 2 /* Pvalidate failure */ + #endifdiff --git a/arch/x86/kernel/sev-shared.c b/arch/x86/kernel/sev-shared.c index 874f911837db..3f9b06a04395 100644 --- a/arch/x86/kernel/sev-shared.c +++ b/arch/x86/kernel/sev-shared.c@@ -32,7 +32,7 @@ static bool __init sev_es_check_cpu_features(void) return true; } -static void __noreturn sev_es_terminate(unsigned int reason) ++static void __noreturn sev_es_terminate(unsigned int set, unsigned int reason)
^
Do you see the '+' above?
In file included from arch/x86/kernel/sev.c:462:
arch/x86/kernel/sev-shared.c:37:1: error: expected identifier or ‘(’ before ‘+’ token
37 | +static void __noreturn sev_es_terminate(unsigned int set, unsigned int reason)
| ^
arch/x86/kernel/sev-shared.c: In function ‘do_vc_no_ghcb’:
arch/x86/kernel/sev-shared.c:245:2: error: implicit declaration of function ‘sev_es_terminate’; did you mean ‘seq_buf_terminate’? [-Werror=implicit-function-declaration]
245 | sev_es_terminate(0, GHCB_SEV_ES_REASON_GENERAL_REQUEST);
| ^~~~~~~~~~~~~~~~
| seq_buf_terminate
cc1: some warnings being treated as errors
make[2]: *** [scripts/Makefile.build:272: arch/x86/kernel/sev.o] Error 1
make[2]: *** Waiting for unfinished jobs....
make[1]: *** [scripts/Makefile.build:515: arch/x86/kernel] Error 2
make: *** [Makefile:1839: arch/x86] Error 2
make: *** Waiting for unfinished jobs....
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette