debuggers.hg

view xen/include/asm-x86/ldt.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 7f1a36b834e1
children
line source
2 #ifndef __ARCH_LDT_H
3 #define __ARCH_LDT_H
5 #ifndef __ASSEMBLY__
7 static inline void load_LDT(struct vcpu *v)
8 {
9 struct desc_struct *desc;
10 unsigned long ents;
12 if ( (ents = v->arch.guest_context.ldt_ents) == 0 )
13 {
14 __asm__ __volatile__ ( "lldt %%ax" : : "a" (0) );
15 }
16 else
17 {
18 desc = (!is_pv_32on64_vcpu(v)
19 ? this_cpu(gdt_table) : this_cpu(compat_gdt_table))
20 + LDT_ENTRY - FIRST_RESERVED_GDT_ENTRY;
21 _set_tssldt_desc(desc, LDT_VIRT_START(v), ents*8-1, 2);
22 __asm__ __volatile__ ( "lldt %%ax" : : "a" (LDT_ENTRY << 3) );
23 }
24 }
26 #endif /* !__ASSEMBLY__ */
28 #endif
30 /*
31 * Local variables:
32 * mode: C
33 * c-set-style: "BSD"
34 * c-basic-offset: 4
35 * tab-width: 4
36 * indent-tabs-mode: nil
37 * End:
38 */