[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH 3/7] hw/ppc/mac_newworld: Drop useless CONFIG_KVM ifde
From: |
Greg Kurz |
Subject: |
[Qemu-ppc] [PATCH 3/7] hw/ppc/mac_newworld: Drop useless CONFIG_KVM ifdefery |
Date: |
Fri, 14 Jun 2019 13:09:00 +0200 |
User-agent: |
StGit/unknown-version |
kvm_enabled() expands to (0) when CONFIG_KVM is not defined. The first
CONFIG_KVM guard is thus useless and it is likely that the compiler
will optimize the code out in the case of the second guard. And even
if it doesn't, we have a stub for kvmppc_get_hypercall().
Signed-off-by: Greg Kurz <address@hidden>
---
hw/ppc/mac_newworld.c | 4 ----
1 file changed, 4 deletions(-)
diff --git a/hw/ppc/mac_newworld.c b/hw/ppc/mac_newworld.c
index 4d835f32b536..c8d324552470 100644
--- a/hw/ppc/mac_newworld.c
+++ b/hw/ppc/mac_newworld.c
@@ -437,13 +437,11 @@ static void ppc_core99_init(MachineState *machine)
}
/* The NewWorld NVRAM is not located in the MacIO device */
-#ifdef CONFIG_KVM
if (kvm_enabled() && getpagesize() > 4096) {
/* We can't combine read-write and read-only in a single page, so
move the NVRAM out of ROM again for KVM */
nvram_addr = 0xFFE00000;
}
-#endif
dev = qdev_create(NULL, TYPE_MACIO_NVRAM);
qdev_prop_set_uint32(dev, "size", 0x2000);
qdev_prop_set_uint32(dev, "it_shift", 1);
@@ -488,14 +486,12 @@ static void ppc_core99_init(MachineState *machine)
fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_IS_KVM, kvm_enabled());
if (kvm_enabled()) {
-#ifdef CONFIG_KVM
uint8_t *hypercall;
hypercall = g_malloc(16);
kvmppc_get_hypercall(env, hypercall, 16);
fw_cfg_add_bytes(fw_cfg, FW_CFG_PPC_KVM_HC, hypercall, 16);
fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_KVM_PID, getpid());
-#endif
}
fw_cfg_add_i32(fw_cfg, FW_CFG_PPC_TBFREQ, tbfreq);
/* Mac OS X requires a "known good" clock-frequency value; pass it one. */
- [Qemu-ppc] [PATCH 0/7] ppc: Get rid of some CONFIG_KVM guards, Greg Kurz, 2019/06/14
- [Qemu-ppc] [PATCH 7/7] target/ppc/machine: Add kvmppc_pvr_workaround_required() stub, Greg Kurz, 2019/06/14
- [Qemu-ppc] [PATCH 6/7] ppc: Introduce kvmppc_set_reg_tb_offset() helper, Greg Kurz, 2019/06/14
- [Qemu-ppc] [PATCH 5/7] hw/ppc: Drop useless CONFIG_KVM ifdefery, Greg Kurz, 2019/06/14
- [Qemu-ppc] [PATCH 3/7] hw/ppc/mac_newworld: Drop useless CONFIG_KVM ifdefery,
Greg Kurz <=
- [Qemu-ppc] [PATCH 1/7] spapr_pci: Drop useless CONFIG_KVM ifdefery, Greg Kurz, 2019/06/14
- [Qemu-ppc] [PATCH 2/7] hw/ppc/mac_oldworld: Drop useless CONFIG_KVM ifdefery, Greg Kurz, 2019/06/14
- [Qemu-ppc] [PATCH 4/7] hw/ppc/prep: Drop useless CONFIG_KVM ifdefery, Greg Kurz, 2019/06/14
- Re: [Qemu-ppc] [PATCH 0/7] ppc: Get rid of some CONFIG_KVM guards, David Gibson, 2019/06/19