[PATCH 0/4] hw/arm/virt: Improve virt_kvm_type()

Gavin Shan posted 4 patches 3 months, 2 weeks ago
hw/arm/virt.c        | 22 +++++++++++-----------
target/arm/kvm.c     | 13 ++-----------
target/arm/kvm_arm.h | 15 ---------------
3 files changed, 13 insertions(+), 37 deletions(-)
[PATCH 0/4] hw/arm/virt: Improve virt_kvm_type()
Posted by Gavin Shan 3 months, 2 weeks ago
hw/arm/virt.c::virt_kvm_type() can be improved due to the facts as
below, when I inspect the code to review Salil's (RFCv3) vCPU hotplug
series.

  * virt_kvm_type() and MachineClass::kvm_type() are needed only when
    CONFIG_KVM is enabled.

  * kvm_arm_get_max_vm_ipa_size() and kvm_arch_get_default_type() are
    generally interchangeable with the exception that type zero is
    corresponding to IPA size (bits) 40. So it's unecessary to keep
    both APIs.

Lets clean it up so that kvm_arm_get_max_vm_ipa_size() is eventually
removed. kvm_arch_get_default_type() is used to get the KVM type and
IPA size (bits).

Gavin Shan (4):
  hw/arm/virt: hide virt_kvm_type() on !CONFIG_KVM
  hw/arm/virt: Avoid multiple lines of comments in virt_kvm_type()
  hw/arm/virt: Use kvm_arch_get_default_type()
  target/arm/kvm: Remove kvm_arm_get_max_vm_ipa_size()

 hw/arm/virt.c        | 22 +++++++++++-----------
 target/arm/kvm.c     | 13 ++-----------
 target/arm/kvm_arm.h | 15 ---------------
 3 files changed, 13 insertions(+), 37 deletions(-)

-- 
2.45.2