[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20260209174559.GDaYodVxWsiesiedLJ@fat_crate.local>
Date: Mon, 9 Feb 2026 18:45:59 +0100
From: Borislav Petkov <bp@...en8.de>
To: Sean Christopherson <seanjc@...gle.com>
Cc: Carlos López <clopez@...e.de>,
Jim Mattson <jmattson@...gle.com>, kvm@...r.kernel.org,
Paolo Bonzini <pbonzini@...hat.com>,
Thomas Gleixner <tglx@...nel.org>, Ingo Molnar <mingo@...hat.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
"maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <x86@...nel.org>,
"H. Peter Anvin" <hpa@...or.com>,
"open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" <linux-kernel@...r.kernel.org>,
Babu Moger <bmoger@....com>
Subject: Re: [PATCH] KVM: x86: synthesize TSA CPUID bits via SCATTERED_F()
On Mon, Feb 09, 2026 at 08:29:36AM -0800, Sean Christopherson wrote:
> Nope. KVM cares about what KVM can virtualize/emulate, and about helping userspace
> accurately represent the virtual CPU that will be enumerated to the guest.
So why don't you key on that in those macros instead of how they're defined?
EXPOSE_TO_GUEST_F()
and then underneath we can figure out how to expose them.
We could have a helper table which determines what each feature is and how it
should interact with raw host CPUID or something slicker.
> F : Features that must be present in boot_cpu_data and raw CPUID
> SCATTERED_F : Same as F(), but are scattered by the kernel
> X86_64_F : Same as F(), but are restricted to 64-bit kernels
> EMULATED_F : Always supported; the feature is unconditionally emulated in software
> SYNTHESIZED_F : Features that must be present in boot_cpu_data, but may or
> may not be in raw CPUID. May also be scattered.
> PASSTHROUGH_F : Features that must be present in raw CPUID, but may or may
> not be present in boot_cpu_data
> ALIASED_1_EDX_F : Features in 0x8000_0001.EDX that are duplicates of identical 0x1.EDX features
> VENDOR_F : Features that are controlled by vendor code, often because
> they are guarded by a vendor specific module param. Rules
> vary, but typically they are handled like basic F() features
> RUNTIME_F : Features that KVM dynamically sets/clears at runtime, but that
> are never adveristed to userspace. E.g. OSXSAVE and OSPKE.
And for the time being, I'd love if this were somewhere in
arch/x86/kvm/cpuid.c so that it is clear how one should use those macros.
The end goal of having the user not care about which macro to use would be the
ultimate, super-duper thing tho.
I'd say.
Thx.
--
Regards/Gruss,
Boris.
https://people.kernel.org/tglx/notes-about-netiquette
Powered by blists - more mailing lists