From: Sean Christopherson <seanjc@google.com>
To: Igor Mammedov <imammedo@redhat.com>
Cc: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>,
Zhao Liu <zhao1.liu@intel.com>, Xiaoyao Li <xiaoyao.li@intel.com>,
Alexandre Chartre <alexandre.chartre@oracle.com>,
qemu-devel@nongnu.org, pbonzini@redhat.com,
qemu-stable@nongnu.org, boris.ostrovsky@oracle.com,
maciej.szmigiero@oracle.com, kvm@vger.kernel.org
Subject: Re: [PATCH] i386/cpu: ARCH_CAPABILITIES should not be advertised on AMD
Date: Mon, 7 Jul 2025 12:54:16 -0700 [thread overview]
Message-ID: <aGwl6GUwYsGVXG5k@google.com> (raw)
In-Reply-To: <20250702132307.71e3b783@fedora>
On Wed, Jul 02, 2025, Igor Mammedov wrote:
> Or even better a single KVM optin feature 'do_not_advertise_features_not_supported_by_host_cpu',
> and then QEMU could use that for disabling all nonsense in one go.
> Plus all of that won't be breaking KVM ABI nor qemu had to add fixups for this and that feature.
>
> After some time when old machine types are deprecated/gone, KVM could make it default and eventually
> remove advertising 'fake' features.
Such a feature/quirk wouldn't be useful in practice. There are several features
that KVM emulates irrespective of hardware support, and that generally speaking
every VMM will want to enable whenever possible, e.g. x2APIC, TSC deadline timer,
TSC adjust, and the amusing "no SMM_CTL MSR" anti-feature. Throwing out x2APIC
and TSC deadline timer in particular would be a significant regression, i.e. not
something any end user actually wants.
If QEMU or any other VMM wants to filter KVM's support against bare metal, then
QEMU can simply do CPUID itself.
Somewhat of a side topic, the somewhat confusingly-named KVM_GET_EMULATED_CPUID
exists to allow KVM to differentiate between features that KVM can emulate and/or
virtualize without additional overhead, and those that KVM can emulate but with
non-trivial cost. E.g. KVM advertises MOVBE and RDPID in KVM_GET_SUPPORTED_CPUID
if and only if they are natively suppored, because enabling those instructions in
the guest's CPUID model turns exitless instruction execution into expensive #UD
VM-Exits and slow emulation. But KVM unconditionally advertises support for them
in KVM_GET_EMULATED_CPUID so that userspace can run a "newer" VM on old hardware.
I mention KVM_GET_EMULATED_CPUID purely to stave off any exploration into trying
to move ARCH_CAPABILITIES to KVM_GET_EMULATED_CPUID. Name aside, it's not the
correct fit (and would still be an ABI change).
next prev parent reply other threads:[~2025-07-07 20:08 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-30 13:30 [PATCH] i386/cpu: ARCH_CAPABILITIES should not be advertised on AMD Alexandre Chartre
2025-07-01 8:23 ` Xiaoyao Li
2025-07-01 9:22 ` Alexandre Chartre
2025-07-01 9:47 ` Xiaoyao Li
2025-07-01 19:47 ` Konrad Rzeszutek Wilk
2025-07-02 1:06 ` Xiaoyao Li
2025-07-01 9:25 ` Maciej S. Szmigiero
2025-07-07 19:36 ` Daniel P. Berrangé
2025-07-01 10:26 ` Zhao Liu
2025-07-01 11:12 ` Xiaoyao Li
2025-07-01 12:12 ` Alexandre Chartre
2025-07-01 15:13 ` Xiaoyao Li
2025-07-01 19:59 ` Konrad Rzeszutek Wilk
2025-07-07 19:31 ` Daniel P. Berrangé
2025-07-07 20:03 ` Sean Christopherson
2025-07-01 12:36 ` Zhao Liu
2025-07-01 13:05 ` Igor Mammedov
2025-07-01 20:01 ` Konrad Rzeszutek Wilk
2025-07-02 5:01 ` Zhao Liu
2025-07-02 5:19 ` Zhao Liu
2025-07-02 5:30 ` Xiaoyao Li
2025-07-02 8:34 ` Zhao Liu
2025-07-07 19:20 ` Sean Christopherson
2025-07-02 9:27 ` Alexandre Chartre
2025-07-02 11:23 ` Igor Mammedov
2025-07-07 19:54 ` Sean Christopherson [this message]
2025-07-07 19:05 ` Sean Christopherson
2025-07-01 12:19 ` Alexandre Chartre
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aGwl6GUwYsGVXG5k@google.com \
--to=seanjc@google.com \
--cc=alexandre.chartre@oracle.com \
--cc=boris.ostrovsky@oracle.com \
--cc=imammedo@redhat.com \
--cc=konrad.wilk@oracle.com \
--cc=kvm@vger.kernel.org \
--cc=maciej.szmigiero@oracle.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-stable@nongnu.org \
--cc=xiaoyao.li@intel.com \
--cc=zhao1.liu@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).