aboutsummaryrefslogtreecommitdiffstats
path: root/xen/include/asm-ia64/domain.h
blob: 0f0e37895b6eefdee9dd8c92da793a5e540dbbf7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
#ifndef __ASM_DOMAIN_H__
#define __ASM_DOMAIN_H__

#include <linux/thread_info.h>
#ifdef CONFIG_VTI
#include <asm/vmx_vpd.h>
#include <asm/vmmu.h>
#include <asm/regionreg.h>
#endif // CONFIG_VTI
#include <xen/list.h>

extern void arch_do_createdomain(struct vcpu *);

extern int arch_final_setup_guestos(
    struct vcpu *, struct vcpu_guest_context *);

extern void domain_relinquish_resources(struct domain *);

#ifdef CONFIG_VTI
struct trap_bounce {
	// TO add, FIXME Eddie
};

#define	 PMT_SIZE	(32L*1024*1024)		// 32M for PMT
#endif // CONFIG_VTI

struct arch_domain {
    struct mm_struct *active_mm;
    struct mm_struct *mm;
    int metaphysical_rr0;
    int starting_rid;		/* first RID assigned to domain */
    int ending_rid;		/* one beyond highest RID assigned to domain */
    int rid_bits;		/* number of virtual rid bits (default: 18) */
    int breakimm;
#ifdef  CONFIG_VTI
    int imp_va_msb;
    ia64_rr emul_phy_rr0;
    ia64_rr emul_phy_rr4;
    u64 *pmt;	/* physical to machine table */
#endif  //CONFIG_VTI
    u64 xen_vastart;
    u64 xen_vaend;
    u64 shared_info_va;
#ifdef DOMU_AUTO_RESTART
    u64 image_start;
    u64 image_len;
    u64 entry;
#endif
};
#define starting_rid arch.starting_rid
#define ending_rid arch.ending_rid
#define rid_bits arch.rid_bits
#define xen_vastart arch.xen_vastart
#define xen_vaend arch.xen_vaend
#define shared_info_va arch.shared_info_va

struct arch_vcpu {
#if 1
	TR_ENTRY itrs[NITRS];
	TR_ENTRY dtrs[NDTRS];
	TR_ENTRY itlb;
	TR_ENTRY dtlb;
	unsigned long itlb_pte;
	unsigned long dtlb_pte;
	unsigned long irr[4];
	unsigned long insvc[4];
	unsigned long iva;
	unsigned long dcr;
	unsigned long itc;
	unsigned long domain_itm;
	unsigned long domain_itm_last;
	unsigned long xen_itm;
	unsigned long xen_timer_interval;
#endif
    void *regs;	/* temporary until find a better way to do privops */
    int metaphysical_rr0;		// from arch_domain (so is pinned)
    int metaphysical_saved_rr0;		// from arch_domain (so is pinned)
    int breakimm;			// from arch_domain (so is pinned)
    struct mm_struct *active_mm;
    struct thread_struct _thread;	// this must be last
#ifdef CONFIG_VTI
    void (*schedule_tail) (struct vcpu *);
    struct trap_bounce trap_bounce;
    thash_cb_t *vtlb;
    //for phycial  emulation
    unsigned long old_rsc;
    int mode_flags;

    struct arch_vmx_struct arch_vmx; /* Virtual Machine Extensions */
#endif	// CONFIG_VTI
};

#define active_mm arch.active_mm
//#define thread arch._thread

// FOLLOWING FROM linux-2.6.7/include/sched.h

struct mm_struct {
	struct vm_area_struct * mmap;		/* list of VMAs */
#ifndef XEN
	struct rb_root mm_rb;
#endif
	struct vm_area_struct * mmap_cache;	/* last find_vma result */
	unsigned long free_area_cache;		/* first hole */
	pgd_t * pgd;
	atomic_t mm_users;			/* How many users with user space? */
	atomic_t mm_count;			/* How many references to "struct mm_struct" (users count as 1) */
	int map_count;				/* number of VMAs */
#ifndef XEN
	struct rw_semaphore mmap_sem;
#endif
	spinlock_t page_table_lock;		/* Protects task page tables and mm->rss */

	struct list_head mmlist;		/* List of all active mm's.  These are globally strung
						 * together off init_mm.mmlist, and are protected
						 * by mmlist_lock
						 */

	unsigned long start_code, end_code, start_data, end_data;
	unsigned long start_brk, brk, start_stack;
	unsigned long arg_start, arg_end, env_start, env_end;
	unsigned long rss, total_vm, locked_vm;
	unsigned long def_flags;

	unsigned long saved_auxv[40]; /* for /proc/PID/auxv */

	unsigned dumpable:1;
#ifdef CONFIG_HUGETLB_PAGE
	int used_hugetlb;
#endif
#ifndef XEN
	cpumask_t cpu_vm_mask;

	/* Architecture-specific MM context */
	mm_context_t context;

	/* coredumping support */
	int core_waiters;
	struct completion *core_startup_done, core_done;

	/* aio bits */
	rwlock_t		ioctx_list_lock;
	struct kioctx		*ioctx_list;

	struct kioctx		default_kioctx;
#endif
};

extern struct mm_struct init_mm;

#include <asm/uaccess.h> /* for KERNEL_DS */
#include <asm/pgtable.h>

#endif /* __ASM_DOMAIN_H__ */

/*
 * Local variables:
 * mode: C
 * c-set-style: "BSD"
 * c-basic-offset: 4
 * tab-width: 4
 * indent-tabs-mode: nil
 * End:
 */