debuggers.hg

view xen/include/asm-x86/shared.h @ 22855:1d1eec7e1fb4

xl: Perform minimal validation of virtual disk file while parsing config file

This patch performs some very basic validation on the virtual disk
file passed through the config file. This validation ensures that we
don't go too far with the initialization like spawn qemu and more
while there could be some potentially fundamental issues.

[ Patch fixed up to work with PHYSTYPE_EMPTY 22808:6ec61438713a -iwj ]

Signed-off-by: Kamala Narasimhan <kamala.narasimhan@citrix.com>
Acked-by: Ian Jackson <ian.jackson@eu.citrix.com>
Signed-off-by: Ian Jackson <ian.jackson@eu.citrix.com>
Committed-by: Ian Jackson <ian.jackson@eu.citrix.com>
author Kamala Narasimhan <kamala.narasimhan@gmail.com>
date Tue Jan 25 18:09:49 2011 +0000 (2011-01-25)
parents f74f0c1ae8ab
children
line source
1 #ifndef __XEN_X86_SHARED_H__
2 #define __XEN_X86_SHARED_H__
4 #ifdef CONFIG_COMPAT
6 #define nmi_reason(d) (!has_32bit_shinfo(d) ? \
7 (u32 *)&(d)->shared_info->native.arch.nmi_reason : \
8 (u32 *)&(d)->shared_info->compat.arch.nmi_reason)
10 #define GET_SET_SHARED(type, field) \
11 static inline type arch_get_##field(const struct domain *d) \
12 { \
13 return !has_32bit_shinfo(d) ? \
14 d->shared_info->native.arch.field : \
15 d->shared_info->compat.arch.field; \
16 } \
17 static inline void arch_set_##field(struct domain *d, \
18 type val) \
19 { \
20 if ( !has_32bit_shinfo(d) ) \
21 d->shared_info->native.arch.field = val; \
22 else \
23 d->shared_info->compat.arch.field = val; \
24 }
26 #define GET_SET_VCPU(type, field) \
27 static inline type arch_get_##field(const struct vcpu *v) \
28 { \
29 return !has_32bit_shinfo(v->domain) ? \
30 v->vcpu_info->native.arch.field : \
31 v->vcpu_info->compat.arch.field; \
32 } \
33 static inline void arch_set_##field(struct vcpu *v, \
34 type val) \
35 { \
36 if ( !has_32bit_shinfo(v->domain) ) \
37 v->vcpu_info->native.arch.field = val; \
38 else \
39 v->vcpu_info->compat.arch.field = val; \
40 }
42 #else
44 #define nmi_reason(d) ((u32 *)&(d)->shared_info->arch.nmi_reason)
46 #define GET_SET_SHARED(type, field) \
47 static inline type arch_get_##field(const struct domain *d) \
48 { \
49 return d->shared_info->arch.field; \
50 } \
51 static inline void arch_set_##field(struct domain *d, \
52 type val) \
53 { \
54 d->shared_info->arch.field = val; \
55 }
57 #define GET_SET_VCPU(type, field) \
58 static inline type arch_get_##field(const struct vcpu *v) \
59 { \
60 return v->vcpu_info->arch.field; \
61 } \
62 static inline void arch_set_##field(struct vcpu *v, \
63 type val) \
64 { \
65 v->vcpu_info->arch.field = val; \
66 }
67 #endif
69 GET_SET_SHARED(unsigned long, max_pfn)
70 GET_SET_SHARED(xen_pfn_t, pfn_to_mfn_frame_list_list)
71 GET_SET_SHARED(unsigned long, nmi_reason)
73 GET_SET_VCPU(unsigned long, cr2)
75 #undef GET_SET_VCPU
76 #undef GET_SET_SHARED
78 #endif /* __XEN_X86_SHARED_H__ */