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] [day] [month] [year] [list]
Message-ID: <20241018111043.GAZxJCM8DK-wEjDJZR@fat_crate.local>
Date: Fri, 18 Oct 2024 13:10:43 +0200
From: Borislav Petkov <bp@...en8.de>
To: Tom Lendacky <thomas.lendacky@....com>
Cc: linux-kernel@...r.kernel.org, x86@...nel.org,
	Thomas Gleixner <tglx@...utronix.de>,
	Ingo Molnar <mingo@...hat.com>,
	Dave Hansen <dave.hansen@...ux.intel.com>,
	Michael Roth <michael.roth@....com>,
	Ashish Kalra <ashish.kalra@....com>
Subject: Re: [PATCH v2 1/7] x86/sev: Prepare for using the RMPREAD
 instruction to access the RMP

On Thu, Oct 17, 2024 at 01:16:36PM -0500, Tom Lendacky wrote:
> I can look at naming the new struct "rmpread" and see how that looks if you
> prefer.

I think I understand what you mean now and I guess something like the below
would make it more clear. Diff ontop:

diff --git a/arch/x86/virt/svm/sev.c b/arch/x86/virt/svm/sev.c
index 73d4f422829a..73d9295dd013 100644
--- a/arch/x86/virt/svm/sev.c
+++ b/arch/x86/virt/svm/sev.c
@@ -48,7 +48,8 @@ struct rmpentry {
 
 /*
  * The RMP entry format is not architectural. The format is defined in PPR
- * Family 19h Model 01h, Rev B1 processor.
+ * Family 19h Model 01h, Rev B1 processor. This is the raw, verbatim
+ * representation as it is found in the RMP table.
  */
 struct rmpentry_raw {
 	union {
@@ -286,7 +287,7 @@ static int __init snp_rmptable_init(void)
  */
 device_initcall(snp_rmptable_init);
 
-static struct rmpentry_raw *__get_rmpentry(unsigned long pfn)
+static struct rmpentry_raw *get_raw_rmpentry(unsigned long pfn)
 {
 	if (!rmptable)
 		return ERR_PTR(-ENODEV);
@@ -312,7 +313,7 @@ static int get_rmpentry(u64 pfn, struct rmpentry *entry)
 		return ret;
 	}
 
-	e = __get_rmpentry(pfn);
+	e = get_raw_rmpentry(pfn);
 	if (IS_ERR(e))
 		return PTR_ERR(e);
 
@@ -393,7 +394,7 @@ static void dump_rmpentry(u64 pfn)
 	}
 
 	if (e.assigned) {
-		e_raw = __get_rmpentry(pfn);
+		e_raw = get_raw_rmpentry(pfn);
 		if (IS_ERR(e_raw)) {
 			pr_err("Failed to read RMP contents for PFN 0x%llx, error %ld\n",
 			       pfn, PTR_ERR(e_raw));
@@ -420,7 +421,7 @@ static void dump_rmpentry(u64 pfn)
 		pfn, pfn_i, pfn_end);
 
 	while (pfn_i < pfn_end) {
-		e_raw = __get_rmpentry(pfn_i);
+		e_raw = get_raw_rmpentry(pfn_i);
 		if (IS_ERR(e_raw)) {
 			pr_err("Error %ld reading RMP contents for PFN 0x%llx\n",
 			       PTR_ERR(e_raw), pfn_i);


-- 
Regards/Gruss,
    Boris.

https://people.kernel.org/tglx/notes-about-netiquette

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ