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

From: Kirill A. Shutemov
Date: Tue Jan 02 2024 - 07:22:45 EST


On Tue, Dec 05, 2023 at 09:33:37PM +0100, Borislav Petkov wrote:
> On Tue, Dec 05, 2023 at 07:52:41PM +0100, Borislav Petkov wrote:
> > So yes, we will fix your issue, no worries. I'm figuring out the
> > details as we speak.
>
> So you can do for the short term:
>
> ---
> diff --git a/arch/x86/kernel/kvm.c b/arch/x86/kernel/kvm.c
> index c461c1a4b6af..f8999f6d1b00 100644
> --- a/arch/x86/kernel/kvm.c
> +++ b/arch/x86/kernel/kvm.c
> @@ -434,7 +434,7 @@ static void __init sev_map_percpu_data(void)
> {
> int cpu;
>
> - if (!cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT))
> + if (cc_vendor != CC_VENDOR_AMD || !cc_platform_has(CC_ATTR_GUEST_MEM_ENCRYPT))
> return;
>
> for_each_possible_cpu(cpu) {
> ---
>
> until we've sorted out the bigger picture.

So, there seems no movement on the issue.

Borislav, could you share your view on the bigger picture. I can try to
implement it.

--
Kiryl Shutsemau / Kirill A. Shutemov