Skip to contentSkip to conversation

Fix KVM on PowerPC 440GP

PATCH In review [email protected] 5 participants 7 messages Aug 7, 2010 – Aug 17, 2010 2 messages not in the archive

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix KVM on PowerPC 440GP

Hi Avi, these patches make KVM run on 440GP (the only 440-based SoC that wasn't passing the compatibility check) and fix or enhance a couple very minor issues in related code. Please apply.

Alex, please ack.

-Hollis

#1 lore raw

PATCH 1/1 KVM: PPC: initialize IVORs in addition to IVPR

Developers can now tell at a glace the exact type of the premature interrupt, instead of just knowing that there was some premature interrupt.

---
 arch/powerpc/kvm/booke.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)
arch/powerpc/kvm/booke.c +6 -2
@@ -466,15 +466,19 @@ int kvmppc_handle_exit(struct kvm_run *r
 /* Initial guest state: 16MB mapping 0 -> 0, PC = 0, MSR = 0, R1 = 16MB */
 int kvm_arch_vcpu_setup(struct kvm_vcpu *vcpu)
 {
+	int i;
+
 	vcpu->arch.pc = 0;
 	vcpu->arch.msr = 0;
 	kvmppc_set_gpr(vcpu, 1, (16<<20) - 8); /* -8 for the callee-save LR slot */
 
 	vcpu->arch.shadow_pid = 1;
 
-	/* Eye-catching number so we know if the guest takes an interrupt
-	 * before it's programmed its own IVPR. */
+	/* Eye-catching numbers so we know if the guest takes an interrupt
+	 * before it's programmed its own IVPR/IVORs. */
 	vcpu->arch.ivpr = 0x55550000;
+	for (i = 0; i < BOOKE_IRQPRIO_MAX; i++)
+		vcpu->arch.ivor[i] = 0x7700 | i * 4;
 
 	kvmppc_init_timing_stats(vcpu);
 

A message that is not in the archive (sent off-list or not yet received): patchbomb.1281202435-bi+AKbBUZKagILUCTcTcHdKyNwTtLsGr@public.gmane.org

#3 lore raw

PATCH 1/1 KVM: PPC: fix compilation of "dump tlbs" debug function

Missing local variable.

---
 arch/powerpc/kvm/44x_tlb.c |  1 +
 1 files changed, 1 insertions(+), 0 deletions(-)
arch/powerpc/kvm/44x_tlb.c +1 -0
@@ -47,6 +47,7 @@
 #ifdef DEBUG
 void kvmppc_dump_tlbs(struct kvm_vcpu *vcpu)
 {
+	struct kvmppc_vcpu_44x *vcpu_44x = to_44x(vcpu);
 	struct kvmppc_44x_tlbe *tlbe;
 	int i;
 
#4 lore raw

PATCH 1/1 KVM: PPC: allow ppc440gp to pass the compatibility check

In reply to a message not in the archive

Match only the first part of cur_cpu_spec->platform.

440GP (the first 440 processor) is identified by the string "ppc440gp", while all later 440 processors use simply "ppc440".

---
 arch/powerpc/kvm/44x.c |  3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
arch/powerpc/kvm/44x.c +2 -1
@@ -43,7 +43,7 @@ int kvmppc_core_check_processor_compat(v
 {
 	int r;
 
-	if (strcmp(cur_cpu_spec->platform, "ppc440") == 0)
+	if (strncmp(cur_cpu_spec->platform, "ppc440", 6) == 0)
 		r = 0;
 	else
 		r = -ENOTSUPP;
@@ -72,6 +72,7 @@ int kvmppc_core_vcpu_setup(struct kvm_vc
 	/* Since the guest can directly access the timebase, it must know the
 	 * real timebase frequency. Accordingly, it must see the state of
 	 * CCR1[TCS]. */
+	/* XXX CCR1 doesn't exist on all 440 SoCs. */
 	vcpu->arch.ccr1 = mfspr(SPRN_CCR1);
 
 	for (i = 0; i < ARRAY_SIZE(vcpu_44x->shadow_refs); i++)
#5 lore raw
In reply to a message not in the archive
Quoted 3 lines · On 08/07/2010 08:33 PM, [email protected]…

Hi Avi, these patches make KVM run on 440GP (the only 440-based SoC that wasn't passing the compatibility check) and fix or enhance a couple very minor issues in related code. Please apply.

Patches don't apply (at least the first), please rebase.

Signature · 1 line
error compiling committee.c: too many arguments to function

A message that is not in the archive (sent off-list or not yet received): [email protected]

#7 lore raw
Quoted 6 lines · Avi Kivity
Quoted 3 lines · On 08/07/2010 08:33 PM, [email protected]…

Hi Avi, these patches make KVM run on 440GP (the only 440-based SoC that wasn't passing the compatibility check) and fix or enhance a couple very minor issues in related code. Please apply.

Patches don't apply (at least the first), please rebase.

I have a queue lying around locally anyways that I want to push today, so I'll just add them to it.

Alex