aboutsummaryrefslogtreecommitdiffstats
path: root/arch/arm/include
diff options
context:
space:
mode:
authorStefano Stabellini <stefano.stabellini@eu.citrix.com>2012-09-14 09:53:39 -0400
committerStefano Stabellini <stefano.stabellini@eu.citrix.com>2012-09-14 09:53:39 -0400
commit4c071ee5268f7234c3d084b6093bebccc28cdcba (patch)
tree6eaa7a6848263e9ea566f7b46d2c6667108c618e /arch/arm/include
parentecc635f90adfe1b7cd5fd354f49edfbf24aa4e3e (diff)
arm: initial Xen support
- Basic hypervisor.h and interface.h definitions. - Skeleton enlighten.c, set xen_start_info to an empty struct. - Make xen_initial_domain dependent on the SIF_PRIVILIGED_BIT. The new code only compiles when CONFIG_XEN is set, that is going to be added to arch/arm/Kconfig in patch #11 "xen/arm: introduce CONFIG_XEN on ARM". Changes in v3: - improve comments. Signed-off-by: Stefano Stabellini <stefano.stabellini@eu.citrix.com> Acked-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Diffstat (limited to 'arch/arm/include')
-rw-r--r--arch/arm/include/asm/hypervisor.h6
-rw-r--r--arch/arm/include/asm/xen/hypervisor.h19
-rw-r--r--arch/arm/include/asm/xen/interface.h69
3 files changed, 94 insertions, 0 deletions
diff --git a/arch/arm/include/asm/hypervisor.h b/arch/arm/include/asm/hypervisor.h
new file mode 100644
index 000000000000..b90d9e523d6f
--- /dev/null
+++ b/arch/arm/include/asm/hypervisor.h
@@ -0,0 +1,6 @@
1#ifndef _ASM_ARM_HYPERVISOR_H
2#define _ASM_ARM_HYPERVISOR_H
3
4#include <asm/xen/hypervisor.h>
5
6#endif
diff --git a/arch/arm/include/asm/xen/hypervisor.h b/arch/arm/include/asm/xen/hypervisor.h
new file mode 100644
index 000000000000..d7ab99a0c9eb
--- /dev/null
+++ b/arch/arm/include/asm/xen/hypervisor.h
@@ -0,0 +1,19 @@
1#ifndef _ASM_ARM_XEN_HYPERVISOR_H
2#define _ASM_ARM_XEN_HYPERVISOR_H
3
4extern struct shared_info *HYPERVISOR_shared_info;
5extern struct start_info *xen_start_info;
6
7/* Lazy mode for batching updates / context switch */
8enum paravirt_lazy_mode {
9 PARAVIRT_LAZY_NONE,
10 PARAVIRT_LAZY_MMU,
11 PARAVIRT_LAZY_CPU,
12};
13
14static inline enum paravirt_lazy_mode paravirt_get_lazy_mode(void)
15{
16 return PARAVIRT_LAZY_NONE;
17}
18
19#endif /* _ASM_ARM_XEN_HYPERVISOR_H */
diff --git a/arch/arm/include/asm/xen/interface.h b/arch/arm/include/asm/xen/interface.h
new file mode 100644
index 000000000000..74c72b5083a6
--- /dev/null
+++ b/arch/arm/include/asm/xen/interface.h
@@ -0,0 +1,69 @@
1/******************************************************************************
2 * Guest OS interface to ARM Xen.
3 *
4 * Stefano Stabellini <stefano.stabellini@eu.citrix.com>, Citrix, 2012
5 */
6
7#ifndef _ASM_ARM_XEN_INTERFACE_H
8#define _ASM_ARM_XEN_INTERFACE_H
9
10#include <linux/types.h>
11
12#define __DEFINE_GUEST_HANDLE(name, type) \
13 typedef type * __guest_handle_ ## name
14
15#define DEFINE_GUEST_HANDLE_STRUCT(name) \
16 __DEFINE_GUEST_HANDLE(name, struct name)
17#define DEFINE_GUEST_HANDLE(name) __DEFINE_GUEST_HANDLE(name, name)
18#define GUEST_HANDLE(name) __guest_handle_ ## name
19
20#define set_xen_guest_handle(hnd, val) \
21 do { \
22 if (sizeof(hnd) == 8) \
23 *(uint64_t *)&(hnd) = 0; \
24 (hnd) = val; \
25 } while (0)
26
27#ifndef __ASSEMBLY__
28/* Explicitly size integers that represent pfns in the interface with
29 * Xen so that we can have one ABI that works for 32 and 64 bit guests. */
30typedef uint64_t xen_pfn_t;
31/* Guest handles for primitive C types. */
32__DEFINE_GUEST_HANDLE(uchar, unsigned char);
33__DEFINE_GUEST_HANDLE(uint, unsigned int);
34__DEFINE_GUEST_HANDLE(ulong, unsigned long);
35DEFINE_GUEST_HANDLE(char);
36DEFINE_GUEST_HANDLE(int);
37DEFINE_GUEST_HANDLE(long);
38DEFINE_GUEST_HANDLE(void);
39DEFINE_GUEST_HANDLE(uint64_t);
40DEFINE_GUEST_HANDLE(uint32_t);
41DEFINE_GUEST_HANDLE(xen_pfn_t);
42
43/* Maximum number of virtual CPUs in multi-processor guests. */
44#define MAX_VIRT_CPUS 1
45
46struct arch_vcpu_info { };
47struct arch_shared_info { };
48
49/* TODO: Move pvclock definitions some place arch independent */
50struct pvclock_vcpu_time_info {
51 u32 version;
52 u32 pad0;
53 u64 tsc_timestamp;
54 u64 system_time;
55 u32 tsc_to_system_mul;
56 s8 tsc_shift;
57 u8 flags;
58 u8 pad[2];
59} __attribute__((__packed__)); /* 32 bytes */
60
61/* It is OK to have a 12 bytes struct with no padding because it is packed */
62struct pvclock_wall_clock {
63 u32 version;
64 u32 sec;
65 u32 nsec;
66} __attribute__((__packed__));
67#endif
68
69#endif /* _ASM_ARM_XEN_INTERFACE_H */