[Qemu-devel] [PATCH 0/7] ppc: Get rid of some CONFIG_KVM guards

Greg Kurz posted 7 patches 4 years, 10 months ago
Test s390x passed
Test checkpatch passed
Test asan passed
Test docker-mingw@fedora passed
Test docker-clang@ubuntu passed
Test FreeBSD passed
Patches applied successfully (tree, apply log)
git fetch https://github.com/patchew-project/qemu tags/patchew/156051052402.224162.13664250996245267046.stgit@bahia.lan
Maintainers: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, "Hervé Poussineau" <hpoussin@reactos.org>, David Gibson <david@gibson.dropbear.id.au>
hw/ppc/mac_newworld.c |    4 ----
hw/ppc/mac_oldworld.c |    2 --
hw/ppc/ppc.c          |    7 +------
hw/ppc/prep.c         |    2 --
hw/ppc/spapr_pci.c    |    2 --
target/ppc/kvm.c      |    9 +++++++++
target/ppc/kvm_ppc.h  |   10 ++++++++++
target/ppc/machine.c  |    2 --
8 files changed, 20 insertions(+), 18 deletions(-)
[Qemu-devel] [PATCH 0/7] ppc: Get rid of some CONFIG_KVM guards
Posted by Greg Kurz 4 years, 10 months ago
There are several places where CONFIG_KVM is used to guard code that
should only be built when KVM is supported. It is generally preferable
to avoid that and leave such guards in header files for improved
readability.

In many cases, the execution of the code is also conditionned by
kvm_enabled() which expands to (0) when CONFIG_KVM is not defined.
This is likely to cause the compiler to optimize the code out,
and if it doesn't, the right way to address compiling issues is
to add stubs.

Successfuly compile tested on x86_64 and ppc64le linux. Travis shows
this builds fine on OSX as well.

--
Greg

---

Greg Kurz (7):
      spapr_pci: Drop useless CONFIG_KVM ifdefery
      hw/ppc/mac_oldworld: Drop useless CONFIG_KVM ifdefery
      hw/ppc/mac_newworld: Drop useless CONFIG_KVM ifdefery
      hw/ppc/prep: Drop useless CONFIG_KVM ifdefery
      hw/ppc: Drop useless CONFIG_KVM ifdefery
      ppc: Introduce kvmppc_set_reg_tb_offset() helper
      target/ppc/machine: Add kvmppc_pvr_workaround_required() stub


 hw/ppc/mac_newworld.c |    4 ----
 hw/ppc/mac_oldworld.c |    2 --
 hw/ppc/ppc.c          |    7 +------
 hw/ppc/prep.c         |    2 --
 hw/ppc/spapr_pci.c    |    2 --
 target/ppc/kvm.c      |    9 +++++++++
 target/ppc/kvm_ppc.h  |   10 ++++++++++
 target/ppc/machine.c  |    2 --
 8 files changed, 20 insertions(+), 18 deletions(-)


Re: [Qemu-devel] [PATCH 0/7] ppc: Get rid of some CONFIG_KVM guards
Posted by David Gibson 4 years, 10 months ago
On Fri, Jun 14, 2019 at 01:08:44PM +0200, Greg Kurz wrote:
> There are several places where CONFIG_KVM is used to guard code that
> should only be built when KVM is supported. It is generally preferable
> to avoid that and leave such guards in header files for improved
> readability.
> 
> In many cases, the execution of the code is also conditionned by
> kvm_enabled() which expands to (0) when CONFIG_KVM is not defined.
> This is likely to cause the compiler to optimize the code out,
> and if it doesn't, the right way to address compiling issues is
> to add stubs.
> 
> Successfuly compile tested on x86_64 and ppc64le linux. Travis shows
> this builds fine on OSX as well.

1..5 applied.  Still need to look at 6..7 more closely.

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson