From: Igor Mammedov <imammedo@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: "Zhao Liu" <zhao1.liu@intel.com>,
"Xiaoyao Li" <xiaoyao.li@intel.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
qemu-devel@nongnu.org, "Yanan Wang" <wangyanan55@huawei.com>,
"Kevin Wolf" <kwolf@redhat.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
qemu-block@nongnu.org, "Fabiano Rosas" <farosas@suse.de>,
"Fam Zheng" <fam@euphon.net>, "Jason Wang" <jasowang@redhat.com>,
"Laurent Vivier" <lvivier@redhat.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Dmitry Fleytman" <dmitry.fleytman@gmail.com>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Hanna Reitz" <hreitz@redhat.com>, "John Snow" <jsnow@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Michael S. Tsirkin" <mst@redhat.com>
Subject: Re: [PATCH v4 04/19] target/i386/cpu: Remove X86CPU::check_cpuid field
Date: Fri, 27 Jun 2025 13:31:39 +0200 [thread overview]
Message-ID: <20250627133139.25e78d64@fedora> (raw)
In-Reply-To: <aEFiUp9xD-UIhuGq@redhat.com>
On Thu, 5 Jun 2025 10:24:34 +0100
Daniel P. Berrangé <berrange@redhat.com> wrote:
> On Tue, Jun 03, 2025 at 05:02:38PM +0200, Igor Mammedov wrote:
> > On Wed, 28 May 2025 13:23:49 +0800
> > Zhao Liu <zhao1.liu@intel.com> wrote:
> >
> > > On Wed, May 28, 2025 at 10:09:56AM +0800, Xiaoyao Li wrote:
> > > > Date: Wed, 28 May 2025 10:09:56 +0800
> > > > From: Xiaoyao Li <xiaoyao.li@intel.com>
> > > > Subject: Re: [PATCH v4 04/19] target/i386/cpu: Remove X86CPU::check_cpuid
> > > > field
> > > >
> > > > On 5/12/2025 4:39 PM, Philippe Mathieu-Daudé wrote:
> > > > > The X86CPU::check_cpuid boolean was only set in the
> > > > > pc_compat_2_4[] array, via the 'check=off' property.
> > > > > We removed all machines using that array, lets remove
> > > > > that CPU property and simplify x86_cpu_realizefn().
> > > >
> > > > No.
> > > >
> > > > We cannot do this. Because it changes the behavior of QEMU.
> > > >
> > > > 'check_cpuid' is true by default while 'enforce_cpuid' is false. So that
> > > > QEMU emits warnings in x86_cpu_filter_features() by default when user
> > > > requests unsupported CPU features. If remove "check" property and the
> > > > internal 'check_cpuid', QEMU will not do it unless user sets enforce_cpuid
> > > > explicitly.
> > >
> > > One option would be to have x86_cpu_filter_features() unconditionally
> > > turn on verbose and print warnings, but some people might want to turn
> > > off these warning prints, I don't know if anyone would, but it would be
> > > possible.
> > >
> > > The other option is still to keep the “check” property.
> > >
> > > IMO, the latter option is the better way to reduce Philippe's burden.
> >
> > we essentially loose warnings by default when some features aren't available,
> > qemu still continues to run though.
> >
> > Given that Daniel acked it from libvirt side, libvirt doesn't care about warnings
> > (it does its has its own cpu model calculation). Likely other mgmt do not care
> > about it either, and if they do they probably doing something wrong and
> > should use QMP to get that data.
>
> Acking it was a mistake on my part - I mis-interpreted the patch and so
> didn't notice we were loosing the verbose printing of missing features
> by default.
>
> I'm actually curious why we made the 'check' feature tied to machine
> types at all. If it doesn't affect guest ABI, just causes verbose
> info on stderr, it feels like something we could have just had on
> all machine types new & old. Git history brings us back to
>
> commit 3e68482224129c3ddc061af7c9d438b882ecfdd1
> Author: Eduardo Habkost <ehabkost@redhat.com>
> Date: Tue Nov 3 17:18:50 2015 -0200
>
> target-i386: Set "check=off" by default on pc-*-2.4 and older
>
> The default CPU model (qemu64) have some issues today: it enables some
> features (ABM and SSE4a) that are not present in many host CPUs. That
> means many hosts (but not all of them) had those features silently
> disabled in the default configuration in QEMU 2.4 and older.
>
> With the new "check=on" default, this causes warnings to be printed in
> the default configuration, because of the lack of SSE4A on all Intel
> hosts, and the lack of ABM on Sandy Bridge and older hosts:
>
> $ qemu-system-x86_64 -machine pc,accel=kvm
> warning: host doesn't support requested feature: CPUID.80000001H:ECX.abm [bit 5]
> warning: host doesn't support requested feature: CPUID.80000001H:ECX.sse4a [bit 6]
>
> Those issues will be fixed in pc-*-2.5 and newer. But as we can't change
> the guest ABI in pc-*-2.4, disable "check" mode by default in pc-*-2.4
> and older so we don't print spurious warnings.
>
> IOW, we wanted to have 'check' unconditionally on by default, but
> had to do a temp hack to avoid spamming all configurations with
> the broken 'qemu64' CPU model design.
>
> > That leaves us with human users, for that case I'd say one should use
> > enforce_cpuid if feature availability matters.
>
> IMHO even with mgmt apps, it is worth having 'check=on' by default
> as the log message has value in debugging scenarios. It could have
> the potential to highlight situations where an mgmt app has
> unwittingly done something wrong with CPU config. At the very least
> though its a warning to humans debugging that they should not trust
> the QEMU command line as a expressing the full CPU featureset.
in that line of thought, maybe hardcode 'check=on' and drop conditional/property?
>
> With regards,
> Daniel
next prev parent reply other threads:[~2025-06-27 11:32 UTC|newest]
Thread overview: 56+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-12 8:39 [PATCH v4 00/19] hw/i386/pc: Remove deprecated 2.4 and 2.5 PC machines Philippe Mathieu-Daudé
2025-05-12 8:39 ` [PATCH v4 01/19] hw/i386/pc: Remove deprecated pc-q35-2.4 and pc-i440fx-2.4 machines Philippe Mathieu-Daudé
2025-05-28 1:58 ` Xiaoyao Li
2025-06-03 14:46 ` Igor Mammedov
2025-05-12 8:39 ` [PATCH v4 02/19] hw/i386/pc: Remove PCMachineClass::broken_reserved_end field Philippe Mathieu-Daudé
2025-05-28 1:58 ` Xiaoyao Li
2025-06-03 14:48 ` Igor Mammedov
2025-05-12 8:39 ` [PATCH v4 03/19] hw/i386/pc: Remove pc_compat_2_4[] array Philippe Mathieu-Daudé
2025-05-28 1:59 ` Xiaoyao Li
2025-06-03 14:51 ` Igor Mammedov
2025-05-12 8:39 ` [PATCH v4 04/19] target/i386/cpu: Remove X86CPU::check_cpuid field Philippe Mathieu-Daudé
2025-05-28 2:09 ` Xiaoyao Li
2025-05-28 5:23 ` Zhao Liu
2025-06-03 15:02 ` Igor Mammedov
2025-06-03 15:54 ` Xiaoyao Li
2025-06-05 9:09 ` Igor Mammedov
2025-06-05 9:28 ` Daniel P. Berrangé
2025-06-05 9:24 ` Daniel P. Berrangé
2025-06-27 11:31 ` Igor Mammedov [this message]
2025-06-03 14:53 ` Igor Mammedov
2025-05-12 8:39 ` [PATCH v4 05/19] hw/core/machine: Remove hw_compat_2_4[] array Philippe Mathieu-Daudé
2025-05-28 2:11 ` Xiaoyao Li
2025-05-12 8:39 ` [PATCH v4 06/19] hw/net/e1000: Remove unused E1000_FLAG_MAC flag Philippe Mathieu-Daudé
2025-05-12 8:39 ` [PATCH v4 07/19] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_MIGRATE_EXTRA definition Philippe Mathieu-Daudé
2025-05-12 8:39 ` [PATCH v4 08/19] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_DISABLE_PCIE definition Philippe Mathieu-Daudé
2025-05-28 2:44 ` Xiaoyao Li
2025-05-12 8:39 ` [PATCH v4 09/19] hw/i386/pc: Remove deprecated pc-q35-2.5 and pc-i440fx-2.5 machines Philippe Mathieu-Daudé
2025-05-28 2:21 ` Xiaoyao Li
2025-05-12 8:39 ` [PATCH v4 10/19] hw/i386/x86: Remove X86MachineClass::save_tsc_khz field Philippe Mathieu-Daudé
2025-05-28 2:21 ` Xiaoyao Li
2025-05-12 8:39 ` [PATCH v4 11/19] hw/nvram/fw_cfg: Remove legacy FW_CFG_ORDER_OVERRIDE Philippe Mathieu-Daudé
2025-05-28 2:46 ` Xiaoyao Li
2025-05-12 8:39 ` [PATCH v4 12/19] hw/core/machine: Remove hw_compat_2_5[] array Philippe Mathieu-Daudé
2025-05-28 2:21 ` Xiaoyao Li
2025-05-12 8:39 ` [PATCH v4 13/19] hw/block/fdc-isa: Remove 'fallback' property Philippe Mathieu-Daudé
2025-05-27 17:20 ` Thomas Huth
2025-05-28 8:30 ` Thomas Huth
2025-05-28 8:37 ` Thomas Huth
2025-05-30 11:45 ` Michael S. Tsirkin
2025-06-02 8:03 ` Philippe Mathieu-Daudé
2025-05-12 8:39 ` [PATCH v4 14/19] hw/scsi/vmw_pvscsi: Remove PVSCSI_COMPAT_OLD_PCI_CONFIGURATION definition Philippe Mathieu-Daudé
2025-05-28 2:47 ` Xiaoyao Li
2025-05-12 8:39 ` [PATCH v4 15/19] hw/scsi/vmw_pvscsi: Remove PVSCSI_COMPAT_DISABLE_PCIE_BIT definition Philippe Mathieu-Daudé
2025-05-28 2:47 ` Xiaoyao Li
2025-05-12 8:39 ` [PATCH v4 16/19] hw/scsi/vmw_pvscsi: Convert DeviceRealize -> InstanceInit Philippe Mathieu-Daudé
2025-05-28 2:47 ` Xiaoyao Li
2025-05-12 8:39 ` [PATCH v4 17/19] hw/net/vmxnet3: Remove VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS definition Philippe Mathieu-Daudé
2025-05-28 2:48 ` Xiaoyao Li
2025-05-12 8:39 ` [PATCH v4 18/19] hw/net/vmxnet3: Remove VMXNET3_COMPAT_FLAG_DISABLE_PCIE definition Philippe Mathieu-Daudé
2025-05-28 2:48 ` Xiaoyao Li
2025-05-12 8:39 ` [PATCH v4 19/19] hw/net/vmxnet3: Merge DeviceRealize in InstanceInit Philippe Mathieu-Daudé
2025-05-28 2:48 ` Xiaoyao Li
2025-05-28 3:01 ` [PATCH v4 00/19] hw/i386/pc: Remove deprecated 2.4 and 2.5 PC machines Xiaoyao Li
2025-05-28 8:11 ` Thomas Huth
2025-05-28 8:40 ` Xiaoyao Li
2025-05-30 11:46 ` Michael S. Tsirkin
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=20250627133139.25e78d64@fedora \
--to=imammedo@redhat.com \
--cc=berrange@redhat.com \
--cc=dmitry.fleytman@gmail.com \
--cc=eduardo@habkost.net \
--cc=fam@euphon.net \
--cc=farosas@suse.de \
--cc=hreitz@redhat.com \
--cc=jasowang@redhat.com \
--cc=jsnow@redhat.com \
--cc=kraxel@redhat.com \
--cc=kwolf@redhat.com \
--cc=lvivier@redhat.com \
--cc=marcel.apfelbaum@gmail.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=philmd@linaro.org \
--cc=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=wangyanan55@huawei.com \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.