[PATCH 0/2] Clean up of target/i386/host-cpu.c

Xiaoyao Li posted 2 patches 4 months, 2 weeks ago
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/20250701075738.3451873-1-xiaoyao.li@intel.com
Maintainers: Paolo Bonzini <pbonzini@redhat.com>, Zhao Liu <zhao1.liu@intel.com>, Cameron Esfahani <dirty@apple.com>, Roman Bolshakov <rbolshakov@ddn.com>, Phil Dennis-Jordan <phil@philjordan.eu>, Marcelo Tosatti <mtosatti@redhat.com>
target/i386/host-cpu.c        | 21 +++++++++++++--------
target/i386/host-cpu.h        |  3 ++-
target/i386/hvf/hvf-cpu.c     |  5 ++++-
target/i386/kvm/kvm-cpu.c     |  4 ++--
target/i386/kvm/vmsr_energy.c |  9 ---------
target/i386/kvm/vmsr_energy.h |  1 -
6 files changed, 21 insertions(+), 22 deletions(-)
[PATCH 0/2] Clean up of target/i386/host-cpu.c
Posted by Xiaoyao Li 4 months, 2 weeks ago
Everytime I look at the flow of how x86 cpu is initialized, I get
confused by the name of host_cpu_instance_init() and
host_cpu_max_instance_init(). They look like related to "-cpu host" and
the .instance_init() callback of "-cpu host".

However, host_cpu_instance_init() even has noting to do with "-cpu
host". So patch 1, to rename host_cpu_instance_init(). I also want to
rename host_cpu_max_instance_init(), but I cannot think of a new better
name so I just leave it as-is.

Patch 2 is the cleanup found when I look at host-cpu.c

Note, this series is based on my another cleanup [1]. It might be able
to apply cleanly on master with [1].

[1] https://lore.kernel.org/qemu-devel/20250630080610.3151956-1-xiaoyao.li@intel.com/

Xiaoyao Li (2):
  i386/cpu: Rename host_cpu_instance_init() to apply_host_vendor()
  i386/cpu: Move the implementation of is_host_cpu_intel() host-cpu.c

 target/i386/host-cpu.c        | 21 +++++++++++++--------
 target/i386/host-cpu.h        |  3 ++-
 target/i386/hvf/hvf-cpu.c     |  5 ++++-
 target/i386/kvm/kvm-cpu.c     |  4 ++--
 target/i386/kvm/vmsr_energy.c |  9 ---------
 target/i386/kvm/vmsr_energy.h |  1 -
 6 files changed, 21 insertions(+), 22 deletions(-)

-- 
2.43.0
Re: [PATCH 0/2] Clean up of target/i386/host-cpu.c
Posted by Paolo Bonzini 4 months, 1 week ago
Queued patch 2, thanks.  I think the issue in patch 1 is also clarified
by merging host_cpu_instance_init() with host_cpu_max_instance_init().

Paolo