summaryrefslogtreecommitdiffstats
path: root/target-ppc
diff options
context:
space:
mode:
Diffstat (limited to 'target-ppc')
-rw-r--r--target-ppc/cpu.h12
-rw-r--r--target-ppc/exec.h12
-rw-r--r--target-ppc/helper.c1
-rw-r--r--target-ppc/kvm.c23
-rw-r--r--target-ppc/op_helper.c2
-rw-r--r--target-ppc/translate.c1
6 files changed, 13 insertions, 38 deletions
diff --git a/target-ppc/cpu.h b/target-ppc/cpu.h
index 46d86be..84f8ff6 100644
--- a/target-ppc/cpu.h
+++ b/target-ppc/cpu.h
@@ -2018,4 +2018,16 @@ static inline ppcmas_tlb_t *booke206_get_tlbm(CPUState *env, const int tlbn,
extern void (*cpu_ppc_hypercall)(CPUState *);
+static inline bool cpu_has_work(CPUState *env)
+{
+ return msr_ee && (env->interrupt_request & CPU_INTERRUPT_HARD);
+}
+
+#include "exec-all.h"
+
+static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
+{
+ env->nip = tb->pc;
+}
+
#endif /* !defined (__CPU_PPC_H__) */
diff --git a/target-ppc/exec.h b/target-ppc/exec.h
index f87847a..f4453e4 100644
--- a/target-ppc/exec.h
+++ b/target-ppc/exec.h
@@ -24,7 +24,6 @@
#include "dyngen-exec.h"
#include "cpu.h"
-#include "exec-all.h"
register struct CPUPPCState *env asm(AREG0);
@@ -32,15 +31,4 @@ register struct CPUPPCState *env asm(AREG0);
#include "softmmu_exec.h"
#endif /* !defined(CONFIG_USER_ONLY) */
-static inline int cpu_has_work(CPUState *env)
-{
- return (msr_ee && (env->interrupt_request & CPU_INTERRUPT_HARD));
-}
-
-
-static inline void cpu_pc_from_tb(CPUState *env, TranslationBlock *tb)
-{
- env->nip = tb->pc;
-}
-
#endif /* !defined (__PPC_H__) */
diff --git a/target-ppc/helper.c b/target-ppc/helper.c
index 3884976..176128a 100644
--- a/target-ppc/helper.c
+++ b/target-ppc/helper.c
@@ -23,7 +23,6 @@
#include <inttypes.h>
#include "cpu.h"
-#include "exec-all.h"
#include "helper_regs.h"
#include "qemu-common.h"
#include "kvm.h"
diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
index e7b1b10..21f35af7 100644
--- a/target-ppc/kvm.c
+++ b/target-ppc/kvm.c
@@ -65,18 +65,10 @@ static void kvm_kick_env(void *env)
int kvm_arch_init(KVMState *s)
{
-#ifdef KVM_CAP_PPC_UNSET_IRQ
cap_interrupt_unset = kvm_check_extension(s, KVM_CAP_PPC_UNSET_IRQ);
-#endif
-#ifdef KVM_CAP_PPC_IRQ_LEVEL
cap_interrupt_level = kvm_check_extension(s, KVM_CAP_PPC_IRQ_LEVEL);
-#endif
-#ifdef KVM_CAP_PPC_SEGSTATE
cap_segstate = kvm_check_extension(s, KVM_CAP_PPC_SEGSTATE);
-#endif
-#ifdef KVM_CAP_PPC_BOOKE_SREGS
cap_booke_sregs = kvm_check_extension(s, KVM_CAP_PPC_BOOKE_SREGS);
-#endif
if (!cap_interrupt_level) {
fprintf(stderr, "KVM: Couldn't find level irq capability. Expect the "
@@ -104,21 +96,12 @@ static int kvm_arch_sync_sregs(CPUState *cenv)
}
}
-#if !defined(CONFIG_KVM_PPC_PVR)
- if (1) {
- fprintf(stderr, "kvm error: missing PVR setting capability\n");
- return -ENOSYS;
- }
-#endif
-
ret = kvm_vcpu_ioctl(cenv, KVM_GET_SREGS, &sregs);
if (ret) {
return ret;
}
-#ifdef CONFIG_KVM_PPC_PVR
sregs.pvr = cenv->spr[SPR_PVR];
-#endif
return kvm_vcpu_ioctl(cenv, KVM_SET_SREGS, &sregs);
}
@@ -226,7 +209,6 @@ int kvm_arch_get_registers(CPUState *env)
return ret;
}
-#ifdef KVM_CAP_PPC_BOOKE_SREGS
if (sregs.u.e.features & KVM_SREGS_E_BASE) {
env->spr[SPR_BOOKE_CSRR0] = sregs.u.e.csrr0;
env->spr[SPR_BOOKE_CSRR1] = sregs.u.e.csrr1;
@@ -323,7 +305,6 @@ int kvm_arch_get_registers(CPUState *env)
env->spr[SPR_BOOKE_PID2] = sregs.u.e.impl.fsl.pid2;
}
}
-#endif
}
if (cap_segstate) {
@@ -332,7 +313,6 @@ int kvm_arch_get_registers(CPUState *env)
return ret;
}
-#ifdef KVM_CAP_PPC_SEGSTATE
ppc_store_sdr1(env, sregs.u.s.sdr1);
/* Sync SLB */
@@ -355,7 +335,6 @@ int kvm_arch_get_registers(CPUState *env)
env->IBAT[0][i] = sregs.u.s.ppc32.ibat[i] & 0xffffffff;
env->IBAT[1][i] = sregs.u.s.ppc32.ibat[i] >> 32;
}
-#endif
}
return 0;
@@ -534,7 +513,6 @@ int kvmppc_get_hypercall(CPUState *env, uint8_t *buf, int buf_len)
{
uint32_t *hc = (uint32_t*)buf;
-#ifdef KVM_CAP_PPC_GET_PVINFO
struct kvm_ppc_pvinfo pvinfo;
if (kvm_check_extension(env->kvm_state, KVM_CAP_PPC_GET_PVINFO) &&
@@ -543,7 +521,6 @@ int kvmppc_get_hypercall(CPUState *env, uint8_t *buf, int buf_len)
return 0;
}
-#endif
/*
* Fallback to always fail hypercalls:
diff --git a/target-ppc/op_helper.c b/target-ppc/op_helper.c
index 82b6651..dde7595 100644
--- a/target-ppc/op_helper.c
+++ b/target-ppc/op_helper.c
@@ -44,7 +44,7 @@ void helper_raise_exception_err (uint32_t exception, uint32_t error_code)
#endif
env->exception_index = exception;
env->error_code = error_code;
- cpu_loop_exit();
+ cpu_loop_exit(env);
}
void helper_raise_exception (uint32_t exception)
diff --git a/target-ppc/translate.c b/target-ppc/translate.c
index 7e318e3..fd7c208 100644
--- a/target-ppc/translate.c
+++ b/target-ppc/translate.c
@@ -24,7 +24,6 @@
#include <inttypes.h>
#include "cpu.h"
-#include "exec-all.h"
#include "disas.h"
#include "tcg-op.h"
#include "qemu-common.h"
OpenPOWER on IntegriCloud