]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
i386/cpu: Move the implementation of is_host_cpu_intel() host-cpu.c
authorXiaoyao Li <xiaoyao.li@intel.com>
Tue, 1 Jul 2025 07:57:38 +0000 (15:57 +0800)
committerPaolo Bonzini <pbonzini@redhat.com>
Sat, 12 Jul 2025 13:28:21 +0000 (15:28 +0200)
It's more proper to put is_host_cpu_intel() in host-cpu.c instead of
vmsr_energy.c.

Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Link: https://lore.kernel.org/r/20250701075738.3451873-3-xiaoyao.li@intel.com
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
target/i386/host-cpu.c
target/i386/host-cpu.h
target/i386/kvm/vmsr_energy.c
target/i386/kvm/vmsr_energy.h

index 3399edc1ad0c49e6f30461f0ebaae12e10450ee8..e9a49e628f8961f781cdb54b4668b0ea8cb1d9aa 100644 (file)
@@ -161,6 +161,15 @@ void host_cpu_instance_init(X86CPU *cpu)
                             &error_abort);
 }
 
+bool is_host_cpu_intel(void)
+{
+    char vendor[CPUID_VENDOR_SZ + 1];
+
+    host_cpu_vendor_fms(vendor, NULL, NULL, NULL);
+
+    return g_str_equal(vendor, CPUID_VENDOR_INTEL);
+}
+
 static void host_cpu_class_init(ObjectClass *oc, const void *data)
 {
     X86CPUClass *xcc = X86_CPU_CLASS(oc);
index b97ec01c9bec99524d9d183595cdc7499d0b1c63..10df4b3a3a748a1c683fd4c965f658c1ee413f00 100644 (file)
@@ -17,4 +17,5 @@ bool host_cpu_realizefn(CPUState *cs, Error **errp);
 
 void host_cpu_vendor_fms(char *vendor, int *family, int *model, int *stepping);
 
+bool is_host_cpu_intel(void);
 #endif /* HOST_CPU_H */
index d6aad5246b66b4bd15466a0dd10ad1044c33d2a0..58ce3df53a3e326a1e47428cd2df04bb3eb01a66 100644 (file)
@@ -27,15 +27,6 @@ char *vmsr_compute_default_paths(void)
     return g_build_filename(state, "run", "qemu-vmsr-helper.sock", NULL);
 }
 
-bool is_host_cpu_intel(void)
-{
-    char vendor[CPUID_VENDOR_SZ + 1];
-
-    host_cpu_vendor_fms(vendor, NULL, NULL, NULL);
-
-    return g_str_equal(vendor, CPUID_VENDOR_INTEL);
-}
-
 int is_rapl_enabled(void)
 {
     const char *path = "/sys/class/powercap/intel-rapl/enabled";
index 16cc1f4814f6951a85f54d66611d9607753602f8..151bcbd64239f24b1ea9767ce58125c316ba468b 100644 (file)
@@ -94,6 +94,5 @@ double vmsr_get_ratio(uint64_t e_delta,
                       unsigned long long delta_ticks,
                       unsigned int maxticks);
 void vmsr_init_topo_info(X86CPUTopoInfo *topo_info, const MachineState *ms);
-bool is_host_cpu_intel(void);
 int is_rapl_enabled(void);
 #endif /* VMSR_ENERGY_H */