[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 12/21] hw/i386/x86: Remove X86MachineClass::save_tsc_khz field
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 12/21] hw/i386/x86: Remove X86MachineClass::save_tsc_khz field |
Date: |
Thu, 16 Jan 2025 00:22:38 +0100 |
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>
---
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 d43cb3908e6..29ffa1f450e 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 69bfc00b9a5..57014863936 100644
--- a/hw/i386/x86.c
+++ b/hw/i386/x86.c
@@ -382,7 +382,6 @@ static void x86_machine_class_init(ObjectClass *oc, 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 d9d4f25d1a2..417cb4cd7f9 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
- [PATCH 07/21] hw/core/machine: Remove hw_compat_2_4[] array, (continued)
- [PATCH 07/21] hw/core/machine: Remove hw_compat_2_4[] array, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH 08/21] hw/net/e1000: Remove unused E1000_FLAG_MAC flag, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH 09/21] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_MIGRATE_EXTRA definition, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH 10/21] hw/virtio/virtio-pci: Remove VIRTIO_PCI_FLAG_DISABLE_PCIE definition, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH 11/21] hw/i386/pc: Remove deprecated pc-q35-2.5 and pc-i440fx-2.5 machines, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH 12/21] hw/i386/x86: Remove X86MachineClass::save_tsc_khz field,
Philippe Mathieu-Daudé <=
- [PATCH 13/21] hw/nvram/fw_cfg: Remove legacy FW_CFG_ORDER_OVERRIDE, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH 14/21] hw/core/machine: Remove hw_compat_2_5[] array, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH 15/21] hw/block/fdc-isa: Remove 'fallback' property, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH 16/21] hw/scsi/vmw_pvscsi: Remove PVSCSI_COMPAT_OLD_PCI_CONFIGURATION definition, Philippe Mathieu-Daudé, 2025/01/15
- [PATCH 17/21] hw/scsi/vmw_pvscsi: Remove PVSCSI_COMPAT_DISABLE_PCIE_BIT definition, Philippe Mathieu-Daudé, 2025/01/15