ia64/xen-unstable

view xen/include/asm-ia64/domain.h @ 10786:86e5d8458c08

[IA64] live migration

Shadow mode and live migration.

Virtualize Dirty bit.

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
author awilliam@xenbuild.aw
date Wed Jul 26 09:36:36 2006 -0600 (2006-07-26)
parents b2abc70be89e
children 7be1cfe8345b
line source
1 #ifndef __ASM_DOMAIN_H__
2 #define __ASM_DOMAIN_H__
4 #include <linux/thread_info.h>
5 #include <asm/tlb.h>
6 #include <asm/vmx_vpd.h>
7 #include <asm/vmmu.h>
8 #include <asm/regionreg.h>
9 #include <public/arch-ia64.h>
10 #include <asm/vmx_platform.h>
11 #include <xen/list.h>
12 #include <xen/cpumask.h>
13 #include <asm/fpswa.h>
15 struct p2m_entry {
16 volatile pte_t* pte;
17 pte_t used;
18 };
20 static inline void
21 p2m_entry_set(struct p2m_entry* entry, volatile pte_t* pte, pte_t used)
22 {
23 entry->pte = pte;
24 entry->used = used;
25 }
27 static inline int
28 p2m_entry_retry(struct p2m_entry* entry)
29 {
30 //XXX see lookup_domain_pte().
31 // NULL is set for invalid gpaddr for the time being.
32 if (entry->pte == NULL)
33 return 0;
35 return (pte_val(*entry->pte) != pte_val(entry->used));
36 }
38 extern void domain_relinquish_resources(struct domain *);
40 /* given a current domain metaphysical address, return the physical address */
41 extern unsigned long translate_domain_mpaddr(unsigned long mpaddr,
42 struct p2m_entry* entry);
44 /* Set shared_info virtual address. */
45 extern unsigned long domain_set_shared_info_va (unsigned long va);
47 /* Flush cache of domain d.
48 If sync_only is true, only synchronize I&D caches,
49 if false, flush and invalidate caches. */
50 extern void domain_cache_flush (struct domain *d, int sync_only);
52 /* Control the shadow mode. */
53 extern int shadow_mode_control(struct domain *d, dom0_shadow_control_t *sc);
55 /* Cleanly crash the current domain with a message. */
56 extern void panic_domain(struct pt_regs *, const char *, ...)
57 __attribute__ ((noreturn, format (printf, 2, 3)));
59 struct mm_struct {
60 pgd_t * pgd;
61 // atomic_t mm_users; /* How many users with user space? */
62 };
64 struct last_vcpu {
65 #define INVALID_VCPU_ID INT_MAX
66 int vcpu_id;
67 } ____cacheline_aligned_in_smp;
69 /* These are data in domain memory for SAL emulator. */
70 struct xen_sal_data {
71 /* OS boot rendez vous. */
72 unsigned long boot_rdv_ip;
73 unsigned long boot_rdv_r1;
75 /* There are these for EFI_SET_VIRTUAL_ADDRESS_MAP emulation. */
76 int efi_virt_mode; /* phys : 0 , virt : 1 */
77 };
79 struct arch_domain {
80 struct mm_struct mm;
82 /* Flags. */
83 union {
84 unsigned long flags;
85 struct {
86 unsigned int is_vti : 1;
87 };
88 };
90 /* There are two ranges of RID for a domain:
91 one big range, used to virtualize domain RID,
92 one small range for internal Xen use (metaphysical). */
93 /* Big range. */
94 int starting_rid; /* first RID assigned to domain */
95 int ending_rid; /* one beyond highest RID assigned to domain */
96 /* Metaphysical range. */
97 int starting_mp_rid;
98 int ending_mp_rid;
99 /* RID for metaphysical mode. */
100 unsigned long metaphysical_rr0;
101 unsigned long metaphysical_rr4;
103 int rid_bits; /* number of virtual rid bits (default: 18) */
104 int breakimm; /* The imm value for hypercalls. */
106 struct virtual_platform_def vmx_platform;
107 #define hvm_domain vmx_platform /* platform defs are not vmx specific */
109 u64 xen_vastart;
110 u64 xen_vaend;
111 u64 shared_info_va;
113 /* Address of SAL emulator data */
114 struct xen_sal_data *sal_data;
115 /* SAL return point. */
116 unsigned long sal_return_addr;
118 /* Address of efi_runtime_services_t (placed in domain memory) */
119 void *efi_runtime;
120 /* Address of fpswa_interface_t (placed in domain memory) */
121 void *fpswa_inf;
123 /* Bitmap of shadow dirty bits.
124 Set iff shadow mode is enabled. */
125 u64 *shadow_bitmap;
126 /* Length (in bits!) of shadow bitmap. */
127 unsigned long shadow_bitmap_size;
128 /* Number of bits set in bitmap. */
129 atomic64_t shadow_dirty_count;
130 /* Number of faults. */
131 atomic64_t shadow_fault_count;
133 struct last_vcpu last_vcpu[NR_CPUS];
134 };
135 #define INT_ENABLE_OFFSET(v) \
136 (sizeof(vcpu_info_t) * (v)->vcpu_id + \
137 offsetof(vcpu_info_t, evtchn_upcall_mask))
139 struct arch_vcpu {
140 /* Save the state of vcpu.
141 This is the first entry to speed up accesses. */
142 mapped_regs_t *privregs;
144 /* TR and TC. */
145 TR_ENTRY itrs[NITRS];
146 TR_ENTRY dtrs[NDTRS];
147 TR_ENTRY itlb;
148 TR_ENTRY dtlb;
150 /* Bit is set if there is a tr/tc for the region. */
151 unsigned char itr_regions;
152 unsigned char dtr_regions;
153 unsigned char tc_regions;
155 unsigned long irr[4]; /* Interrupt request register. */
156 unsigned long insvc[4]; /* Interrupt in service. */
157 unsigned long iva;
158 unsigned long dcr;
159 unsigned long domain_itm;
160 unsigned long domain_itm_last;
162 unsigned long event_callback_ip; // event callback handler
163 unsigned long failsafe_callback_ip; // Do we need it?
165 /* These fields are copied from arch_domain to make access easier/faster
166 in assembly code. */
167 unsigned long metaphysical_rr0; // from arch_domain (so is pinned)
168 unsigned long metaphysical_rr4; // from arch_domain (so is pinned)
169 unsigned long metaphysical_saved_rr0; // from arch_domain (so is pinned)
170 unsigned long metaphysical_saved_rr4; // from arch_domain (so is pinned)
171 int breakimm; // from arch_domain (so is pinned)
172 int starting_rid; /* first RID assigned to domain */
173 int ending_rid; /* one beyond highest RID assigned to domain */
175 struct thread_struct _thread; // this must be last
177 thash_cb_t vtlb;
178 thash_cb_t vhpt;
179 char irq_new_pending;
180 char irq_new_condition; // vpsr.i/vtpr change, check for pending VHPI
181 char hypercall_continuation;
182 //for phycial emulation
183 unsigned long old_rsc;
184 int mode_flags;
185 fpswa_ret_t fpswa_ret; /* save return values of FPSWA emulation */
186 struct arch_vmx_struct arch_vmx; /* Virtual Machine Extensions */
188 #define INVALID_PROCESSOR INT_MAX
189 int last_processor;
190 };
192 #include <asm/uaccess.h> /* for KERNEL_DS */
193 #include <asm/pgtable.h>
195 #endif /* __ASM_DOMAIN_H__ */
197 /*
198 * Local variables:
199 * mode: C
200 * c-set-style: "BSD"
201 * c-basic-offset: 4
202 * tab-width: 4
203 * indent-tabs-mode: nil
204 * End:
205 */