kvm BookE and SPRGs

2009-07-10 Thread Benjamin Herrenschmidt
Hi Hollis ! I was roaming through kernel usage of SPRGs and noticed a small detail in kvmppc for BookE ... any reason why in OP_31_XOP_MTSPR, you open coded the emulation of SPRG0..3, but 4...7 are handled in kvmppc_core_emulate_mtspr() ? It occurs to me that in fact for both MTSPR and MFSPR,

Re: kvm BookE and SPRGs

2009-07-10 Thread Benjamin Herrenschmidt
On Fri, 2009-07-10 at 16:31 +1000, Benjamin Herrenschmidt wrote: I was roaming through kernel usage of SPRGs and noticed a small detail in kvmppc for BookE ... any reason why in OP_31_XOP_MTSPR, you open coded the emulation of SPRG0..3, but 4...7 are handled in kvmppc_core_emulate_mtspr() ?

Re: kvm BookE and SPRGs

2009-07-10 Thread Alexander Graf
Hi Ben, On 10.07.2009, at 10:10, Benjamin Herrenschmidt wrote: On Fri, 2009-07-10 at 16:31 +1000, Benjamin Herrenschmidt wrote: I was roaming through kernel usage of SPRGs and noticed a small detail in kvmppc for BookE ... any reason why in OP_31_XOP_MTSPR, you open coded the emulation of

Re: kvm BookE and SPRGs

2009-07-10 Thread Benjamin Herrenschmidt
On Fri, 2009-07-10 at 10:42 +0200, Alexander Graf wrote: IMHO paravirt stuff can be really useful, but should stay in the guest. I don't really like the idea of adding binary patching of guests in the hypervisor more than for dcbz where I didn't see another way to do it. I wasn't

RE: kvm BookE and SPRGs

2009-07-10 Thread Benjamin Herrenschmidt
On Fri, 2009-07-10 at 17:15 +0800, Liu Yu-B13201 wrote: Sounds reasonable. There are some old patchset which implemented the binary patch as Ben described. http://marc.info/?l=kvm-ppcm=122154653905212w=2 http://marc.info/?l=kvm-ppcm=122154657905306w=2 Interesting. Any reason why that

RE: kvm BookE and SPRGs

2009-07-10 Thread Benjamin Herrenschmidt
On Fri, 2009-07-10 at 19:17 +1000, Benjamin Herrenschmidt wrote: On Fri, 2009-07-10 at 17:15 +0800, Liu Yu-B13201 wrote: Sounds reasonable. There are some old patchset which implemented the binary patch as Ben described. http://marc.info/?l=kvm-ppcm=122154653905212w=2

Re: kvm BookE and SPRGs

2009-07-10 Thread Benjamin Herrenschmidt
On Fri, 2009-07-10 at 11:18 +0200, Alexander Graf wrote: The only problem I see is that the firmware lives in the high 4k, so we'd have to have some sort of enabling HV-call too. What firmware out of curiosity ? The treeboot thingy ? And yes, we definitely need an enabling HV call, ie, we

Re: kvm BookE and SPRGs

2009-07-10 Thread Alexander Graf
On 10.07.2009, at 11:39, Benjamin Herrenschmidt wrote: On Fri, 2009-07-10 at 11:18 +0200, Alexander Graf wrote: The only problem I see is that the firmware lives in the high 4k, so we'd have to have some sort of enabling HV-call too. What firmware out of curiosity ? The treeboot thingy ?

Re: kvm BookE and SPRGs

2009-07-10 Thread Benjamin Herrenschmidt
On Fri, 2009-07-10 at 11:39 +0200, Alexander Graf wrote: Oh so we could have the emulation code mapped into the guest and could just jump there from our trampline code, so all page faults and other fun traps still work. That'd be nice :-) We can put -some- code in there yes, but some

Re: kvm BookE and SPRGs

2009-07-10 Thread Benjamin Herrenschmidt
On Fri, 2009-07-10 at 11:43 +0200, Alexander Graf wrote: What firmware out of curiosity ? The treeboot thingy ? And yes, we definitely need an enabling HV call, ie, we stick to traps until it's On PPC32 openbios is somewhere up there. On PPC64 openbios stays where it was on PPC32, so it's

RE: kvm BookE and SPRGs

2009-07-10 Thread Hollis Blanchard
On Fri, 2009-07-10 at 19:17 +1000, Benjamin Herrenschmidt wrote: On Fri, 2009-07-10 at 17:15 +0800, Liu Yu-B13201 wrote: Sounds reasonable. There are some old patchset which implemented the binary patch as Ben described. http://marc.info/?l=kvm-ppcm=122154653905212w=2

Re: kvm BookE and SPRGs

2009-07-10 Thread Hollis Blanchard
On Fri, 2009-07-10 at 18:10 +1000, Benjamin Herrenschmidt wrote: On Fri, 2009-07-10 at 16:31 +1000, Benjamin Herrenschmidt wrote: I was roaming through kernel usage of SPRGs and noticed a small detail in kvmppc for BookE ... any reason why in OP_31_XOP_MTSPR, you open coded the emulation