linux-mips
[Top] [All Lists]

Re: [PATCH v2 02/18] KVM/MIPS32: Arch specific KVM data structures.

To: Sanjay Lal <sanjayl@kymasys.com>
Subject: Re: [PATCH v2 02/18] KVM/MIPS32: Arch specific KVM data structures.
From: David Daney <ddaney.cavm@gmail.com>
Date: Thu, 31 Jan 2013 12:12:46 -0800
Cc: kvm@vger.kernel.org, linux-mips@linux-mips.org, Ralf Baechle <ralf@linux-mips.org>
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=x-received:message-id:date:from:user-agent:mime-version:to:cc :subject:references:in-reply-to:content-type :content-transfer-encoding; bh=c0oZ25/t5AMMOdl27UNSXoM5A1c5nmtuWXVuoiqIo/w=; b=K1fP6Ru1ax+Tui4C6zeInWHgmHeUP9VoR+70TowTVIhEu8mA3yx/z8cVz38JXHhdSq 4xp0XRM2WsXUz4bT9Mfr4pkLv5uRouQMUPoT7nkrfrCCbFXnd/MmqEyzApY0EKZJlPrv iGNhqy0C7zFABw3VIrf3j0GDiV0O1boWSFMgmc4fKsmIJA541TgMJnmLe11gKo8P9b38 WtsNEHJMx9Z9kUVI73c4iYHEyknbe8RFqlW4Ngnv8CurSaWQUMPgIQgl6xwUdWi9O660 j15aN/oHWoqJ27ye6Pik6/KYYiXR/E2zC+Lc1HX2EvGIo1jrZwgp9eebz1TvCdPEJbPH wMAw==
In-reply-to: <1353551656-23579-3-git-send-email-sanjayl@kymasys.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>
References: <1353551656-23579-1-git-send-email-sanjayl@kymasys.com> <1353551656-23579-3-git-send-email-sanjayl@kymasys.com>
Sender: linux-mips-bounce@linux-mips.org
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:17.0) Gecko/20130110 Thunderbird/17.0.2
On 11/21/2012 06:34 PM, Sanjay Lal wrote:
Signed-off-by: Sanjay Lal <sanjayl@kymasys.com>
---
  arch/mips/include/asm/kvm.h      |  55 ++++

asm/kvm.h defines the user space ABI, and thus should be placed in arch/mips/include/uapi/asm instead.



  arch/mips/include/asm/kvm_host.h | 669 +++++++++++++++++++++++++++++++++++++++
  2 files changed, 724 insertions(+)
  create mode 100644 arch/mips/include/asm/kvm.h
  create mode 100644 arch/mips/include/asm/kvm_host.h

diff --git a/arch/mips/include/asm/kvm.h b/arch/mips/include/asm/kvm.h
new file mode 100644
index 0000000..85789ea
--- /dev/null
+++ b/arch/mips/include/asm/kvm.h
@@ -0,0 +1,55 @@
+/*
+* This file is subject to the terms and conditions of the GNU General Public
+* License.  See the file "COPYING" in the main directory of this archive
+* for more details.
+*
+* Copyright (C) 2012  MIPS Technologies, Inc.  All rights reserved.
+* Authors: Sanjay Lal <sanjayl@kymasys.com>
+*/
+
+#ifndef __LINUX_KVM_MIPS_H
+#define __LINUX_KVM_MIPS_H
+
+#include <linux/types.h>
+
+#define __KVM_MIPS
+
+#define N_MIPS_COPROC_REGS      32
+#define N_MIPS_COPROC_SEL      8
+
+/* for KVM_GET_REGS and KVM_SET_REGS */
+struct kvm_regs {
+       __u32 gprs[32];

MIPS64 registers are 64 bits wide.  How is this going to work for MIPS64?

It seems a little important to answer this question as this is a userspace ABI that really cannot be changed once it is published.


+       __u32 hi;
+       __u32 lo;
+       __u32 pc;
+
+       __u32 cp0reg[N_MIPS_COPROC_REGS][N_MIPS_COPROC_SEL];

Do we really want CP0 regs in here? Other architectures don't have things like this. They use things like KVM_GET_MSRS and KVM_SET_MSRS for this.

+};
+
+/* for KVM_GET_SREGS and KVM_SET_SREGS */
+struct kvm_sregs {
+};
+
+/* for KVM_GET_FPU and KVM_SET_FPU */
+struct kvm_fpu {

This is a userspace ABI, and MIPS definitely has a FPU. That means that we cannot change the definition after it is merged, but we know this must have the FPU registers in it.

So it cannot be both present and empty.


+};
+
+struct kvm_debug_exit_arch {
+};
+
+/* for KVM_SET_GUEST_DEBUG */
+struct kvm_guest_debug_arch {
+};
+
+struct kvm_mips_interrupt {
+       /* in */
+       __u32 cpu;
+       __u32 irq;
+};
+
+/* definition of registers in kvm_run */
+struct kvm_sync_regs {
+};
+
+#endif /* __LINUX_KVM_MIPS_H */
[...]

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