Re: kvm book3s issues

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




On 10.11.2009, at 08:20, Benjamin Herrenschmidt wrote:

Hi Alex !

After a bit of digging as to why the karmic installer dies, I found out
that you don't set the right SRR1 bits when forwarding a program check
exception to the guest.

Cool, thanks for trying things out and debugging them! :-)

I also did a couple of minor fixups (though the s/mtmsr/mtmsrd may not
be necessary, I think the clearing of HID5 is). Patch below, haven't had
a chance to clean it up into a proper submission yet.

I didn't go very much further yet with the karmic graphical installer,
but that isn't a surprise. I'll try the text one as soon as I get to d/l
the alternate ISO.

Cheers,
Ben.

diff --git a/arch/powerpc/kvm/book3s.c b/arch/powerpc/kvm/book3s.c
index 42037d4..a094ca9 100644
--- a/arch/powerpc/kvm/book3s.c
+++ b/arch/powerpc/kvm/book3s.c
@@ -627,6 +627,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
#endif
			if ((vcpu->arch.last_inst & 0xff0007ff) !=
			    (INS_DCBZ & 0xfffffff7)) {
+				vcpu->arch.msr |= (vcpu->arch.shadow_msr & 0x1f0000ull);

What bits are those? It might be good to use real #define's here :-).

				kvmppc_book3s_queue_irqprio(vcpu, exit_nr);
				r = RESUME_GUEST;
				break;
@@ -642,6 +643,7 @@ int kvmppc_handle_exit(struct kvm_run *run, struct kvm_vcpu *vcpu,
		case EMULATE_FAIL:
			printk(KERN_CRIT "%s: emulation at %lx failed (%08x)\n",
			       __func__, vcpu->arch.pc, vcpu->arch.last_inst);
+			vcpu->arch.msr |= (vcpu->arch.shadow_msr & 0x1f0000ull);
			kvmppc_book3s_queue_irqprio(vcpu, exit_nr);
			r = RESUME_GUEST;
			break;
diff --git a/arch/powerpc/kvm/book3s_64_interrupts.S b/arch/powerpc/ kvm/book3s_64_interrupts.S
index 7b55d80..22f2962 100644
--- a/arch/powerpc/kvm/book3s_64_interrupts.S
+++ b/arch/powerpc/kvm/book3s_64_interrupts.S
@@ -241,8 +241,9 @@ kvmppc_handler_highmem:
	rldicl.	r5, r5, 0, 63		/* CR = ((r5 & 1) == 0) */
	beq	no_dcbz32_off

+	li	r4,0
	mfspr   r5,SPRN_HID5
-	rldimi  r5,r5,6,56
+	rldimi  r5,r4,6,56

When you're on a G5 you never get into this code path, right? You're using the dcbz binary patched emulation instead.

So what you do is you replace

HID5 &= ~DCBZ32;

with

HID5 = 0;

Is that intentional?

	mtspr   SPRN_HID5,r5

no_dcbz32_off:
diff --git a/arch/powerpc/kvm/book3s_64_slb.S b/arch/powerpc/kvm/ book3s_64_slb.S
index ecd237a..c574cf7 100644
--- a/arch/powerpc/kvm/book3s_64_slb.S
+++ b/arch/powerpc/kvm/book3s_64_slb.S
@@ -205,11 +205,11 @@ ld_last_inst:
	/*    1) enable paging for data */
	mfmsr	r9
	ori	r11, r9, MSR_DR			/* Enable paging for data */
-	mtmsr	r11
+	mtmsrd	r11

Wasn't mtmsrd this extra cool new version that takes a second argument so one can only set IF?


Alex
--
To unsubscribe from this list: send the line "unsubscribe kvm-ppc" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [KVM Development]     [KVM ARM]     [KVM ia64]     [Linux Virtualization]     [Linux USB Devel]     [Linux Video]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux