aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvi Kivity <avi@redhat.com>2009-07-28 20:52:11 +0300
committerAvi Kivity <avi@redhat.com>2009-07-28 20:52:11 +0300
commit47159e9b25e1d05b5cd591e295e97897c53a9f75 (patch)
tree1563bcfa1c3a76c5b2123f436582a59d5ee39240 /target-ppc
parentMerge commit '42bc608b2a144dfa5141dd6ba5d12cb97ac804a7' into upstream-merge (diff)
parentintroduce on_vcpu (diff)
downloadqemu-kvm-47159e9b25e1d05b5cd591e295e97897c53a9f75.tar.gz
qemu-kvm-47159e9b25e1d05b5cd591e295e97897c53a9f75.tar.bz2
qemu-kvm-47159e9b25e1d05b5cd591e295e97897c53a9f75.zip
Merge commit '452e475196a3f8b6b96d16bbaca727ebc1278a97' into upstream-merge
* commit '452e475196a3f8b6b96d16bbaca727ebc1278a97': (55 commits) introduce on_vcpu qemu-io: reject invalid pattern qemu-io: Rework alloc command qmu-img: fix qemu-img convert to generate a valid image when the source referenced a backing file vmdk: Fix backing file handling use struct initializer for audio.c Add save/restore support to the LSI logic SCSI device model. Handle BH's queued by AIO completions in qemu_aio_flush() Fake dirty loggin when it's not there Use correct input constant Fix warning in kvm-all.c Set PVR in sregs Enable PPC KVM for non-embedded Sparc32: convert Sun4c interrupt controller to qdev Sparc32: convert SBI to qdev Fix CONFIG_PROFILER Sparc32/64: use 64 bit type for memory size qdev: add 64 bit type Sparc64: refactor kernel init Sparc64: refactor CPU init ... Conflicts: kvm-all.c Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'target-ppc')
-rw-r--r--target-ppc/helper.c20
-rw-r--r--target-ppc/kvm.c18
2 files changed, 26 insertions, 12 deletions
diff --git a/target-ppc/helper.c b/target-ppc/helper.c
index 91bdaf3d1..6ffe9ce1c 100644
--- a/target-ppc/helper.c
+++ b/target-ppc/helper.c
@@ -559,18 +559,18 @@ static always_inline int get_bat (CPUState *env, mmu_ctx_t *ctx,
}
if (ret < 0) {
#if defined(DEBUG_BATS)
- if (IS_LOGGING) {
- QEMU_LOG0("no BAT match for " ADDRX ":\n", virtual);
+ if (qemu_log_enabled()) {
+ LOG_BATS("no BAT match for " ADDRX ":\n", virtual);
for (i = 0; i < 4; i++) {
BATu = &BATut[i];
BATl = &BATlt[i];
BEPIu = *BATu & 0xF0000000;
BEPIl = *BATu & 0x0FFE0000;
bl = (*BATu & 0x00001FFC) << 15;
- QEMU_LOG0("%s: %cBAT%d v " ADDRX " BATu " ADDRX
- " BATl " ADDRX " \n\t" ADDRX " " ADDRX " " ADDRX "\n",
- __func__, type == ACCESS_CODE ? 'I' : 'D', i, virtual,
- *BATu, *BATl, BEPIu, BEPIl, bl);
+ LOG_BATS("%s: %cBAT%d v " ADDRX " BATu " ADDRX
+ " BATl " ADDRX " \n\t" ADDRX " " ADDRX " " ADDRX "\n",
+ __func__, type == ACCESS_CODE ? 'I' : 'D', i, virtual,
+ *BATu, *BATl, BEPIu, BEPIl, bl);
}
}
#endif
@@ -861,8 +861,8 @@ void ppc_store_slb (CPUPPCState *env, target_ulong rb, target_ulong rs)
slb->tmp = (vsid << 8) | (flags << 3);
LOG_SLB("%s: %d " ADDRX " - " ADDRX " => %016" PRIx64
- " %08" PRIx32 "\n", __func__,
- slb_nr, rb, rs, tmp64, tmp);
+ " %08" PRIx32 "\n", __func__,
+ slb_nr, rb, rs, slb->tmp64, slb->tmp);
slb_set_entry(env, slb_nr, slb);
}
@@ -2446,7 +2446,7 @@ static always_inline void powerpc_excp (CPUState *env,
tlb_miss:
#if defined (DEBUG_SOFTWARE_TLB)
if (qemu_log_enabled()) {
- const unsigned char *es;
+ const char *es;
target_ulong *miss, *cmp;
int en;
if (excp == POWERPC_EXCP_IFTLB) {
@@ -2479,7 +2479,7 @@ static always_inline void powerpc_excp (CPUState *env,
tlb_miss_74xx:
#if defined (DEBUG_SOFTWARE_TLB)
if (qemu_log_enabled()) {
- const unsigned char *es;
+ const char *es;
target_ulong *miss, *cmp;
int en;
if (excp == POWERPC_EXCP_IFTLB) {
diff --git a/target-ppc/kvm.c b/target-ppc/kvm.c
index acbb1abd2..b53d6e99a 100644
--- a/target-ppc/kvm.c
+++ b/target-ppc/kvm.c
@@ -44,7 +44,13 @@ int kvm_arch_init(KVMState *s, int smp_cpus)
int kvm_arch_init_vcpu(CPUState *cenv)
{
- return 0;
+ int ret = 0;
+ struct kvm_sregs sregs;
+
+ sregs.pvr = cenv->spr[SPR_PVR];
+ ret = kvm_vcpu_ioctl(cenv, KVM_SET_SREGS, &sregs);
+
+ return ret;
}
int kvm_arch_put_registers(CPUState *env)
@@ -118,6 +124,14 @@ int kvm_arch_get_registers(CPUState *env)
return 0;
}
+#if defined(TARGET_PPCEMB)
+#define PPC_INPUT_INT PPC40x_INPUT_INT
+#elif defined(TARGET_PPC64)
+#define PPC_INPUT_INT PPC970_INPUT_INT
+#else
+#define PPC_INPUT_INT PPC6xx_INPUT_INT
+#endif
+
int kvm_arch_pre_run(CPUState *env, struct kvm_run *run)
{
int r;
@@ -127,7 +141,7 @@ int kvm_arch_pre_run(CPUState *env, struct kvm_run *run)
* interrupt, reset, etc) in PPC-specific env->irq_input_state. */
if (run->ready_for_interrupt_injection &&
(env->interrupt_request & CPU_INTERRUPT_HARD) &&
- (env->irq_input_state & (1<<PPC40x_INPUT_INT)))
+ (env->irq_input_state & (1<<PPC_INPUT_INT)))
{
/* For now KVM disregards the 'irq' argument. However, in the
* future KVM could cache it in-kernel to avoid a heavyweight exit