Re: [PATCH 13/38] KVM: PPC: booke: category E.HV (GS-mode) support

2012-03-05 Thread tiejun.chen
+/* + * Host interrupt handlers may have clobbered these guest-readable + * SPRGs, so we need to reload them here with the guest's values. + */ +lwz r3, VCPU_VRSAVE(r4) +lwz r5, VCPU_SHARED_SPRG4(r11) +mtspr SPRN_VRSAVE, r3 +lwz r6,

[PATCH] Restore guest CR after exit timing calculation

2012-03-05 Thread Bharat Bhushan
No instruction which can change Condition Register (CR) should be executed after Guest CR is loaded. So the guest CR is restored after the Exit Timing in lightweight_exit executes cmpw, which can clobber CR. Signed-off-by: Bharat Bhushan bharat.bhus...@freescale.com --- This patch is against

[PATCH] KVM: PPC: Save/Restore CR over vcpu_run

2012-03-05 Thread Alexander Graf
On PPC, CR2-CR4 are nonvolatile, thus have to be saved across function calls. We didn't respect that for any architecture until Paul spotted it in his patch for Book3S-HV. This patch saves/restores CR for all KVM capable PPC hosts. Signed-off-by: Alexander Graf ag...@suse.de ---

Re: [PATCH] KVM: PPC: check error return of kvmppc_core_vcpu_create first

2012-03-05 Thread Alexander Graf
On 02/21/2012 05:30 AM, Ben Collins wrote: The result of kvmppc_core_vcpu_create() was being manipulated before it was checked for IS_ERR(). Did not see the bug occur, but caught it when looking through the code. Nice catch, but this has already been fixed by Matt: commit

Re: [PATCH 1/4] KVM: PPC: Book3S HV: Save and restore CR in __kvmppc_vcore_entry

2012-03-05 Thread Alexander Graf
On 02/03/2012 11:53 AM, Paul Mackerras wrote: The ABI specifies that CR fields CR2--CR4 are nonvolatile across function calls. Currently __kvmppc_vcore_entry doesn't save and restore the CR, leading to CR2--CR4 getting corrupted with guest values, possibly leading to incorrect behaviour in its

Re: [PATCH] KVM: PPC: Book3s: PR: Add SPAPR H_BULK_REMOVE support

2012-03-05 Thread Alexander Graf
On 01/31/2012 07:25 AM, Matt Evans wrote: SPAPR support includes various in-kernel hypercalls, improving performance by cutting out the exit to userspace. H_BULK_REMOVE is implemented in this patch. Signed-off-by: Matt Evansm...@ozlabs.org Thanks, applied to kvm-ppc-next. Alex -- To

Emulating lwarx and stwcx instructions in PowerPc BOOKE e500

2012-03-05 Thread Aashish Mittal
Hi I'm working on powerpc booke architecture and my project requires me to remove read and write privileges on some pages. Due to this any instruction accessing these pages traps and i'm trying to emulate the behavior of these instructions. I've emulated lwarx and stwcx instruction but i think

Re: Emulating lwarx and stwcx instructions in PowerPc BOOKE e500

2012-03-05 Thread Scott Wood
On 03/05/2012 02:37 PM, Aashish Mittal wrote: Hi I'm working on powerpc booke architecture and my project requires me to remove read and write privileges on some pages. Due to this any instruction accessing these pages traps and i'm trying to emulate the behavior of these instructions.

Re: [PATCH] KVM: PPC: Save/Restore CR over vcpu_run

2012-03-05 Thread Scott Wood
On 03/05/2012 10:02 AM, Alexander Graf wrote: @@ -442,6 +444,7 @@ heavyweight_exit: /* Return to kvm_vcpu_run(). */ mtlrr5 + mtcrr6 addir1, r1, HOST_STACK_SIZE /* r3 still contains the return code from kvmppc_handle_exit(). */ blr @@ -459,6