KVM: ARM: Memory virtualization setup
[deliverable/linux.git] / arch / arm / include / uapi / asm / kvm.h
CommitLineData
749cf76c
CD
1/*
2 * Copyright (C) 2012 - Virtual Open Systems and Columbia University
3 * Author: Christoffer Dall <c.dall@virtualopensystems.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License, version 2, as
7 * published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19#ifndef __ARM_KVM_H__
20#define __ARM_KVM_H__
21
22#include <linux/types.h>
23#include <asm/ptrace.h>
24
25#define __KVM_HAVE_GUEST_DEBUG
26
27#define KVM_REG_SIZE(id) \
28 (1U << (((id) & KVM_REG_SIZE_MASK) >> KVM_REG_SIZE_SHIFT))
29
30/* Valid for svc_regs, abt_regs, und_regs, irq_regs in struct kvm_regs */
31#define KVM_ARM_SVC_sp svc_regs[0]
32#define KVM_ARM_SVC_lr svc_regs[1]
33#define KVM_ARM_SVC_spsr svc_regs[2]
34#define KVM_ARM_ABT_sp abt_regs[0]
35#define KVM_ARM_ABT_lr abt_regs[1]
36#define KVM_ARM_ABT_spsr abt_regs[2]
37#define KVM_ARM_UND_sp und_regs[0]
38#define KVM_ARM_UND_lr und_regs[1]
39#define KVM_ARM_UND_spsr und_regs[2]
40#define KVM_ARM_IRQ_sp irq_regs[0]
41#define KVM_ARM_IRQ_lr irq_regs[1]
42#define KVM_ARM_IRQ_spsr irq_regs[2]
43
44/* Valid only for fiq_regs in struct kvm_regs */
45#define KVM_ARM_FIQ_r8 fiq_regs[0]
46#define KVM_ARM_FIQ_r9 fiq_regs[1]
47#define KVM_ARM_FIQ_r10 fiq_regs[2]
48#define KVM_ARM_FIQ_fp fiq_regs[3]
49#define KVM_ARM_FIQ_ip fiq_regs[4]
50#define KVM_ARM_FIQ_sp fiq_regs[5]
51#define KVM_ARM_FIQ_lr fiq_regs[6]
52#define KVM_ARM_FIQ_spsr fiq_regs[7]
53
54struct kvm_regs {
55 struct pt_regs usr_regs;/* R0_usr - R14_usr, PC, CPSR */
56 __u32 svc_regs[3]; /* SP_svc, LR_svc, SPSR_svc */
57 __u32 abt_regs[3]; /* SP_abt, LR_abt, SPSR_abt */
58 __u32 und_regs[3]; /* SP_und, LR_und, SPSR_und */
59 __u32 irq_regs[3]; /* SP_irq, LR_irq, SPSR_irq */
60 __u32 fiq_regs[8]; /* R8_fiq - R14_fiq, SPSR_fiq */
61};
62
63/* Supported Processor Types */
64#define KVM_ARM_TARGET_CORTEX_A15 0
65#define KVM_ARM_NUM_TARGETS 1
66
67struct kvm_vcpu_init {
68 __u32 target;
69 __u32 features[7];
70};
71
72struct kvm_sregs {
73};
74
75struct kvm_fpu {
76};
77
78struct kvm_guest_debug_arch {
79};
80
81struct kvm_debug_exit_arch {
82};
83
84struct kvm_sync_regs {
85};
86
87struct kvm_arch_memory_slot {
88};
89
90/* If you need to interpret the index values, here is the key: */
91#define KVM_REG_ARM_COPROC_MASK 0x000000000FFF0000
92#define KVM_REG_ARM_COPROC_SHIFT 16
93#define KVM_REG_ARM_32_OPC2_MASK 0x0000000000000007
94#define KVM_REG_ARM_32_OPC2_SHIFT 0
95#define KVM_REG_ARM_OPC1_MASK 0x0000000000000078
96#define KVM_REG_ARM_OPC1_SHIFT 3
97#define KVM_REG_ARM_CRM_MASK 0x0000000000000780
98#define KVM_REG_ARM_CRM_SHIFT 7
99#define KVM_REG_ARM_32_CRN_MASK 0x0000000000007800
100#define KVM_REG_ARM_32_CRN_SHIFT 11
101
102/* Normal registers are mapped as coprocessor 16. */
103#define KVM_REG_ARM_CORE (0x0010 << KVM_REG_ARM_COPROC_SHIFT)
104#define KVM_REG_ARM_CORE_REG(name) (offsetof(struct kvm_regs, name) / 4)
105
106#endif /* __ARM_KVM_H__ */
This page took 0.05544 seconds and 5 git commands to generate.