Re: kvm book3s issues

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

 



On Tue, 2009-11-10 at 11:50 +0100, Alexander Graf wrote:

> > 			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 :-).

They are some of those SRR1 bits that don't match MSR bits, used to
convey informations on program check and machine check. I think the only
#define we have for them are actually deep inside traps.c.

> > 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.

Why ? The G5 is a 970 which supports HID5 and has no hypervisor to get
in the way so it works fine with the dcbz hack (I added printks to
verify it was enabled).

> So what you do is you replace
> 
> HID5 &= ~DCBZ32;
> 
> with
> 
> HID5 = 0;

No. What I do is replace

	HID5 = (HID5 & ~0xc0) | ((HID5 & 0x3) << 6)

with

	HID5 = (HID5 & ~0xc0)

At least that's my understanding :-)

> 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?

Extra argument is optional in the asm but yeah. Though I think mtmsr
also takes it (the L bit basically). No, the difference is that mtmsrd
can write all 64-bit of the MSR while mtmsr only the low 32-bit. Now in
your case that's fine, both would work, I just did that change as a
reflex :-) (Ie. mtmsr will preserve the top 32-bit of the MSR anyway)

Note: The karmic installer still goes bonkers a bit later, I don't know
why yet (works without -enable-kvm). I need to run it without it's
"quiet" thingy so I can see what's happening :-)

Cheers,
Ben.

> 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