lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 11 Mar 2024 17:17:21 +0100
From: Vasant Karasulli <vsntk18@...il.com>
To: x86@...nel.org
Cc: joro@...tes.org,
	cfir@...gle.com,
	dan.j.williams@...el.com,
	dave.hansen@...ux.intel.com,
	ebiederm@...ssion.com,
	erdemaktas@...gle.com,
	hpa@...or.com,
	jgross@...e.com,
	jslaby@...e.cz,
	keescook@...omium.org,
	kexec@...ts.infradead.org,
	kvm@...r.kernel.org,
	linux-coco@...ts.linux.dev,
	linux-kernel@...r.kernel.org,
	luto@...nel.org,
	martin.b.radev@...il.com,
	mhiramat@...nel.org,
	mstunes@...are.com,
	nivedita@...m.mit.edu,
	peterz@...radead.org,
	rientjes@...gle.com,
	seanjc@...gle.com,
	stable@...r.kernel.org,
	thomas.lendacky@....com,
	virtualization@...ts.linux-foundation.org,
	Joerg Roedel <jroedel@...e.de>,
	Vasant Karasulli <vkarasulli@...e.de>
Subject: [PATCH v4 3/9] x86/sev: Set GHCB data structure version

From: Joerg Roedel <jroedel@...e.de>

It turned out that the GHCB->protocol field does not declare the
version of the guest-hypervisor communication protocol, but rather the
version of the GHCB data structure. Reflect that in the define used to
set the protocol field.

Signed-off-by: Joerg Roedel <jroedel@...e.de>
Signed-off-by: Vasant Karasulli <vkarasulli@...e.de>
---
 arch/x86/include/asm/sev.h   | 3 +++
 arch/x86/kernel/sev-shared.c | 2 +-
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/arch/x86/include/asm/sev.h b/arch/x86/include/asm/sev.h
index 5b4a1ce3d368..c48db0bfb707 100644
--- a/arch/x86/include/asm/sev.h
+++ b/arch/x86/include/asm/sev.h
@@ -20,6 +20,9 @@
 #define GHCB_PROTOCOL_MAX	2ULL
 #define GHCB_DEFAULT_USAGE	0ULL

+/* Version of the GHCB data structure */
+#define GHCB_VERSION		1
+
 #define	VMGEXIT()			{ asm volatile("rep; vmmcall\n\r"); }

 enum es_result {
diff --git a/arch/x86/kernel/sev-shared.c b/arch/x86/kernel/sev-shared.c
index c02a087c7945..6adae48c501f 100644
--- a/arch/x86/kernel/sev-shared.c
+++ b/arch/x86/kernel/sev-shared.c
@@ -257,7 +257,7 @@ static enum es_result sev_es_ghcb_hv_call(struct ghcb *ghcb,
 					  u64 exit_info_2)
 {
 	/* Fill in protocol and format specifiers */
-	ghcb->protocol_version = ghcb_version;
+	ghcb->protocol_version = GHCB_VERSION;
 	ghcb->ghcb_usage       = GHCB_DEFAULT_USAGE;

 	ghcb_set_sw_exit_code(ghcb, exit_code);
--
2.34.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ