linux-mips
[Top] [All Lists]

[PATCH v3 2/5] mips/kvm: Fix ABI for use of 64-bit registers.

To: linux-mips@linux-mips.org, ralf@linux-mips.org, kvm@vger.kernel.org, Sanjay Lal <sanjayl@kymasys.com>
Subject: [PATCH v3 2/5] mips/kvm: Fix ABI for use of 64-bit registers.
From: David Daney <ddaney.cavm@gmail.com>
Date: Mon, 20 May 2013 14:01:23 -0700
Cc: linux-kernel@vger.kernel.org, David Daney <david.daney@cavium.com>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:from:to:cc:subject:date:message-id:x-mailer:in-reply-to :references; bh=LcX/8NieWEnH8Pi2mGMtZ4MKTZnFoS2kiqPdCX9bNyg=; b=opkDqwibdP46iIYzMTkB7z/Xws1/AG2/lHuo74JICitr9f5cg/mgqfbbWDQHFJYG6V n4UB1/zmyTyxLr+tKPGJcyxLuSi/QJbl99l/pZCvLUUMD5J47cCDCzuZncZiCCsWqVnH z0svQok1y07bcr8srJSwZ3FH1Oi52vOtJuZNx9pQrQDlUOjnc4zefgi74u86quy0TuHv K1SfbTk652yiYkhCTrahfh3YRWqF/b0vFJ2PwRaWyLKiySn9lsJQPWUDFEfz0pSiSn4K y2xgHXWB/pJ8YUSQQO90NYumR7kGm7nH1/mF/SfeQ0TitkYNHH4pF3QrUNWuRs5XCRTN 9rLg==
In-reply-to: <1369083686-27524-1-git-send-email-ddaney.cavm@gmail.com>
List-archive: <http://www.linux-mips.org/archives/linux-mips/>
List-help: <mailto:ecartis@linux-mips.org?Subject=help>
List-id: linux-mips <linux-mips.eddie.linux-mips.org>
List-owner: <mailto:ralf@linux-mips.org>
List-post: <mailto:linux-mips@linux-mips.org>
List-software: Ecartis version 1.0.0
List-subscribe: <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips>
List-unsubscribe: <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <1369083686-27524-1-git-send-email-ddaney.cavm@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
From: David Daney <david.daney@cavium.com>

All registers are 64-bits wide, 32-bit guests use the least
significant portion of the register storage fields.

Signed-off-by: David Daney <david.daney@cavium.com>
---
 arch/mips/include/asm/kvm.h | 16 +++++++++++-----
 1 file changed, 11 insertions(+), 5 deletions(-)

diff --git a/arch/mips/include/asm/kvm.h b/arch/mips/include/asm/kvm.h
index 0e8f565..86812fb 100644
--- a/arch/mips/include/asm/kvm.h
+++ b/arch/mips/include/asm/kvm.h
@@ -18,12 +18,18 @@
 #define N_MIPS_COPROC_REGS      32
 #define N_MIPS_COPROC_SEL      8
 
-/* for KVM_GET_REGS and KVM_SET_REGS */
+/*
+ * for KVM_GET_REGS and KVM_SET_REGS
+ *
+ * If Config[AT] is zero (32-bit CPU), the register contents are
+ * stored in the lower 32-bits of the struct kvm_regs fields and sign
+ * extended to 64-bits.
+ */
 struct kvm_regs {
-       __u32 gprs[32];
-       __u32 hi;
-       __u32 lo;
-       __u32 pc;
+       __u64 gprs[32];
+       __u64 hi;
+       __u64 lo;
+       __u64 pc;
 
        __u32 cp0reg[N_MIPS_COPROC_REGS][N_MIPS_COPROC_SEL];
 };
-- 
1.7.11.7


<Prev in Thread] Current Thread [Next in Thread>