public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux•vnet.ibm.com>
To: agraf@suse•de, benh@kernel•crashing.org, paulus@samba•org
Cc: linuxppc-dev@lists•ozlabs.org, kvm@vger•kernel.org,
	kvm-ppc@vger•kernel.org,
	"Aneesh Kumar K.V" <aneesh.kumar@linux•vnet.ibm.com>
Subject: [PATCH V6 1/2] KVM: PPC: BOOK3S: Always use the saved DAR value
Date: Mon, 12 May 2014 17:04:05 +0530	[thread overview]
Message-ID: <1399894447-11322-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com> (raw)

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

             reply	other threads:[~2014-05-12 11:34 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-12 11:34 Aneesh Kumar K.V [this message]
2014-05-12 11:34 ` [PATCH V6 2/2] KVM: PPC: BOOK3S: Remove open coded make_dsisr in alignment handler Aneesh Kumar K.V
2014-05-12 13:01 ` [PATCH V6 1/2] KVM: PPC: BOOK3S: Always use the saved DAR value Alexander Graf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1399894447-11322-1-git-send-email-aneesh.kumar@linux.vnet.ibm.com \
    --to=aneesh.kumar@linux$(echo .)vnet.ibm.com \
    --cc=agraf@suse$(echo .)de \
    --cc=benh@kernel$(echo .)crashing.org \
    --cc=kvm-ppc@vger$(echo .)kernel.org \
    --cc=kvm@vger$(echo .)kernel.org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=paulus@samba$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox