From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f202.google.com (mail-pl1-f202.google.com [209.85.214.202]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 1F3F936BCDA for ; Mon, 9 Feb 2026 16:29:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.214.202 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770654579; cv=none; b=GvAQE6UlW8P9dfX7aKjL40goUARpkzCxuMecooU1aIjY4b8uSIDHi91piJ83KfRhtT/UzvLqyjdnePpaxdWfa/7OPFBGHOFgMKd+QbwCR7a3tcVkxmU4kFzwDD/EkkHYDN0qK/3hBC3BtPFMqR4hEN9zd2LWf4yyqi2YHlePZxc= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770654579; c=relaxed/simple; bh=FvkDwI6Gzpmak2pqNEx9i8FFrdNHNrlZgNTnlPE3Oxc=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=gDIRWxo6zBXcf/PpYXiEC26G45DQTs1plGpMf20F7LhZzeEhuO0lhMVPRGl7YZvlM7nCbT/GG2vtIuzB/9f0vulbUxsCTvPS8JAUDBqvDSdhyoKtyRnCAJR0+pDuLQloGz+qDCmWMluiTc3NT9cUXyrKrgTr3EnnsjWy/4T0WUM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=cD3p1G8B; arc=none smtp.client-ip=209.85.214.202 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--seanjc.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="cD3p1G8B" Received: by mail-pl1-f202.google.com with SMTP id d9443c01a7336-2a75ed2f89dso33763365ad.1 for ; Mon, 09 Feb 2026 08:29:38 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1770654578; x=1771259378; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=Ch36A3Pg3T/wwR1RRTnLEsMUrUxWoxvuA9TPLIXrFmQ=; b=cD3p1G8B/Bslot0fiQs9OlZI0xi6B5CB8XlvRvxYhlX+RRUFAXikAfOle9YnDf/1+p 0hfZjMVKlOg4SUf//so2Mqxv9xNpJY4BcTe6kXYjzCpvO/VEgtIOIDZGUs++K7ggl8o3 6J7ckc4Y85INC7xcrFfsoY7uXVXDYlrO+q5FvdonicDHx6YvFMMfqhvVUhVoMmeXnZIj hQXnRXvabZgpG8ZSXSRkX/Jw3yi1pTCMLNHJ1wOh5IvBDxlI+UmXakAg4tFRyHDL0fEr OBjl2YUfLzXQPSto/kSZtyz079mtyn87osnG3X7ViWBdXTjsDhqbibjMa7t4VzX8sQIk x/9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770654578; x=1771259378; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=Ch36A3Pg3T/wwR1RRTnLEsMUrUxWoxvuA9TPLIXrFmQ=; b=cyWaSx6W66xFk5pDW1/DT1DPIitOxpNgBtUQJMMsVHoTDKkurHCKmQ/YaUcyXP35SD GcENSz7Bmcj8TYaG65aXJuiCO2X1DM2wUEdf/6OahMSiKT7dw0HWWjhT9Qmf8s6XgIYn i6G1LTN9jutLfY/L/mGX6TCIpLmaPsUNHAIt+v9fjVsDmxflAlhS59WXd61Z32XOpWMM ppI9htE7oZu5GJ97aVXJvMf24y51jhyjjZ3Qz50/TmWwaREDbbtyy/u5mEYgS9vyOCuq GkZhzcdImUmDpSlhaGPppZiEcOPp3KrQjzkFVDSJtSMTotXhvg07PD3jYFpqNgSMiXv2 kw3w== X-Forwarded-Encrypted: i=1; AJvYcCUn5ylI6w7XZ7U8dTG89yhrd8C+bGHRYNTNlEYdWpsmTa83tjtveZPj0Bjj+so+UGMi72ueqg5TiRutiks=@vger.kernel.org X-Gm-Message-State: AOJu0YyBH3MlB3FuHTxljMoWborB6ZcMjnh4A5potIyCpvdHQmQ20rQf oj5t64kaF6YcMy/tTIoA98qyGnbNmDhQZL2hespkqrM9fln7+EEfolWCJmcs61JL7Xugm8xt17B pmNnzfg== X-Received: from plbkz12.prod.google.com ([2002:a17:902:f9cc:b0:2aa:d1b9:5d46]) (user=seanjc job=prod-delivery.src-stubby-dispatcher) by 2002:a17:903:2f08:b0:2a7:95d0:d77d with SMTP id d9443c01a7336-2a95180f91dmr118672435ad.30.1770654578328; Mon, 09 Feb 2026 08:29:38 -0800 (PST) Date: Mon, 9 Feb 2026 08:29:36 -0800 In-Reply-To: <20260209153243.GBaYn-G02QE86Fje7g@fat_crate.local> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20260208164233.30405-1-clopez@suse.de> <20260208182849.GAaYjV4Vh8i0kznTEK@fat_crate.local> <20260208211342.GBaYj8hhtYM-lYfq-X@fat_crate.local> <20260209153243.GBaYn-G02QE86Fje7g@fat_crate.local> Message-ID: Subject: Re: [PATCH] KVM: x86: synthesize TSA CPUID bits via SCATTERED_F() From: Sean Christopherson To: Borislav Petkov Cc: "Carlos =?utf-8?B?TMOzcGV6?=" , Jim Mattson , kvm@vger.kernel.org, Paolo Bonzini , Thomas Gleixner , Ingo Molnar , Dave Hansen , "maintainer:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , "H. Peter Anvin" , "open list:X86 ARCHITECTURE (32-BIT AND 64-BIT)" , Babu Moger Content-Type: text/plain; charset="us-ascii" 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...