[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <64f7924e-1782-43e5-b21c-6e8efd74f318@amd.com>
Date: Tue, 23 Apr 2024 10:04:42 +0530
From: "Nikunj A. Dadhania" <nikunj@....com>
To: Borislav Petkov <bp@...en8.de>
Cc: linux-kernel@...r.kernel.org, thomas.lendacky@....com, x86@...nel.org,
kvm@...r.kernel.org, mingo@...hat.com, tglx@...utronix.de,
dave.hansen@...ux.intel.com, pgonda@...gle.com, seanjc@...gle.com,
pbonzini@...hat.com
Subject: Re: [PATCH v8 08/16] x86/mm: Add generic guest initialization hook
On 4/22/2024 6:50 PM, Borislav Petkov wrote:
> On Thu, Feb 15, 2024 at 05:01:20PM +0530, Nikunj A Dadhania wrote:
>> diff --git a/arch/x86/mm/mem_encrypt.c b/arch/x86/mm/mem_encrypt.c
>> index d035bce3a2b0..68aa06852466 100644
>> --- a/arch/x86/mm/mem_encrypt.c
>> +++ b/arch/x86/mm/mem_encrypt.c
>> @@ -89,6 +89,8 @@ void __init mem_encrypt_init(void)
>> /* Call into SWIOTLB to update the SWIOTLB DMA buffers */
>> swiotlb_update_mem_attributes();
>>
>> + x86_platform.guest.enc_init();
>> +
>> print_mem_encrypt_feature_info();
>
> Why all this hoopla if all you need is to call it once in mem_encrypt.c?
This was added thinking in mind that any SNP/TDX init can happen in this hook.
> IOW, you can simply call snp_secure_tsc_prepare() there, no?
Yes, that is very simple, will drop this change.
> Those function pointers are to be used in generic code in order to hide
> all the platform-specific hackery but mem_encrypt.c is not really
> generic code, I'd say...
>
Sure.
Regards
Nikunj
Powered by blists - more mailing lists