From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marc Zyngier Subject: [PATCH v4 08/32] arm64: KVM: user space interface Date: Tue, 14 May 2013 15:13:36 +0100 Message-ID: <1368540840-26750-9-git-send-email-marc.zyngier@arm.com> References: <1368540840-26750-1-git-send-email-marc.zyngier@arm.com> Content-Type: text/plain; charset=WINDOWS-1252 Content-Transfer-Encoding: quoted-printable Cc: catalin.marinas@arm.com, will.deacon@arm.com, pbonzini@redhat.com, gleb@redhat.com, Christopher Covington To: linux-arm-kernel@lists.infradead.org, kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org Return-path: Received: from service87.mimecast.com ([91.220.42.44]:48314 "EHLO service87.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757499Ab3ENOO0 (ORCPT ); Tue, 14 May 2013 10:14:26 -0400 In-Reply-To: <1368540840-26750-1-git-send-email-marc.zyngier@arm.com> Sender: kvm-owner@vger.kernel.org List-ID: Provide the kvm.h file that defines the user space visible interface. Reviewed-by: Christopher Covington Signed-off-by: Marc Zyngier --- arch/arm64/include/uapi/asm/kvm.h | 117 ++++++++++++++++++++++++++++++++++= ++++ 1 file changed, 117 insertions(+) create mode 100644 arch/arm64/include/uapi/asm/kvm.h diff --git a/arch/arm64/include/uapi/asm/kvm.h b/arch/arm64/include/uapi/as= m/kvm.h new file mode 100644 index 0000000..4e64570 --- /dev/null +++ b/arch/arm64/include/uapi/asm/kvm.h @@ -0,0 +1,117 @@ +/* + * Copyright (C) 2012,2013 - ARM Ltd + * Author: Marc Zyngier + * + * Derived from arch/arm/include/uapi/asm/kvm.h: + * Copyright (C) 2012 - Virtual Open Systems and Columbia University + * Author: Christoffer Dall + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License version 2 as + * published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +#ifndef __ARM_KVM_H__ +#define __ARM_KVM_H__ + +#define KVM_SPSR_EL1=090 +#define KVM_NR_SPSR=091 + +#ifndef __ASSEMBLY__ +#include +#include + +#define __KVM_HAVE_GUEST_DEBUG +#define __KVM_HAVE_IRQ_LINE + +#define KVM_REG_SIZE(id)=09=09=09=09=09=09\ +=09(1U << (((id) & KVM_REG_SIZE_MASK) >> KVM_REG_SIZE_SHIFT)) + +struct kvm_regs { +=09struct user_pt_regs regs;=09/* sp =3D sp_el0 */ + +=09__u64=09sp_el1; +=09__u64=09elr_el1; + +=09__u64=09spsr[KVM_NR_SPSR]; + +=09struct user_fpsimd_state fp_regs; +}; + +/* Supported Processor Types */ +#define KVM_ARM_TARGET_AEM_V8=09=090 +#define KVM_ARM_TARGET_FOUNDATION_V8=091 +#define KVM_ARM_TARGET_CORTEX_A57=092 + +#define KVM_ARM_NUM_TARGETS=09=093 + +/* KVM_ARM_SET_DEVICE_ADDR ioctl id encoding */ +#define KVM_ARM_DEVICE_TYPE_SHIFT=090 +#define KVM_ARM_DEVICE_TYPE_MASK=09(0xffff << KVM_ARM_DEVICE_TYPE_SHIFT) +#define KVM_ARM_DEVICE_ID_SHIFT=09=0916 +#define KVM_ARM_DEVICE_ID_MASK=09=09(0xffff << KVM_ARM_DEVICE_ID_SHIFT) + +/* Supported device IDs */ +#define KVM_ARM_DEVICE_VGIC_V2=09=090 + +/* Supported VGIC address types */ +#define KVM_VGIC_V2_ADDR_TYPE_DIST=090 +#define KVM_VGIC_V2_ADDR_TYPE_CPU=091 + +#define KVM_VGIC_V2_DIST_SIZE=09=090x1000 +#define KVM_VGIC_V2_CPU_SIZE=09=090x2000 + +struct kvm_vcpu_init { +=09__u32 target; +=09__u32 features[7]; +}; + +struct kvm_sregs { +}; + +struct kvm_fpu { +}; + +struct kvm_guest_debug_arch { +}; + +struct kvm_debug_exit_arch { +}; + +struct kvm_sync_regs { +}; + +struct kvm_arch_memory_slot { +}; + +/* KVM_IRQ_LINE irq field index values */ +#define KVM_ARM_IRQ_TYPE_SHIFT=09=0924 +#define KVM_ARM_IRQ_TYPE_MASK=09=090xff +#define KVM_ARM_IRQ_VCPU_SHIFT=09=0916 +#define KVM_ARM_IRQ_VCPU_MASK=09=090xff +#define KVM_ARM_IRQ_NUM_SHIFT=09=090 +#define KVM_ARM_IRQ_NUM_MASK=09=090xffff + +/* irq_type field */ +#define KVM_ARM_IRQ_TYPE_CPU=09=090 +#define KVM_ARM_IRQ_TYPE_SPI=09=091 +#define KVM_ARM_IRQ_TYPE_PPI=09=092 + +/* out-of-kernel GIC cpu interrupt injection irq_number field */ +#define KVM_ARM_IRQ_CPU_IRQ=09=090 +#define KVM_ARM_IRQ_CPU_FIQ=09=091 + +/* Highest supported SPI, from VGIC_NR_IRQS */ +#define KVM_ARM_IRQ_GIC_MAX=09=09127 + +#endif + +#endif /* __ARM_KVM_H__ */ --=20 1.8.2.3