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]
Message-ID: <dde53484-2ff8-85bd-4b0a-c69d0035d792@amd.com>
Date: Fri, 18 Oct 2024 08:32:14 -0500
From: Tom Lendacky <thomas.lendacky@....com>
To: Neeraj Upadhyay <Neeraj.Upadhyay@....com>, linux-kernel@...r.kernel.org,
 x86@...nel.org
Cc: Thomas Gleixner <tglx@...utronix.de>, Ingo Molnar <mingo@...hat.com>,
 Borislav Petkov <bp@...en8.de>, Dave Hansen <dave.hansen@...ux.intel.com>,
 Michael Roth <michael.roth@....com>, Ashish Kalra <ashish.kalra@....com>
Subject: Re: [PATCH v3 5/8] x86/sev: Map only the RMP table entries instead of
 the full RMP range

On 10/17/24 23:38, Neeraj Upadhyay wrote:
> 
> 
> 
>>  /*
>>   * Do the necessary preparations which are verified by the firmware as
>>   * described in the SNP_INIT_EX firmware command description in the SNP
>> @@ -205,12 +222,17 @@ static int __init snp_rmptable_init(void)
>>  		goto nosnp;
>>  	}
>>  
>> -	rmptable_start = memremap(probed_rmp_base, probed_rmp_size, MEMREMAP_WB);
>> +	/* Map only the RMP entries */
>> +	rmptable_start = memremap(probed_rmp_base + RMPTABLE_CPU_BOOKKEEPING_SZ,
>> +				  probed_rmp_size - RMPTABLE_CPU_BOOKKEEPING_SZ,
>> +				  MEMREMAP_WB);
>>  	if (!rmptable_start) {
>>  		pr_err("Failed to map RMP table\n");
>>  		goto nosnp;
>>  	}
>>  
>> +	rmptable_size = probed_rmp_size - RMPTABLE_CPU_BOOKKEEPING_SZ;
>> +
> 
> Nit: Move this assignment above 'rmptable_start = memremap(...)', so that
> rmptable_size  can be used there.

I like the symmetry of the base and size adjustment in the memremap(). To
me it looks very obvious as to what is occurring.

Thanks,
Tom

> 
> 
> - Neeraj
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ