debuggers.hg

view xen/include/asm-x86/domain.h @ 3715:d93748c50893

bitkeeper revision 1.1159.212.100 (42050e5fWLAKCQAvoZ3CPmyAaL-51g)

Reorganise 'struct domain' and 'struct exec_domain' to each have an
architecture-specific portion. Removed 'mm_struct'.
Signed-off-by: keir.fraser@cl.cam.ac.uk
author kaf24@viper.(none)
date Sat Feb 05 18:20:15 2005 +0000 (2005-02-05)
parents 32959ed5fef3
children 88957a238191 9e80fc0dcac5
line source
1 /* -*- Mode:C; c-basic-offset:4; tab-width:4; indent-tabs-mode:nil -*- */
3 #ifndef __ASM_DOMAIN_H__
4 #define __ASM_DOMAIN_H__
6 struct trap_bounce {
7 unsigned long error_code;
8 unsigned long cr2;
9 unsigned short flags; /* TBF_ */
10 unsigned short cs;
11 unsigned long eip;
12 };
14 struct arch_domain
15 {
16 l1_pgentry_t *mm_perdomain_pt;
18 /* shadow mode status and controls */
19 unsigned int shadow_mode; /* flags to control shadow table operation */
20 spinlock_t shadow_lock;
21 unsigned long min_pfn; /* min host physical */
22 unsigned long max_pfn; /* max host physical */
24 /* shadow hashtable */
25 struct shadow_status *shadow_ht;
26 struct shadow_status *shadow_ht_free;
27 struct shadow_status *shadow_ht_extras; /* extra allocation units */
28 unsigned int shadow_extras_count;
30 /* shadow dirty bitmap */
31 unsigned long *shadow_dirty_bitmap;
32 unsigned int shadow_dirty_bitmap_size; /* in pages, bit per page */
34 /* shadow mode stats */
35 unsigned int shadow_page_count;
36 unsigned int shadow_fault_count;
37 unsigned int shadow_dirty_count;
38 unsigned int shadow_dirty_net_count;
39 unsigned int shadow_dirty_block_count;
40 } __cacheline_aligned;
42 struct arch_exec_domain
43 {
44 unsigned long guestos_sp;
45 unsigned long guestos_ss;
47 unsigned long flags; /* TF_ */
49 /* Hardware debugging registers */
50 unsigned long debugreg[8]; /* %%db0-7 debug registers */
52 /* floating point info */
53 struct i387_state i387;
55 /* general user-visible register state */
56 execution_context_t user_ctxt;
58 void (*schedule_tail) (struct exec_domain *);
60 /*
61 * Return vectors pushed to us by guest OS.
62 * The stack frame for events is exactly that of an x86 hardware interrupt.
63 * The stack frame for a failsafe callback is augmented with saved values
64 * for segment registers %ds, %es, %fs and %gs:
65 * %ds, %es, %fs, %gs, %eip, %cs, %eflags [, %oldesp, %oldss]
66 */
67 unsigned long event_selector; /* entry CS */
68 unsigned long event_address; /* entry EIP */
70 unsigned long failsafe_selector; /* entry CS */
71 unsigned long failsafe_address; /* entry EIP */
73 /* Bounce information for propagating an exception to guest OS. */
74 struct trap_bounce trap_bounce;
76 /* I/O-port access bitmap. */
77 u64 io_bitmap_sel; /* Selector to tell us which part of the IO bitmap are
78 * "interesting" (i.e. have clear bits) */
79 u8 *io_bitmap; /* Pointer to task's IO bitmap or NULL */
81 /* Trap info. */
82 #ifdef ARCH_HAS_FAST_TRAP
83 int fast_trap_idx;
84 struct desc_struct fast_trap_desc;
85 #endif
86 trap_info_t traps[256];
87 #ifdef CONFIG_VMX
88 struct arch_vmx_struct arch_vmx; /* Virtual Machine Extensions */
89 #endif
91 /*
92 * Every domain has a L1 pagetable of its own. Per-domain mappings
93 * are put in this table (eg. the current GDT is mapped here).
94 */
95 l1_pgentry_t *perdomain_ptes;
96 pagetable_t pagetable;
98 pagetable_t monitor_table;
99 pagetable_t shadow_table;
100 l2_pgentry_t *vpagetable; /* virtual address of pagetable */
101 l2_pgentry_t *shadow_vtable; /* virtual address of shadow_table */
102 l2_pgentry_t *guest_pl2e_cache; /* guest page directory cache */
104 /* Virtual CR2 value. Can be read/written by guest. */
105 unsigned long guest_cr2;
107 /* Current LDT details. */
108 unsigned long ldt_base, ldt_ents, shadow_ldt_mapcnt;
109 /* Next entry is passed to LGDT on domain switch. */
110 char gdt[10]; /* NB. 10 bytes needed for x86_64. Use 6 bytes for x86_32. */
111 } __cacheline_aligned;
113 #define IDLE0_ARCH_EXEC_DOMAIN \
114 { \
115 perdomain_ptes: 0, \
116 pagetable: mk_pagetable(__pa(idle_pg_table)) \
117 }
119 #endif /* __ASM_DOMAIN_H__ */