linux-mips
[Top] [All Lists]

[PATCH v4 2/6] 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>, Gleb Natapov <gleb@redhat.com>
Subject: [PATCH v4 2/6] mips/kvm: Fix ABI for use of 64-bit registers.
From: David Daney <ddaney.cavm@gmail.com>
Date: Tue, 21 May 2013 13:54:51 -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=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; bh=LcX/8NieWEnH8Pi2mGMtZ4MKTZnFoS2kiqPdCX9bNyg=; b=F8mfWz3IvA9tIRCdxAU9OuMikgSTOBzLeJPlrmJVQv+ZJ4IbXe1BbcKB1Ulge5T3od 6XpzRia7KjRk3rEgBdzzI1FE3zCxbtIyAfdxio3MWIiD/+xpeyvelzmEqPWl9ADJw7UP G9CiGCXRMtIwmvtSsNvQhZgKFrF3lG4L6xk9e5rYzfymbRSdh1PTmCqazLfUrgvDDvHI SrEXShj74LOkzkK7ymE28x0WtGmbss3dtmeTxpUpup6JzgBpSCijNa0N3P2WitL2zO41 Ve7w/uj6a8TfpVSBQ6epEUV8IioiDaR1V7gSNtnX+WQZFbD7TCtd3vgqtp7HlQPZo2R2 /QSA==
In-reply-to: <1369169695-10444-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: <1369169695-10444-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>