Re: [RFC v2 01/17] x86/apic: Add new driver for Secure AVIC

From: Neeraj Upadhyay
Date: Mon Apr 07 2025 - 12:31:04 EST




On 4/7/2025 6:47 PM, Borislav Petkov wrote:
> On Wed, Apr 02, 2025 at 04:04:34PM +0530, Neeraj Upadhyay wrote:
>> - snp_get_unsupported_features() looks like below.
>> It checks that, for the feature bits which are part of SNP_FEATURES_IMPL_REQ,
>> if they are enabled in hypervisor (and so reported in sev_status),
>> guest need to implement/enable those features. SAVIC also falls in that category
>> of SNP features.
>>
>> So, if CONFIG_AMD_SECURE_AVIC is disabled, guest would run with SAVIC feature
>> disabled in guest. This would cause undefined behavior for that guest if SAVIC
>> feature is active for that guest in hypervisor.
>
> Ok, so SNP_FEATURES_IMPL_REQ will contain the SAVIC bit (unconditionally,
> without the ifdeffery) and SNP_FEATURES_PRESENT will contain that thing you
> had suggested with the ifdeffery to denote whether SAVIC support has been
> enabled at build time:
>
> https://lore.kernel.org/r/e0362a96-4b3a-44b1-8d54-806a6b045799@xxxxxxx
>
> or not.
>
> Right?
>

Yes, that is the intent here.


- Neeraj