Re: [PATCH] KVM: x86: synthesize TSA CPUID bits via SCATTERED_F()
From: Sean Christopherson
Date: Mon Feb 09 2026 - 11:31:28 EST
On Mon, Feb 09, 2026, Borislav Petkov wrote:
> On Mon, Feb 09, 2026 at 07:06:36AM -0800, Sean Christopherson wrote:
> > Maybe I could add a table showing how the XXX_F() macros map to various controls?
>
> Perhaps start first, please, with explaining the difference between
> SYNTHESIZED_F and SCATTERED_F and why you even need it?
SCATTERED_F requires the feature flag to be present in raw CPUID, SYNTHESIZED_F
does not.
> I mean, KVM and guests only care whether X86_FEATURE flags are set or not, no?
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.
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.
> Not how they get defined underneath...