linux-mips
[Top] [All Lists]

Re: [PATCH] mips/kvm: Fix ABI for compatibility with 64-bit guests.

To: David Daney <ddaney.cavm@gmail.com>
Subject: Re: [PATCH] mips/kvm: Fix ABI for compatibility with 64-bit guests.
From: Sanjay Lal <sanjayl@kymasys.com>
Date: Mon, 6 May 2013 16:11:34 -0700
Cc: linux-mips@linux-mips.org, ralf@linux-mips.org, kvm@vger.kernel.org, linux-kernel@vger.kernel.org, David Daney <david.daney@cavium.com>
In-reply-to: <1367879980-2440-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: <1367879980-2440-1-git-send-email-ddaney.cavm@gmail.com>
Sender: linux-mips-bounce@linux-mips.org
On May 6, 2013, at 3:39 PM, David Daney wrote:

> 
> /* 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;
> +     /* out (KVM_GET_REGS) / in (KVM_SET_REGS) */
> +     __u64 gpr[32];
> +     __u64 hi, lo;
> +     __u64 pc;
> +};
> 
> -     __u32 cp0reg[N_MIPS_COPROC_REGS][N_MIPS_COPROC_SEL];

Hi David, I'll try out the diff with QEMU and confirm that it works as 
expected. Could you just leave the GPR field in kvm_regs as "gprs". Its a minor 
change but avoids diffs that just replace "gprs" with "gpr".

Regards
Sanjay


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