debuggers.hg

view xen/include/asm-x86/domain.h @ 4671:18a8f5216548

bitkeeper revision 1.1366 (4268c126o36cKcnzrSkVxkbrPsoz1g)

Clean up shadow destruction and fix domain destroy when shadow mode
is disabled.
Signed-off-by: Keir Fraser <keir@xensource.com>
author kaf24@firebug.cl.cam.ac.uk
date Fri Apr 22 09:17:26 2005 +0000 (2005-04-22)
parents 7fc6eac6da3a
children 38a02ee9a9c8 65b28c74cec2
line source
2 #ifndef __ASM_DOMAIN_H__
3 #define __ASM_DOMAIN_H__
5 #include <xen/mm.h>
7 struct trap_bounce {
8 unsigned long error_code;
9 unsigned long cr2;
10 unsigned short flags; /* TBF_ */
11 unsigned short cs;
12 unsigned long eip;
13 };
15 struct arch_domain
16 {
17 l1_pgentry_t *mm_perdomain_pt;
18 #ifdef __x86_64__
19 l2_pgentry_t *mm_perdomain_l2;
20 l3_pgentry_t *mm_perdomain_l3;
21 #endif
23 /* Writable pagetables. */
24 struct ptwr_info ptwr[2];
26 /* I/O-port access bitmap mask. */
27 u8 *iobmp_mask; /* Address of IO bitmap mask, or NULL. */
29 /* Shadow mode status and controls. */
30 unsigned int shadow_mode; /* flags to control shadow table operation */
31 spinlock_t shadow_lock;
32 /* Shadow mode has tainted page reference counts? */
33 unsigned int shadow_tainted_refcnts;
35 /* shadow hashtable */
36 struct shadow_status *shadow_ht;
37 struct shadow_status *shadow_ht_free;
38 struct shadow_status *shadow_ht_extras; /* extra allocation units */
39 unsigned int shadow_extras_count;
41 /* shadow dirty bitmap */
42 unsigned long *shadow_dirty_bitmap;
43 unsigned int shadow_dirty_bitmap_size; /* in pages, bit per page */
45 /* shadow mode stats */
46 unsigned int shadow_page_count;
47 unsigned int hl2_page_count;
48 unsigned int snapshot_page_count;
50 unsigned int shadow_fault_count;
51 unsigned int shadow_dirty_count;
52 unsigned int shadow_dirty_net_count;
53 unsigned int shadow_dirty_block_count;
55 /* full shadow mode */
56 struct out_of_sync_entry *out_of_sync; /* list of out-of-sync pages */
57 struct out_of_sync_entry *out_of_sync_free;
58 struct out_of_sync_entry *out_of_sync_extras;
59 unsigned int out_of_sync_extras_count;
61 struct list_head free_shadow_frames;
63 pagetable_t phys_table; /* guest 1:1 pagetable */
65 } __cacheline_aligned;
67 struct arch_exec_domain
68 {
69 unsigned long kernel_sp;
70 unsigned long kernel_ss;
72 unsigned long flags; /* TF_ */
74 /* Hardware debugging registers */
75 unsigned long debugreg[8]; /* %%db0-7 debug registers */
77 /* floating point info */
78 struct i387_state i387;
80 /* general user-visible register state */
81 execution_context_t user_ctxt;
83 void (*schedule_tail) (struct exec_domain *);
85 /*
86 * Return vectors pushed to us by guest OS.
87 * The stack frame for events is exactly that of an x86 hardware interrupt.
88 * The stack frame for a failsafe callback is augmented with saved values
89 * for segment registers %ds, %es, %fs and %gs:
90 * %ds, %es, %fs, %gs, %eip, %cs, %eflags [, %oldesp, %oldss]
91 */
93 unsigned long event_selector; /* entry CS (x86/32 only) */
94 unsigned long event_address; /* entry EIP */
96 unsigned long failsafe_selector; /* entry CS (x86/32 only) */
97 unsigned long failsafe_address; /* entry EIP */
99 unsigned long syscall_address; /* entry EIP (x86/64 only) */
101 /* Bounce information for propagating an exception to guest OS. */
102 struct trap_bounce trap_bounce;
104 /* I/O-port access bitmap. */
105 u8 *iobmp; /* Guest kernel virtual address of the bitmap. */
106 int iobmp_limit; /* Number of ports represented in the bitmap. */
107 int iopl; /* Current IOPL for this VCPU. */
109 /* Trap info. */
110 #ifdef ARCH_HAS_FAST_TRAP
111 int fast_trap_idx;
112 struct desc_struct fast_trap_desc;
113 #endif
114 trap_info_t traps[256];
116 /* Virtual Machine Extensions */
117 struct arch_vmx_struct arch_vmx;
119 /*
120 * Every domain has a L1 pagetable of its own. Per-domain mappings
121 * are put in this table (eg. the current GDT is mapped here).
122 */
123 l1_pgentry_t *perdomain_ptes;
125 pagetable_t guest_table_user; /* x86/64: user-space pagetable. */
126 pagetable_t guest_table; /* (MA) guest notion of cr3 */
127 pagetable_t shadow_table; /* (MA) shadow of guest */
128 pagetable_t monitor_table; /* (MA) used in hypervisor */
130 l2_pgentry_t *guest_vtable; /* virtual address of pagetable */
131 l2_pgentry_t *shadow_vtable; /* virtual address of shadow_table */
132 l2_pgentry_t *monitor_vtable; /* virtual address of monitor_table */
133 l1_pgentry_t *hl2_vtable; /* virtual address of hl2_table */
135 #ifdef __x86_64__
136 l3_pgentry_t *guest_vl3table;
137 l4_pgentry_t *guest_vl4table;
138 #endif
140 unsigned long monitor_shadow_ref;
142 /* Virtual CR2 value. Can be read/written by guest. */
143 unsigned long guest_cr2;
145 /* Current LDT details. */
146 unsigned long ldt_base, ldt_ents, shadow_ldt_mapcnt;
147 /* Next entry is passed to LGDT on domain switch. */
148 char gdt[10]; /* NB. 10 bytes needed for x86_64. Use 6 bytes for x86_32. */
149 } __cacheline_aligned;
151 #define IDLE0_ARCH_EXEC_DOMAIN \
152 { \
153 perdomain_ptes: 0, \
154 monitor_table: mk_pagetable(__pa(idle_pg_table)) \
155 }
157 #endif /* __ASM_DOMAIN_H__ */
159 /*
160 * Local variables:
161 * mode: C
162 * c-set-style: "BSD"
163 * c-basic-offset: 4
164 * tab-width: 4
165 * indent-tabs-mode: nil
166 * End:
167 */