ia64/xen-unstable

view xen/include/asm-x86/domain.h @ 3708:9e80fc0dcac5

bitkeeper revision 1.1159.212.121 (42081031Gcfd1G5fgexBl7vd4XfmLQ)

Use 1:1 pagetables used for guest physical mode emulation for doing
phys_to_machine_mapping as well.

Signed-off-by: Arun Sharma <arun.sharma@intel.com>
Signed-off-by: ian@xensource.com
author iap10@labyrinth.cl.cam.ac.uk
date Tue Feb 08 01:04:49 2005 +0000 (2005-02-08)
parents d93748c50893
children f5f2757b3aa2
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 phys_table; /* 1:1 pagetable */
100 pagetable_t shadow_table;
101 l2_pgentry_t *vpagetable; /* virtual address of pagetable */
102 l2_pgentry_t *shadow_vtable; /* virtual address of shadow_table */
103 l2_pgentry_t *guest_pl2e_cache; /* guest page directory cache */
105 /* Virtual CR2 value. Can be read/written by guest. */
106 unsigned long guest_cr2;
108 /* Current LDT details. */
109 unsigned long ldt_base, ldt_ents, shadow_ldt_mapcnt;
110 /* Next entry is passed to LGDT on domain switch. */
111 char gdt[10]; /* NB. 10 bytes needed for x86_64. Use 6 bytes for x86_32. */
112 } __cacheline_aligned;
114 #define IDLE0_ARCH_EXEC_DOMAIN \
115 { \
116 perdomain_ptes: 0, \
117 pagetable: mk_pagetable(__pa(idle_pg_table)) \
118 }
120 #endif /* __ASM_DOMAIN_H__ */