]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
hw/i386/x86: Remove X86MachineClass::save_tsc_khz field
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Mon, 12 May 2025 08:39:39 +0000 (10:39 +0200)
committerThomas Huth <thuth@redhat.com>
Fri, 30 May 2025 07:52:08 +0000 (09:52 +0200)
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>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Reviewed-by: Xiaoyao Li <xiaoyao.li@intel.com>
Message-ID: <20250512083948.39294-11-philmd@linaro.org>
Signed-off-by: Thomas Huth <thuth@redhat.com>
hw/i386/x86.c
include/hw/i386/x86.h
target/i386/machine.c

index e2d04092992d7f9db885beac21653727d9c04e38..f80533df1c54678d77d967e6088ac5c1db7841b8 100644 (file)
@@ -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;
 
index 258b1343a164a8e6d87c7c8fb3ec7ed418673e17..fc460b82f821f56ac492554ed71f441b9eac059a 100644 (file)
 #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: */
index 6cb561c6322905359770a6c4662576af5b6080c6..dd2dac1d443c89de837fa2c57dcd576d09b1d67b 100644 (file)
@@ -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 = {