lkml.org 
[lkml]   [2024]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v8 05/16] x86/sev: Cache the secrets page address
From
On 4/17/2024 10:57 AM, Nikunj A. Dadhania wrote:
> On 4/16/2024 8:15 PM, Borislav Petkov wrote:
>> On Thu, Feb 15, 2024 at 05:01:17PM +0530, Nikunj A Dadhania wrote:
>>> +/* Secrets page physical address from the CC blob */
>>> +static u64 secrets_pa __ro_after_init;
>>
>> Since you're going to use this during runtime (are you?),
>
> Yes, this is used during runtime, during initial boot will be used by Secure TSC and later by sev-guest driver.
>
>> why don't you put in here the result of:
>>
>> ioremap_encrypted(secrets_pa, PAGE_SIZE);
>>
>> so that you can have it ready and not even have to ioremap each time?
>

> @@ -2118,6 +2083,14 @@ bool __init snp_init(struct boot_params *bp)
> if (!cc_info)
> return false;
>
> + if (cc_info->secrets_phys && cc_info->secrets_len == PAGE_SIZE) {
> + secrets_page = ioremap_encrypted(cc_info->secrets_phys, PAGE_SIZE);

ioremap_encrypted() does not work this early, snp guest boot fails, will debug further.

Regards,
Nikunj


\
 
 \ /
  Last update: 2024-04-17 10:00    [W:0.058 / U:0.088 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site