ia64/xen-unstable

annotate xen/include/asm-ia64/domain.h @ 9770:ced37bea0647

[IA64] FPH enabling + cleanup

Move contents of switch_to macro from xensystem.h to context_switch function.
Initialize FPU on all processors. FPH is always enabled in Xen.
Speed up context-switch (a little bit!) by not enabling/disabling FPH.
Cleanup (unused function/variablesi/fields, debug printf...)
vmx_ia64_switch_to removed (was unused).

Signed-off-by: Tristan Gingold <tristan.gingold@bull.net>
author awilliam@xenbuild.aw
date Tue Apr 25 22:35:41 2006 -0600 (2006-04-25)
parents 7c7bcf173f8b
children 3ab5ab4d6d75
rev   line source
iap10@3833 1 #ifndef __ASM_DOMAIN_H__
iap10@3833 2 #define __ASM_DOMAIN_H__
iap10@3833 3
iap10@3833 4 #include <linux/thread_info.h>
djm@5470 5 #include <asm/tlb.h>
adsharma@4993 6 #include <asm/vmx_vpd.h>
adsharma@4993 7 #include <asm/vmmu.h>
adsharma@4993 8 #include <asm/regionreg.h>
djm@5455 9 #include <public/arch-ia64.h>
fred@5950 10 #include <asm/vmx_platform.h>
cl349@5296 11 #include <xen/list.h>
awilliam@8914 12 #include <xen/cpumask.h>
iap10@3833 13
kaf24@4455 14 extern void domain_relinquish_resources(struct domain *);
iap10@3833 15
awilliam@9485 16 /* Flush cache of domain d.
awilliam@9485 17 If sync_only is true, only synchronize I&D caches,
awilliam@9485 18 if false, flush and invalidate caches. */
awilliam@9485 19 extern void domain_cache_flush (struct domain *d, int sync_only);
awilliam@9485 20
awilliam@9741 21 /* Cleanly crash the current domain with a message. */
awilliam@9741 22 extern void panic_domain(struct pt_regs *, const char *, ...)
awilliam@9741 23 __attribute__ ((noreturn, format (printf, 2, 3)));
awilliam@9741 24
iap10@3833 25 struct arch_domain {
iap10@3833 26 struct mm_struct *mm;
awilliam@8831 27 unsigned long metaphysical_rr0;
awilliam@8831 28 unsigned long metaphysical_rr4;
awilliam@9685 29
awilliam@9685 30 /* There are two ranges of RID for a domain:
awilliam@9685 31 one big range, used to virtualize domain RID,
awilliam@9685 32 one small range for internal Xen use (metaphysical). */
awilliam@9685 33 /* Big range. */
iap10@3833 34 int starting_rid; /* first RID assigned to domain */
iap10@3833 35 int ending_rid; /* one beyond highest RID assigned to domain */
iap10@3833 36 int rid_bits; /* number of virtual rid bits (default: 18) */
awilliam@9685 37 /* Metaphysical range. */
awilliam@9685 38 int starting_mp_rid;
awilliam@9685 39 int ending_mp_rid;
awilliam@9685 40
awilliam@9685 41 int breakimm; /* The imm value for hypercalls. */
fred@5986 42
awilliam@9489 43 int physmap_built; /* Whether is physmap built or not */
adsharma@4993 44 int imp_va_msb;
djm@6799 45 /* System pages out of guest memory, like for xenstore/console */
djm@6799 46 unsigned long sys_pgnr;
djm@6799 47 unsigned long max_pfn; /* Max pfn including I/O holes */
kaf24@8708 48 struct virtual_platform_def vmx_platform;
kaf24@8708 49 #define hvm_domain vmx_platform /* platform defs are not vmx specific */
fred@5986 50
iap10@3833 51 u64 xen_vastart;
iap10@3833 52 u64 xen_vaend;
iap10@3833 53 u64 shared_info_va;
djm@8380 54 unsigned long initrd_start;
djm@8380 55 unsigned long initrd_len;
djm@8380 56 char *cmdline;
iap10@3833 57 };
iap10@3833 58 #define xen_vastart arch.xen_vastart
iap10@3833 59 #define xen_vaend arch.xen_vaend
iap10@3833 60 #define shared_info_va arch.shared_info_va
awilliam@9479 61 #define INT_ENABLE_OFFSET(v) \
awilliam@9479 62 (sizeof(vcpu_info_t) * (v)->vcpu_id + \
awilliam@9479 63 offsetof(vcpu_info_t, evtchn_upcall_mask))
iap10@3833 64
kaf24@5289 65 struct arch_vcpu {
djm@4806 66 TR_ENTRY itrs[NITRS];
djm@4806 67 TR_ENTRY dtrs[NDTRS];
djm@4806 68 TR_ENTRY itlb;
djm@4806 69 TR_ENTRY dtlb;
djm@7335 70 unsigned int itr_regions;
djm@7335 71 unsigned int dtr_regions;
djm@4806 72 unsigned long itlb_pte;
djm@4806 73 unsigned long dtlb_pte;
djm@4806 74 unsigned long irr[4];
djm@4806 75 unsigned long insvc[4];
awilliam@9765 76 unsigned long tc_regions;
awilliam@9765 77 unsigned long iva;
djm@4806 78 unsigned long dcr;
djm@4806 79 unsigned long itc;
djm@4806 80 unsigned long domain_itm;
djm@4806 81 unsigned long domain_itm_last;
djm@4806 82 unsigned long xen_itm;
awilliam@9770 83
djm@6801 84 mapped_regs_t *privregs; /* save the state of vcpu */
awilliam@9770 85
awilliam@9770 86 /* These fields are copied from arch_domain to make access easier/faster
awilliam@9770 87 in assembly code. */
awilliam@8831 88 unsigned long metaphysical_rr0; // from arch_domain (so is pinned)
awilliam@8831 89 unsigned long metaphysical_rr4; // from arch_domain (so is pinned)
awilliam@8831 90 unsigned long metaphysical_saved_rr0; // from arch_domain (so is pinned)
awilliam@8831 91 unsigned long metaphysical_saved_rr4; // from arch_domain (so is pinned)
djm@5264 92 int breakimm; // from arch_domain (so is pinned)
djm@5526 93 int starting_rid; /* first RID assigned to domain */
djm@5526 94 int ending_rid; /* one beyond highest RID assigned to domain */
awilliam@9770 95
djm@4806 96 struct thread_struct _thread; // this must be last
fred@5986 97
awilliam@9765 98 thash_cb_t vtlb;
awilliam@9765 99 thash_cb_t vhpt;
djm@5797 100 char irq_new_pending;
djm@5797 101 char irq_new_condition; // vpsr.i/vtpr change, check for pending VHPI
fred@5949 102 char hypercall_continuation;
adsharma@4993 103 //for phycial emulation
adsharma@4993 104 unsigned long old_rsc;
adsharma@4993 105 int mode_flags;
adsharma@4993 106 struct arch_vmx_struct arch_vmx; /* Virtual Machine Extensions */
iap10@3833 107 };
djm@4806 108
djm@4840 109 //#define thread arch._thread
iap10@3833 110
iap10@3833 111 // FOLLOWING FROM linux-2.6.7/include/sched.h
iap10@3833 112
iap10@3833 113 struct mm_struct {
iap10@3833 114 pgd_t * pgd;
awilliam@9770 115 // atomic_t mm_users; /* How many users with user space? */
awilliam@9163 116 struct list_head pt_list; /* List of pagetable */
iap10@3833 117 };
iap10@3833 118
iap10@3833 119 extern struct mm_struct init_mm;
iap10@3833 120
awilliam@9756 121 struct page_info * assign_new_domain_page(struct domain *d, unsigned long mpaddr);
awilliam@9756 122 void assign_new_domain0_page(struct domain *d, unsigned long mpaddr);
awilliam@9756 123 void assign_domain_page(struct domain *d, unsigned long mpaddr, unsigned long physaddr);
awilliam@9756 124 void assign_domain_io_page(struct domain *d, unsigned long mpaddr, unsigned long flags);
awilliam@9756 125 #ifdef CONFIG_XEN_IA64_DOM0_VP
awilliam@9756 126 unsigned long assign_domain_mmio_page(struct domain *d, unsigned long mpaddr, unsigned long size);
awilliam@9756 127 unsigned long assign_domain_mach_page(struct domain *d, unsigned long mpaddr, unsigned long size);
awilliam@9759 128 unsigned long do_dom0vp_op(unsigned long cmd, unsigned long arg0, unsigned long arg1, unsigned long arg2, unsigned long arg3);
awilliam@9759 129 unsigned long dom0vp_populate_physmap(struct domain *d, unsigned long gpfn, unsigned int extent_order, unsigned int address_bits);
awilliam@9759 130 unsigned long dom0vp_zap_physmap(struct domain *d, unsigned long gpfn, unsigned int extent_order);
awilliam@9759 131 unsigned long dom0vp_add_physmap(struct domain* d, unsigned long gpfn, unsigned long mfn, unsigned int flags, domid_t domid);
awilliam@9756 132 #endif
awilliam@9756 133
iap10@3833 134 #include <asm/uaccess.h> /* for KERNEL_DS */
iap10@3833 135 #include <asm/pgtable.h>
iap10@3833 136
iap10@3833 137 #endif /* __ASM_DOMAIN_H__ */
kaf24@3914 138
kaf24@3914 139 /*
kaf24@3914 140 * Local variables:
kaf24@3914 141 * mode: C
kaf24@3914 142 * c-set-style: "BSD"
kaf24@3914 143 * c-basic-offset: 4
kaf24@3914 144 * tab-width: 4
kaf24@3914 145 * indent-tabs-mode: nil
kaf24@3988 146 * End:
kaf24@3914 147 */