public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: James Hogan <james.hogan@imgtec.com>
To: Paolo Bonzini <pbonzini@redhat.com>, Ralf Baechle <ralf@linux-mips.org>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>,
	"Paul Burton" <paul.burton@imgtec.com>,
	"James Hogan" <james.hogan@imgtec.com>,
	linux-mips@linux-mips.org, kvm@vger.kernel.org
Subject: [PATCH 4/9] MIPS: KVM: Fix pre-r6 ll/sc instructions on r6
Date: Mon, 4 Jul 2016 19:35:10 +0100	[thread overview]
Message-ID: <1467657315-19975-5-git-send-email-james.hogan@imgtec.com> (raw)
In-Reply-To: <1467657315-19975-1-git-send-email-james.hogan@imgtec.com>

The atomic KVM register access macros in kvm_host.h (for the guest Cause
register with KVM in trap & emulate mode) use ll/sc instructions,
however they still .set mips3, which causes pre-MIPSr6 instruction
encodings to be emitted, even for a MIPSr6 build.

Fix it to use MIPS_ISA_ARCH_LEVEL as other parts of arch/mips already
do.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Radim Krčmář <rkrcmar@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
---
 arch/mips/include/asm/kvm_host.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/arch/mips/include/asm/kvm_host.h b/arch/mips/include/asm/kvm_host.h
index b32785543787..b54bcadd8aec 100644
--- a/arch/mips/include/asm/kvm_host.h
+++ b/arch/mips/include/asm/kvm_host.h
@@ -400,7 +400,7 @@ static inline void _kvm_atomic_set_c0_guest_reg(unsigned long *reg,
 	unsigned long temp;
 	do {
 		__asm__ __volatile__(
-		"	.set	mips3				\n"
+		"	.set	"MIPS_ISA_ARCH_LEVEL"		\n"
 		"	" __LL "%0, %1				\n"
 		"	or	%0, %2				\n"
 		"	" __SC	"%0, %1				\n"
@@ -416,7 +416,7 @@ static inline void _kvm_atomic_clear_c0_guest_reg(unsigned long *reg,
 	unsigned long temp;
 	do {
 		__asm__ __volatile__(
-		"	.set	mips3				\n"
+		"	.set	"MIPS_ISA_ARCH_LEVEL"		\n"
 		"	" __LL "%0, %1				\n"
 		"	and	%0, %2				\n"
 		"	" __SC	"%0, %1				\n"
@@ -433,7 +433,7 @@ static inline void _kvm_atomic_change_c0_guest_reg(unsigned long *reg,
 	unsigned long temp;
 	do {
 		__asm__ __volatile__(
-		"	.set	mips3				\n"
+		"	.set	"MIPS_ISA_ARCH_LEVEL"		\n"
 		"	" __LL "%0, %1				\n"
 		"	and	%0, %2				\n"
 		"	or	%0, %3				\n"
-- 
2.4.10


  parent reply	other threads:[~2016-07-04 18:35 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-07-04 18:35 [PATCH 0/9] MIPS: KVM: MIPS r6 support James Hogan
2016-07-04 18:35 ` [PATCH 3/9] MIPS: KVM: Fix fpu.S misassembly with r6 James Hogan
2016-07-04 18:35 ` James Hogan [this message]
2016-07-04 18:35 ` [PATCH 5/9] MIPS: KVM: Don't save/restore lo/hi for r6 James Hogan
2016-07-04 18:35 ` [PATCH 6/9] MIPS: KVM: Support r6 compact branch emulation James Hogan
2016-07-04 18:35 ` [PATCH 7/9] MIPS: KVM: Recognise r6 CACHE encoding James Hogan
2016-07-04 18:35 ` [PATCH 8/9] MIPS: KVM: Decode RDHWR more strictly James Hogan
2016-07-05 11:16   ` Sergei Shtylyov
2016-07-05 12:39     ` Paolo Bonzini
2016-07-05 14:34       ` Sergei Shtylyov
2016-07-05 12:51     ` Ralf Baechle
2016-07-04 18:35 ` [PATCH 9/9] MIPS: KVM: Emulate generic QEMU machine on r6 T&E James Hogan
2016-07-05 13:58 ` [PATCH 0/9] MIPS: KVM: MIPS r6 support Ralf Baechle

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=1467657315-19975-5-git-send-email-james.hogan@imgtec.com \
    --to=james.hogan@imgtec.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-mips@linux-mips.org \
    --cc=paul.burton@imgtec.com \
    --cc=pbonzini@redhat.com \
    --cc=ralf@linux-mips.org \
    --cc=rkrcmar@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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