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

From: Kirill A. Shutemov
Date: Wed Oct 09 2024 - 06:12:49 EST


On Fri, Sep 13, 2024 at 05:06:52PM +0530, Neeraj Upadhyay wrote:
> diff --git a/include/linux/cc_platform.h b/include/linux/cc_platform.h
> index caa4b4430634..801208678450 100644
> --- a/include/linux/cc_platform.h
> +++ b/include/linux/cc_platform.h
> @@ -88,6 +88,14 @@ enum cc_attr {
> * enabled to run SEV-SNP guests.
> */
> CC_ATTR_HOST_SEV_SNP,
> +
> + /**
> + * @CC_ATTR_SNP_SECURE_AVIC: Secure AVIC mode is active.
> + *
> + * The host kernel is running with the necessary features enabled
> + * to run SEV-SNP guests with full Secure AVIC capabilities.
> + */
> + CC_ATTR_SNP_SECURE_AVIC,

I don't think CC attributes is the right way to track this kind of
features. My understanding of cc_platform interface is that it has to be
used to advertise some kind of property of the platform that generic code
and be interested in, not a specific implementation.

For the same reason, I think CC_ATTR_GUEST/HOST_SEV_SNP is also a bad use
of the interface.

Borislav, I know we had different view on this. What is your criteria on
what should and shouldn't be a CC attribute? I don't think we want a
parallel X86_FEATURE_*.

--
Kiryl Shutsemau / Kirill A. Shutemov