ia64/xen-unstable

view xen/include/asm-x86/domain.h @ 3858:5b63436f25fe

bitkeeper revision 1.1205.1.2 (421527deX3t0INFwjrOweq0E7Le7pw)

Rename fields in arch_exec_domain to be more uniform.
Promote vmx_shadow_invlpg() to shadow_invlpg().
author maf46@burn.cl.cam.ac.uk
date Thu Feb 17 23:25:18 2005 +0000 (2005-02-17)
parents f4d1946b8db2
children 5943b2cd1c2a
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;
17 #ifdef __x86_64__
18 l2_pgentry_t *mm_perdomain_l2;
19 l3_pgentry_t *mm_perdomain_l3;
20 #endif
22 /* shadow mode status and controls */
23 unsigned int shadow_mode; /* flags to control shadow table operation */
24 spinlock_t shadow_lock;
25 unsigned long min_pfn; /* min host physical */
26 unsigned long max_pfn; /* max host physical */
28 /* shadow hashtable */
29 struct shadow_status *shadow_ht;
30 struct shadow_status *shadow_ht_free;
31 struct shadow_status *shadow_ht_extras; /* extra allocation units */
32 unsigned int shadow_extras_count;
34 /* shadow dirty bitmap */
35 unsigned long *shadow_dirty_bitmap;
36 unsigned int shadow_dirty_bitmap_size; /* in pages, bit per page */
38 /* shadow mode stats */
39 unsigned int shadow_page_count;
40 unsigned int shadow_fault_count;
41 unsigned int shadow_dirty_count;
42 unsigned int shadow_dirty_net_count;
43 unsigned int shadow_dirty_block_count;
44 } __cacheline_aligned;
46 struct arch_exec_domain
47 {
48 unsigned long kernel_sp;
49 unsigned long kernel_ss;
51 unsigned long flags; /* TF_ */
53 /* Hardware debugging registers */
54 unsigned long debugreg[8]; /* %%db0-7 debug registers */
56 /* floating point info */
57 struct i387_state i387;
59 /* general user-visible register state */
60 execution_context_t user_ctxt;
62 void (*schedule_tail) (struct exec_domain *);
64 /*
65 * Return vectors pushed to us by guest OS.
66 * The stack frame for events is exactly that of an x86 hardware interrupt.
67 * The stack frame for a failsafe callback is augmented with saved values
68 * for segment registers %ds, %es, %fs and %gs:
69 * %ds, %es, %fs, %gs, %eip, %cs, %eflags [, %oldesp, %oldss]
70 */
72 unsigned long event_selector; /* entry CS (x86/32 only) */
73 unsigned long event_address; /* entry EIP */
75 unsigned long failsafe_selector; /* entry CS (x86/32 only) */
76 unsigned long failsafe_address; /* entry EIP */
78 unsigned long syscall_address; /* entry EIP (x86/64 only) */
80 /* Bounce information for propagating an exception to guest OS. */
81 struct trap_bounce trap_bounce;
83 /* I/O-port access bitmap. */
84 u64 io_bitmap_sel; /* Selector to tell us which part of the IO bitmap are
85 * "interesting" (i.e. have clear bits) */
86 u8 *io_bitmap; /* Pointer to task's IO bitmap or NULL */
88 /* Trap info. */
89 #ifdef ARCH_HAS_FAST_TRAP
90 int fast_trap_idx;
91 struct desc_struct fast_trap_desc;
92 #endif
93 trap_info_t traps[256];
94 #ifdef CONFIG_VMX
95 struct arch_vmx_struct arch_vmx; /* Virtual Machine Extensions */
96 #endif
98 /*
99 * Every domain has a L1 pagetable of its own. Per-domain mappings
100 * are put in this table (eg. the current GDT is mapped here).
101 */
102 l1_pgentry_t *perdomain_ptes;
104 pagetable_t guest_table_user; /* x86/64: user-space pagetable. */
105 pagetable_t guest_table; /* guest notion of cr3 */
106 pagetable_t shadow_table; /* shadow of guest */
107 pagetable_t hl2_table; /* shortcut to guest's L1 PTEs */
108 pagetable_t monitor_table; /* used in hypervisor */
110 pagetable_t phys_table; /* guest 1:1 pagetable */
112 l2_pgentry_t *guest_vtable; /* virtual address of pagetable */
113 l2_pgentry_t *shadow_vtable; /* virtual address of shadow_table */
114 l2_pgentry_t *hl2_vtable; /* virtual address of hl2_table */
115 l2_pgentry_t *monitor_vtable; /* virtual address of monitor_table */
117 /* Virtual CR2 value. Can be read/written by guest. */
118 unsigned long guest_cr2;
120 /* Current LDT details. */
121 unsigned long ldt_base, ldt_ents, shadow_ldt_mapcnt;
122 /* Next entry is passed to LGDT on domain switch. */
123 char gdt[10]; /* NB. 10 bytes needed for x86_64. Use 6 bytes for x86_32. */
124 } __cacheline_aligned;
126 #define IDLE0_ARCH_EXEC_DOMAIN \
127 { \
128 perdomain_ptes: 0, \
129 monitor_table: mk_pagetable(__pa(idle_pg_table)) \
130 }
132 #endif /* __ASM_DOMAIN_H__ */