ia64/xen-unstable

view xen/include/asm-ia64/domain.h @ 10151:2cab08ac143b

[IA64] support DOMID_XEN and DOMID_IO of foreign domain page mapping

support of foreign domain page mapping of DOMID_XEN and DOMID_IO.
This patch is needed for xentrace and xenmon.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
author awilliam@xenbuild.aw
date Wed May 24 10:39:55 2006 -0600 (2006-05-24)
parents d8659e39ff3c
children 40959bc0a269
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>
14 extern void domain_relinquish_resources(struct domain *);
16 /* Flush cache of domain d.
17 If sync_only is true, only synchronize I&D caches,
18 if false, flush and invalidate caches. */
19 extern void domain_cache_flush (struct domain *d, int sync_only);
21 /* Cleanly crash the current domain with a message. */
22 extern void panic_domain(struct pt_regs *, const char *, ...)
23 __attribute__ ((noreturn, format (printf, 2, 3)));
25 struct mm_struct {
26 pgd_t * pgd;
27 // atomic_t mm_users; /* How many users with user space? */
28 };
30 struct arch_domain {
31 struct mm_struct mm;
32 unsigned long metaphysical_rr0;
33 unsigned long metaphysical_rr4;
35 /* There are two ranges of RID for a domain:
36 one big range, used to virtualize domain RID,
37 one small range for internal Xen use (metaphysical). */
38 /* Big range. */
39 int starting_rid; /* first RID assigned to domain */
40 int ending_rid; /* one beyond highest RID assigned to domain */
41 int rid_bits; /* number of virtual rid bits (default: 18) */
42 /* Metaphysical range. */
43 int starting_mp_rid;
44 int ending_mp_rid;
46 int breakimm; /* The imm value for hypercalls. */
48 int physmap_built; /* Whether is physmap built or not */
49 int imp_va_msb;
50 /* System pages out of guest memory, like for xenstore/console */
51 unsigned long sys_pgnr;
52 unsigned long max_pfn; /* Max pfn including I/O holes */
53 struct virtual_platform_def vmx_platform;
54 #define hvm_domain vmx_platform /* platform defs are not vmx specific */
56 u64 xen_vastart;
57 u64 xen_vaend;
58 u64 shared_info_va;
59 unsigned long initrd_start;
60 unsigned long initrd_len;
61 char *cmdline;
62 int efi_virt_mode; /* phys : 0 , virt : 1 */
63 void *efi_runtime;
64 };
65 #define xen_vastart arch.xen_vastart
66 #define xen_vaend arch.xen_vaend
67 #define INT_ENABLE_OFFSET(v) \
68 (sizeof(vcpu_info_t) * (v)->vcpu_id + \
69 offsetof(vcpu_info_t, evtchn_upcall_mask))
71 struct arch_vcpu {
72 TR_ENTRY itrs[NITRS];
73 TR_ENTRY dtrs[NDTRS];
74 TR_ENTRY itlb;
75 TR_ENTRY dtlb;
76 unsigned int itr_regions;
77 unsigned int dtr_regions;
78 unsigned long irr[4];
79 unsigned long insvc[4];
80 unsigned long tc_regions;
81 unsigned long iva;
82 unsigned long dcr;
83 unsigned long itc;
84 unsigned long domain_itm;
85 unsigned long domain_itm_last;
86 unsigned long xen_itm;
88 mapped_regs_t *privregs; /* save the state of vcpu */
89 unsigned long event_callback_ip; // event callback handler
90 unsigned long failsafe_callback_ip; // Do we need it?
92 /* These fields are copied from arch_domain to make access easier/faster
93 in assembly code. */
94 unsigned long metaphysical_rr0; // from arch_domain (so is pinned)
95 unsigned long metaphysical_rr4; // from arch_domain (so is pinned)
96 unsigned long metaphysical_saved_rr0; // from arch_domain (so is pinned)
97 unsigned long metaphysical_saved_rr4; // from arch_domain (so is pinned)
98 int breakimm; // from arch_domain (so is pinned)
99 int starting_rid; /* first RID assigned to domain */
100 int ending_rid; /* one beyond highest RID assigned to domain */
102 struct thread_struct _thread; // this must be last
104 thash_cb_t vtlb;
105 thash_cb_t vhpt;
106 char irq_new_pending;
107 char irq_new_condition; // vpsr.i/vtpr change, check for pending VHPI
108 char hypercall_continuation;
109 //for phycial emulation
110 unsigned long old_rsc;
111 int mode_flags;
112 struct arch_vmx_struct arch_vmx; /* Virtual Machine Extensions */
113 };
115 struct page_info * assign_new_domain_page(struct domain *d, unsigned long mpaddr);
116 void assign_new_domain0_page(struct domain *d, unsigned long mpaddr);
117 void __assign_domain_page(struct domain *d, unsigned long mpaddr, unsigned long physaddr);
118 void assign_domain_page(struct domain *d, unsigned long mpaddr, unsigned long physaddr);
119 void assign_domain_io_page(struct domain *d, unsigned long mpaddr, unsigned long flags);
120 #ifdef CONFIG_XEN_IA64_DOM0_VP
121 void alloc_dom_xen_and_dom_io(void);
122 unsigned long assign_domain_mmio_page(struct domain *d, unsigned long mpaddr, unsigned long size);
123 unsigned long assign_domain_mach_page(struct domain *d, unsigned long mpaddr, unsigned long size);
124 unsigned long do_dom0vp_op(unsigned long cmd, unsigned long arg0, unsigned long arg1, unsigned long arg2, unsigned long arg3);
125 unsigned long dom0vp_zap_physmap(struct domain *d, unsigned long gpfn, unsigned int extent_order);
126 unsigned long dom0vp_add_physmap(struct domain* d, unsigned long gpfn, unsigned long mfn, unsigned int flags, domid_t domid);
127 #else
128 #define alloc_dom_xen_and_dom_io() do { } while (0)
129 #endif
131 #include <asm/uaccess.h> /* for KERNEL_DS */
132 #include <asm/pgtable.h>
134 #endif /* __ASM_DOMAIN_H__ */
136 /*
137 * Local variables:
138 * mode: C
139 * c-set-style: "BSD"
140 * c-basic-offset: 4
141 * tab-width: 4
142 * indent-tabs-mode: nil
143 * End:
144 */