Re: [RFC 01/14] x86/apic: Add new driver for Secure AVIC
From: Kirill A. Shutemov
Date: Fri Oct 11 2024 - 03:29:47 EST
On Wed, Oct 09, 2024 at 03:53:35PM +0200, Borislav Petkov wrote:
> On Wed, Oct 09, 2024 at 03:12:41PM +0300, Kirill A. Shutemov wrote:
> > If you use SNP or TDX check in generic code something is wrong. Abstraction
> > is broken somewhere. Generic code doesn't need to know concrete
> > implementation.
>
> That's perhaps because you're thinking that the *actual* coco implementation type
> should be hidden away from generic code. But SNP and TDX are pretty different
> so we might as well ask for them by their name.
>
> But I can see why you'd think there might be some abstraction violation there.
>
> My goal here - even though there might be some bad taste of abstraction
> violation here - is simplicity. As expressed a bunch of times already, having
> cc_platform *and* X86_FEATURE* things used in relation to coco code can be
> confusing. So I'd prefer to avoid that confusion.
>
> Nothing says anywhere that arch code cannot use cc_platform interfaces.
> Absolutely nothing. So for the sake of KISS I'm going in that direction.
>
> If it turns out later that this was a bad idea and we need to change it, we
> can always can. As we do for other interfaces in the kernel.
>
> If you're still not convinced, I already asked you:
>
> "Do you have a better idea which is cleaner than what we do now?"
>
> Your turn.
Okay, I've got your point. It is not what I would do, but I don't have
sufficient argument to change what is already there.
--
Kiryl Shutsemau / Kirill A. Shutemov