From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Cc: "Kevin Wolf" <kwolf@redhat.com>,
"Philippe Mathieu-Daudé" <philmd@linaro.org>,
"Yanan Wang" <wangyanan55@huawei.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Eduardo Habkost" <eduardo@habkost.net>,
"Fam Zheng" <fam@euphon.net>, "Hanna Reitz" <hreitz@redhat.com>,
"Zhao Liu" <zhao1.liu@intel.com>,
qemu-block@nongnu.org,
"Dmitry Fleytman" <dmitry.fleytman@gmail.com>,
"Richard Henderson" <richard.henderson@linaro.org>,
"Laurent Vivier" <lvivier@redhat.com>,
"John Snow" <jsnow@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
"Michael S. Tsirkin" <mst@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Fabiano Rosas" <farosas@suse.de>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Thomas Huth" <thuth@redhat.com>
Subject: [PATCH v3 10/19] hw/i386/x86: Remove X86MachineClass::save_tsc_khz field
Date: Tue, 6 May 2025 16:38:56 +0200 [thread overview]
Message-ID: <20250506143905.4961-11-philmd@linaro.org> (raw)
In-Reply-To: <20250506143905.4961-1-philmd@linaro.org>
The X86MachineClass::save_tsc_khz boolean was only used
by the pc-q35-2.5 and pc-i440fx-2.5 machines, which got
removed. Remove it and simplify tsc_khz_needed().
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>
Reviewed-by: Thomas Huth <thuth@redhat.com>
---
include/hw/i386/x86.h | 5 -----
hw/i386/x86.c | 1 -
target/i386/machine.c | 5 ++---
3 files changed, 2 insertions(+), 9 deletions(-)
diff --git a/include/hw/i386/x86.h b/include/hw/i386/x86.h
index 258b1343a16..fc460b82f82 100644
--- a/include/hw/i386/x86.h
+++ b/include/hw/i386/x86.h
@@ -27,13 +27,8 @@
#include "qom/object.h"
struct X86MachineClass {
- /*< private >*/
MachineClass parent;
- /*< public >*/
-
- /* TSC rate migration: */
- bool save_tsc_khz;
/* use DMA capable linuxboot option rom */
bool fwcfg_dma_enabled;
/* CPU and apic information: */
diff --git a/hw/i386/x86.c b/hw/i386/x86.c
index e2d04092992..f80533df1c5 100644
--- a/hw/i386/x86.c
+++ b/hw/i386/x86.c
@@ -382,7 +382,6 @@ static void x86_machine_class_init(ObjectClass *oc, const void *data)
mc->get_default_cpu_node_id = x86_get_default_cpu_node_id;
mc->possible_cpu_arch_ids = x86_possible_cpu_arch_ids;
mc->kvm_type = x86_kvm_type;
- x86mc->save_tsc_khz = true;
x86mc->fwcfg_dma_enabled = true;
nc->nmi_monitor_handler = x86_nmi;
diff --git a/target/i386/machine.c b/target/i386/machine.c
index 6cb561c6322..dd2dac1d443 100644
--- a/target/i386/machine.c
+++ b/target/i386/machine.c
@@ -1060,9 +1060,8 @@ static bool tsc_khz_needed(void *opaque)
{
X86CPU *cpu = opaque;
CPUX86State *env = &cpu->env;
- MachineClass *mc = MACHINE_GET_CLASS(qdev_get_machine());
- X86MachineClass *x86mc = X86_MACHINE_CLASS(mc);
- return env->tsc_khz && x86mc->save_tsc_khz;
+
+ return env->tsc_khz;
}
static const VMStateDescription vmstate_tsc_khz = {
--
2.47.1
next prev parent reply other threads:[~2025-05-06 14:46 UTC|newest]
Thread overview: 44+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-05-06 14:38 [PATCH v3 00/19] hw/i386/pc: Remove deprecated 2.4 and 2.5 PC machines Philippe Mathieu-Daudé
2025-05-06 14:38 ` [PATCH v3 01/19] hw/i386/pc: Remove deprecated pc-q35-2.4 and pc-i440fx-2.4 machines Philippe Mathieu-Daudé
2025-05-07 2:31 ` Zhao Liu
2025-05-06 14:38 ` [PATCH v3 02/19] hw/i386/pc: Remove PCMachineClass::broken_reserved_end field Philippe Mathieu-Daudé
2025-05-07 2:33 ` Zhao Liu
2025-05-06 14:38 ` [PATCH v3 03/19] hw/i386/pc: Remove pc_compat_2_4[] array Philippe Mathieu-Daudé
2025-05-07 2:34 ` Zhao Liu
2025-05-06 14:38 ` [PATCH v3 04/19] target/i386/cpu: Remove X86CPU::check_cpuid field Philippe Mathieu-Daudé
2025-05-07 2:35 ` Zhao Liu
2025-05-06 14:38 ` [PATCH v3 05/19] hw/core/machine: Remove hw_compat_2_4[] array Philippe Mathieu-Daudé
2025-05-07 2:36 ` Zhao Liu
2025-05-06 14:38 ` [PATCH v3 06/19] hw/net/e1000: Remove unused E1000_FLAG_MAC flag Philippe Mathieu-Daudé
2025-05-07 3:33 ` Zhao Liu
2025-05-12 6:00 ` Thomas Huth
2025-05-12 8:14 ` Philippe Mathieu-Daudé
2025-05-06 14:38 ` [PATCH v3 07/19] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_MIGRATE_EXTRA definition Philippe Mathieu-Daudé
2025-05-07 3:34 ` Zhao Liu
2025-05-06 14:38 ` [PATCH v3 08/19] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_DISABLE_PCIE definition Philippe Mathieu-Daudé
2025-05-07 3:36 ` Zhao Liu
2025-05-06 14:38 ` [PATCH v3 09/19] hw/i386/pc: Remove deprecated pc-q35-2.5 and pc-i440fx-2.5 machines Philippe Mathieu-Daudé
2025-05-07 3:36 ` Zhao Liu
2025-05-06 14:38 ` Philippe Mathieu-Daudé [this message]
2025-05-07 3:38 ` [PATCH v3 10/19] hw/i386/x86: Remove X86MachineClass::save_tsc_khz field Zhao Liu
2025-05-06 14:38 ` [PATCH v3 11/19] hw/nvram/fw_cfg: Remove legacy FW_CFG_ORDER_OVERRIDE Philippe Mathieu-Daudé
2025-05-07 3:49 ` Zhao Liu
2025-05-06 14:38 ` [PATCH v3 12/19] hw/core/machine: Remove hw_compat_2_5[] array Philippe Mathieu-Daudé
2025-05-07 3:50 ` Zhao Liu
2025-05-06 14:38 ` [PATCH v3 13/19] hw/block/fdc-isa: Remove 'fallback' property Philippe Mathieu-Daudé
2025-05-07 5:50 ` Zhao Liu
2025-05-06 14:39 ` [PATCH v3 14/19] hw/scsi/vmw_pvscsi: Remove PVSCSI_COMPAT_OLD_PCI_CONFIGURATION definition Philippe Mathieu-Daudé
2025-05-07 5:57 ` Zhao Liu
2025-05-06 14:39 ` [PATCH v3 15/19] hw/scsi/vmw_pvscsi: Remove PVSCSI_COMPAT_DISABLE_PCIE_BIT definition Philippe Mathieu-Daudé
2025-05-07 5:58 ` Zhao Liu
2025-05-06 14:39 ` [PATCH v3 16/19] hw/scsi/vmw_pvscsi: Convert DeviceRealize -> InstanceInit Philippe Mathieu-Daudé
2025-05-07 6:06 ` Zhao Liu
2025-05-06 14:39 ` [PATCH v3 17/19] hw/net/vmxnet3: Remove VMXNET3_COMPAT_FLAG_OLD_MSI_OFFSETS definition Philippe Mathieu-Daudé
2025-05-07 6:07 ` Zhao Liu
2025-05-06 14:39 ` [PATCH v3 18/19] hw/net/vmxnet3: Remove VMXNET3_COMPAT_FLAG_DISABLE_PCIE definition Philippe Mathieu-Daudé
2025-05-07 6:07 ` Zhao Liu
2025-05-06 14:39 ` [PATCH v3 19/19] hw/net/vmxnet3: Merge DeviceRealize in InstanceInit Philippe Mathieu-Daudé
2025-05-07 6:08 ` Zhao Liu
2025-05-09 13:30 ` [PATCH v3 00/19] hw/i386/pc: Remove deprecated 2.4 and 2.5 PC machines Thomas Huth
2025-05-12 8:32 ` Philippe Mathieu-Daudé
2025-05-12 8:39 ` Thomas Huth
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=20250506143905.4961-11-philmd@linaro.org \
--to=philmd@linaro.org \
--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=qemu-block@nongnu.org \
--cc=qemu-devel@nongnu.org \
--cc=richard.henderson@linaro.org \
--cc=thuth@redhat.com \
--cc=wangyanan55@huawei.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).