Re: [PATCH] x86/coco, x86/sev: Use cpu_feature_enabled() to detect SEV guest flavor

From: Borislav Petkov
Date: Tue Dec 05 2023 - 13:53:03 EST


On Tue, Dec 05, 2023 at 09:08:13PM +0300, Kirill A. Shutemov wrote:
> It is here and it is broken.

It is not broken - it is getting improved as we go.

> I think legitimate use case for cc_platfrom_has() is to check platform
> capability, not specific implementation.

Yes, and I already agreed that it is used the wrong way there.

> And we have much more mature infrastructure around X86_FEATURE_ comparing
> to CC_ATRR_. If we can use it, we should.

Mature, shmature. X86_FEATURE_ has its own issues - don't even get me
started on it. You want it because you use TDX_GUEST and it works fine
for you. Yes, we can always do X86_FEATURE_ but X86_FEATURE_ doesn't
belong in arch-agnostic code. cc_platform_has() does, OTOH.

So yes, we will fix your issue, no worries. I'm figuring out the
details as we speak.

--
Regards/Gruss,
Boris.

https://people.kernel.org/tglx/notes-about-netiquette