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:   Wed, 19 May 2021 12:28:50 -0500
From:   Brijesh Singh <brijesh.singh@....com>
To:     Borislav Petkov <bp@...en8.de>
Cc:     brijesh.singh@....com, x86@...nel.org,
        linux-kernel@...r.kernel.org, kvm@...r.kernel.org,
        tglx@...utronix.de, jroedel@...e.de, thomas.lendacky@....com,
        pbonzini@...hat.com, mingo@...hat.com, dave.hansen@...el.com,
        rientjes@...gle.com, seanjc@...gle.com, peterz@...radead.org,
        hpa@...or.com, tony.luck@...el.com
Subject: Re: [PATCH Part1 RFC v2 08/20] x86/mm: Add sev_snp_active() helper


On 5/18/21 1:11 PM, Borislav Petkov wrote:
> On Fri, Apr 30, 2021 at 07:16:04AM -0500, Brijesh Singh wrote:
>> The sev_snp_active() helper can be used by the guest to query whether the
>> SNP - Secure Nested Paging feature is active.
>>
>> Signed-off-by: Brijesh Singh <brijesh.singh@....com>
>> ---
>>  arch/x86/include/asm/mem_encrypt.h | 2 ++
>>  arch/x86/include/asm/msr-index.h   | 2 ++
>>  arch/x86/mm/mem_encrypt.c          | 9 +++++++++
>>  3 files changed, 13 insertions(+)
>>
>> diff --git a/arch/x86/include/asm/mem_encrypt.h b/arch/x86/include/asm/mem_encrypt.h
>> index 31c4df123aa0..d99aa260d328 100644
>> --- a/arch/x86/include/asm/mem_encrypt.h
>> +++ b/arch/x86/include/asm/mem_encrypt.h
>> @@ -54,6 +54,7 @@ void __init sev_es_init_vc_handling(void);
>>  bool sme_active(void);
>>  bool sev_active(void);
>>  bool sev_es_active(void);
>> +bool sev_snp_active(void);
>>  
>>  #define __bss_decrypted __section(".bss..decrypted")
>>  
>> @@ -79,6 +80,7 @@ static inline void sev_es_init_vc_handling(void) { }
>>  static inline bool sme_active(void) { return false; }
>>  static inline bool sev_active(void) { return false; }
>>  static inline bool sev_es_active(void) { return false; }
>> +static inline bool sev_snp_active(void) { return false; }
> Uff, yet another sev-something helper. So I already had this idea:
>
> https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Flore.kernel.org%2Fkvm%2F20210421144402.GB5004%40zn.tnic%2F&amp;data=04%7C01%7Cbrijesh.singh%40amd.com%7C363870693b07482681da08d91a284ce4%7C3dd8961fe4884e608e11a82d994e183d%7C0%7C0%7C637569582675957160%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;sdata=Ebk6MT2jKDfyPwwzYb3D5%2BGopUU3VWudgeAUxcsc74c%3D&amp;reserved=0
>
> How about you add the sev_feature_enabled() thing
>
> which will return a boolean value depending on which SEV feature has
> been queried and instead of having yet another helper, do
>
> 	if (sev_feature_enabled(SEV_SNP))
>
> or so?

Sure, I will introduce it in next rev.


> I.e., just add the facility and the SNP bit - we will convert the rest
> in time.
>
> So that we can redesign this cleanly...
>
> Thx.
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ