[PATCH V6 1/2] KVM: PPC: BOOK3S: Always use the saved DAR value

2014-05-12 Thread Aneesh Kumar K.V
Although it's optional, IBM POWER cpus always had DAR value set on
alignment interrupt. So don't try to compute these values.

Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com
---
Changes from V5:
* Split the patch to two and also update commit message

 arch/powerpc/kvm/book3s_emulate.c | 7 +++
 1 file changed, 7 insertions(+)

diff --git a/arch/powerpc/kvm/book3s_emulate.c 
b/arch/powerpc/kvm/book3s_emulate.c
index 99d40f8977e8..5d0f71663b99 100644
--- a/arch/powerpc/kvm/book3s_emulate.c
+++ b/arch/powerpc/kvm/book3s_emulate.c
@@ -611,6 +611,12 @@ u32 kvmppc_alignment_dsisr(struct kvm_vcpu *vcpu, unsigned 
int inst)
 
 ulong kvmppc_alignment_dar(struct kvm_vcpu *vcpu, unsigned int inst)
 {
+#ifdef CONFIG_PPC_BOOK3S_64
+   /*
+* Linux's fix_alignment() assumes that DAR is valid, so can we
+*/
+   return vcpu-arch.fault_dar;
+#else
ulong dar = 0;
ulong ra = get_ra(inst);
ulong rb = get_rb(inst);
@@ -635,4 +641,5 @@ ulong kvmppc_alignment_dar(struct kvm_vcpu *vcpu, unsigned 
int inst)
}
 
return dar;
+#endif
 }
-- 
1.9.1

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev

Re: [PATCH V6 1/2] KVM: PPC: BOOK3S: Always use the saved DAR value

2014-05-12 Thread Alexander Graf


On 12.05.14 13:34, Aneesh Kumar K.V wrote:

Although it's optional, IBM POWER cpus always had DAR value set on
alignment interrupt. So don't try to compute these values.

Signed-off-by: Aneesh Kumar K.V aneesh.ku...@linux.vnet.ibm.com


Thanks, applied both to kvm-ppc-queue.


Alex

___
Linuxppc-dev mailing list
Linuxppc-dev@lists.ozlabs.org
https://lists.ozlabs.org/listinfo/linuxppc-dev