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

Neeraj Upadhyay
2025-03-21T16:09:36Z

On 3/21/2025 7:25 PM, Borislav Petkov wrote:
> On Fri, Mar 21, 2025 at 09:14:15AM +0530, Neeraj Upadhyay wrote:
>> Do you think we should handle this case differently and not force select
>> AMD_SECURE_AVIC config when AMD_MEM_ENCRYPT config is enabled?
>
> Yeah, you'd have to do some simple CONFIG_AMD_SECURE_AVIC ifdeffery and add
> (or not) the flag to SNP_FEATURES_PRESENT, depending...
>

Ok, something like below?

+#ifdef CONFIG_AMD_SECURE_AVIC
+#define SNP_SECURE_AVIC MSR_AMD64_SNP_SECURE_AVIC
+#else
+#define SNP_SECURE_AVIC 0
+#endif
+

#define SNP_FEATURES_PRESENT (MSR_AMD64_SNP_DEBUG_SWAP | \
MSR_AMD64_SNP_SECURE_TSC | \
- MSR_AMD64_SNP_SECURE_AVIC)
+ SNP_SECURE_AVIC)

- Neeraj