diff options
Diffstat (limited to 'arch/ia64/include/asm/xen')
| -rw-r--r-- | arch/ia64/include/asm/xen/hypervisor.h | 39 | ||||
| -rw-r--r-- | arch/ia64/include/asm/xen/inst.h | 28 | ||||
| -rw-r--r-- | arch/ia64/include/asm/xen/interface.h | 9 | ||||
| -rw-r--r-- | arch/ia64/include/asm/xen/minstate.h | 11 | ||||
| -rw-r--r-- | arch/ia64/include/asm/xen/patchlist.h | 38 | ||||
| -rw-r--r-- | arch/ia64/include/asm/xen/privop.h | 8 |
6 files changed, 110 insertions, 23 deletions
diff --git a/arch/ia64/include/asm/xen/hypervisor.h b/arch/ia64/include/asm/xen/hypervisor.h index 7a804e80fc67..e425227a418e 100644 --- a/arch/ia64/include/asm/xen/hypervisor.h +++ b/arch/ia64/include/asm/xen/hypervisor.h | |||
| @@ -33,9 +33,6 @@ | |||
| 33 | #ifndef _ASM_IA64_XEN_HYPERVISOR_H | 33 | #ifndef _ASM_IA64_XEN_HYPERVISOR_H |
| 34 | #define _ASM_IA64_XEN_HYPERVISOR_H | 34 | #define _ASM_IA64_XEN_HYPERVISOR_H |
| 35 | 35 | ||
| 36 | #ifdef CONFIG_XEN | ||
| 37 | |||
| 38 | #include <linux/init.h> | ||
| 39 | #include <xen/interface/xen.h> | 36 | #include <xen/interface/xen.h> |
| 40 | #include <xen/interface/version.h> /* to compile feature.c */ | 37 | #include <xen/interface/version.h> /* to compile feature.c */ |
| 41 | #include <xen/features.h> /* to comiple xen-netfront.c */ | 38 | #include <xen/features.h> /* to comiple xen-netfront.c */ |
| @@ -43,22 +40,32 @@ | |||
| 43 | 40 | ||
| 44 | /* xen_domain_type is set before executing any C code by early_xen_setup */ | 41 | /* xen_domain_type is set before executing any C code by early_xen_setup */ |
| 45 | enum xen_domain_type { | 42 | enum xen_domain_type { |
| 46 | XEN_NATIVE, | 43 | XEN_NATIVE, /* running on bare hardware */ |
| 47 | XEN_PV_DOMAIN, | 44 | XEN_PV_DOMAIN, /* running in a PV domain */ |
| 48 | XEN_HVM_DOMAIN, | 45 | XEN_HVM_DOMAIN, /* running in a Xen hvm domain*/ |
| 49 | }; | 46 | }; |
| 50 | 47 | ||
| 48 | #ifdef CONFIG_XEN | ||
| 51 | extern enum xen_domain_type xen_domain_type; | 49 | extern enum xen_domain_type xen_domain_type; |
| 50 | #else | ||
| 51 | #define xen_domain_type XEN_NATIVE | ||
| 52 | #endif | ||
| 52 | 53 | ||
| 53 | #define xen_domain() (xen_domain_type != XEN_NATIVE) | 54 | #define xen_domain() (xen_domain_type != XEN_NATIVE) |
| 54 | #define xen_pv_domain() (xen_domain_type == XEN_PV_DOMAIN) | 55 | #define xen_pv_domain() (xen_domain() && \ |
| 55 | #define xen_initial_domain() (xen_pv_domain() && \ | 56 | xen_domain_type == XEN_PV_DOMAIN) |
| 57 | #define xen_hvm_domain() (xen_domain() && \ | ||
| 58 | xen_domain_type == XEN_HVM_DOMAIN) | ||
| 59 | |||
| 60 | #ifdef CONFIG_XEN_DOM0 | ||
| 61 | #define xen_initial_domain() (xen_pv_domain() && \ | ||
| 56 | (xen_start_info->flags & SIF_INITDOMAIN)) | 62 | (xen_start_info->flags & SIF_INITDOMAIN)) |
| 57 | #define xen_hvm_domain() (xen_domain_type == XEN_HVM_DOMAIN) | 63 | #else |
| 64 | #define xen_initial_domain() (0) | ||
| 65 | #endif | ||
| 58 | 66 | ||
| 59 | /* deprecated. remove this */ | ||
| 60 | #define is_running_on_xen() (xen_domain_type == XEN_PV_DOMAIN) | ||
| 61 | 67 | ||
| 68 | #ifdef CONFIG_XEN | ||
| 62 | extern struct shared_info *HYPERVISOR_shared_info; | 69 | extern struct shared_info *HYPERVISOR_shared_info; |
| 63 | extern struct start_info *xen_start_info; | 70 | extern struct start_info *xen_start_info; |
| 64 | 71 | ||
| @@ -74,16 +81,6 @@ void force_evtchn_callback(void); | |||
| 74 | 81 | ||
| 75 | /* For setup_arch() in arch/ia64/kernel/setup.c */ | 82 | /* For setup_arch() in arch/ia64/kernel/setup.c */ |
| 76 | void xen_ia64_enable_opt_feature(void); | 83 | void xen_ia64_enable_opt_feature(void); |
| 77 | |||
| 78 | #else /* CONFIG_XEN */ | ||
| 79 | |||
| 80 | #define xen_domain() (0) | ||
| 81 | #define xen_pv_domain() (0) | ||
| 82 | #define xen_initial_domain() (0) | ||
| 83 | #define xen_hvm_domain() (0) | ||
| 84 | #define is_running_on_xen() (0) /* deprecated. remove this */ | ||
| 85 | #endif | 84 | #endif |
| 86 | 85 | ||
| 87 | #define is_initial_xendomain() (0) /* deprecated. remove this */ | ||
| 88 | |||
| 89 | #endif /* _ASM_IA64_XEN_HYPERVISOR_H */ | 86 | #endif /* _ASM_IA64_XEN_HYPERVISOR_H */ |
diff --git a/arch/ia64/include/asm/xen/inst.h b/arch/ia64/include/asm/xen/inst.h index 19c2ae1d878a..c53a47611208 100644 --- a/arch/ia64/include/asm/xen/inst.h +++ b/arch/ia64/include/asm/xen/inst.h | |||
| @@ -33,6 +33,9 @@ | |||
| 33 | #define __paravirt_work_processed_syscall_target \ | 33 | #define __paravirt_work_processed_syscall_target \ |
| 34 | xen_work_processed_syscall | 34 | xen_work_processed_syscall |
| 35 | 35 | ||
| 36 | #define paravirt_fsyscall_table xen_fsyscall_table | ||
| 37 | #define paravirt_fsys_bubble_down xen_fsys_bubble_down | ||
| 38 | |||
| 36 | #define MOV_FROM_IFA(reg) \ | 39 | #define MOV_FROM_IFA(reg) \ |
| 37 | movl reg = XSI_IFA; \ | 40 | movl reg = XSI_IFA; \ |
| 38 | ;; \ | 41 | ;; \ |
| @@ -110,6 +113,27 @@ | |||
| 110 | .endm | 113 | .endm |
| 111 | #define MOV_FROM_PSR(pred, reg, clob) __MOV_FROM_PSR pred, reg, clob | 114 | #define MOV_FROM_PSR(pred, reg, clob) __MOV_FROM_PSR pred, reg, clob |
| 112 | 115 | ||
| 116 | /* assuming ar.itc is read with interrupt disabled. */ | ||
| 117 | #define MOV_FROM_ITC(pred, pred_clob, reg, clob) \ | ||
| 118 | (pred) movl clob = XSI_ITC_OFFSET; \ | ||
| 119 | ;; \ | ||
| 120 | (pred) ld8 clob = [clob]; \ | ||
| 121 | (pred) mov reg = ar.itc; \ | ||
| 122 | ;; \ | ||
| 123 | (pred) add reg = reg, clob; \ | ||
| 124 | ;; \ | ||
| 125 | (pred) movl clob = XSI_ITC_LAST; \ | ||
| 126 | ;; \ | ||
| 127 | (pred) ld8 clob = [clob]; \ | ||
| 128 | ;; \ | ||
| 129 | (pred) cmp.geu.unc pred_clob, p0 = clob, reg; \ | ||
| 130 | ;; \ | ||
| 131 | (pred_clob) add reg = 1, clob; \ | ||
| 132 | ;; \ | ||
| 133 | (pred) movl clob = XSI_ITC_LAST; \ | ||
| 134 | ;; \ | ||
| 135 | (pred) st8 [clob] = reg | ||
| 136 | |||
| 113 | 137 | ||
| 114 | #define MOV_TO_IFA(reg, clob) \ | 138 | #define MOV_TO_IFA(reg, clob) \ |
| 115 | movl clob = XSI_IFA; \ | 139 | movl clob = XSI_IFA; \ |
| @@ -362,6 +386,10 @@ | |||
| 362 | #define RSM_PSR_DT \ | 386 | #define RSM_PSR_DT \ |
| 363 | XEN_HYPER_RSM_PSR_DT | 387 | XEN_HYPER_RSM_PSR_DT |
| 364 | 388 | ||
| 389 | #define RSM_PSR_BE_I(clob0, clob1) \ | ||
| 390 | RSM_PSR_I(p0, clob0, clob1); \ | ||
| 391 | rum psr.be | ||
| 392 | |||
| 365 | #define SSM_PSR_DT_AND_SRLZ_I \ | 393 | #define SSM_PSR_DT_AND_SRLZ_I \ |
| 366 | XEN_HYPER_SSM_PSR_DT | 394 | XEN_HYPER_SSM_PSR_DT |
| 367 | 395 | ||
diff --git a/arch/ia64/include/asm/xen/interface.h b/arch/ia64/include/asm/xen/interface.h index f00fab40854d..e951e740bdf2 100644 --- a/arch/ia64/include/asm/xen/interface.h +++ b/arch/ia64/include/asm/xen/interface.h | |||
| @@ -209,6 +209,15 @@ struct mapped_regs { | |||
| 209 | unsigned long krs[8]; /* kernel registers */ | 209 | unsigned long krs[8]; /* kernel registers */ |
| 210 | unsigned long tmp[16]; /* temp registers | 210 | unsigned long tmp[16]; /* temp registers |
| 211 | (e.g. for hyperprivops) */ | 211 | (e.g. for hyperprivops) */ |
| 212 | |||
| 213 | /* itc paravirtualization | ||
| 214 | * vAR.ITC = mAR.ITC + itc_offset | ||
| 215 | * itc_last is one which was lastly passed to | ||
| 216 | * the guest OS in order to prevent it from | ||
| 217 | * going backwords. | ||
| 218 | */ | ||
| 219 | unsigned long itc_offset; | ||
| 220 | unsigned long itc_last; | ||
| 212 | }; | 221 | }; |
| 213 | }; | 222 | }; |
| 214 | }; | 223 | }; |
diff --git a/arch/ia64/include/asm/xen/minstate.h b/arch/ia64/include/asm/xen/minstate.h index 4d92d9bbda7b..c57fa910f2c9 100644 --- a/arch/ia64/include/asm/xen/minstate.h +++ b/arch/ia64/include/asm/xen/minstate.h | |||
| @@ -1,3 +1,12 @@ | |||
| 1 | |||
| 2 | #ifdef CONFIG_VIRT_CPU_ACCOUNTING | ||
| 3 | /* read ar.itc in advance, and use it before leaving bank 0 */ | ||
| 4 | #define XEN_ACCOUNT_GET_STAMP \ | ||
| 5 | MOV_FROM_ITC(pUStk, p6, r20, r2); | ||
| 6 | #else | ||
| 7 | #define XEN_ACCOUNT_GET_STAMP | ||
| 8 | #endif | ||
| 9 | |||
| 1 | /* | 10 | /* |
| 2 | * DO_SAVE_MIN switches to the kernel stacks (if necessary) and saves | 11 | * DO_SAVE_MIN switches to the kernel stacks (if necessary) and saves |
| 3 | * the minimum state necessary that allows us to turn psr.ic back | 12 | * the minimum state necessary that allows us to turn psr.ic back |
| @@ -123,7 +132,7 @@ | |||
| 123 | ;; \ | 132 | ;; \ |
| 124 | .mem.offset 0,0; st8.spill [r16]=r2,16; \ | 133 | .mem.offset 0,0; st8.spill [r16]=r2,16; \ |
| 125 | .mem.offset 8,0; st8.spill [r17]=r3,16; \ | 134 | .mem.offset 8,0; st8.spill [r17]=r3,16; \ |
| 126 | ACCOUNT_GET_STAMP \ | 135 | XEN_ACCOUNT_GET_STAMP \ |
| 127 | adds r2=IA64_PT_REGS_R16_OFFSET,r1; \ | 136 | adds r2=IA64_PT_REGS_R16_OFFSET,r1; \ |
| 128 | ;; \ | 137 | ;; \ |
| 129 | EXTRA; \ | 138 | EXTRA; \ |
diff --git a/arch/ia64/include/asm/xen/patchlist.h b/arch/ia64/include/asm/xen/patchlist.h new file mode 100644 index 000000000000..eae944e88846 --- /dev/null +++ b/arch/ia64/include/asm/xen/patchlist.h | |||
| @@ -0,0 +1,38 @@ | |||
| 1 | /****************************************************************************** | ||
| 2 | * arch/ia64/include/asm/xen/patchlist.h | ||
| 3 | * | ||
| 4 | * Copyright (c) 2008 Isaku Yamahata <yamahata at valinux co jp> | ||
| 5 | * VA Linux Systems Japan K.K. | ||
| 6 | * | ||
| 7 | * This program is free software; you can redistribute it and/or modify | ||
| 8 | * it under the terms of the GNU General Public License as published by | ||
| 9 | * the Free Software Foundation; either version 2 of the License, or | ||
| 10 | * (at your option) any later version. | ||
| 11 | * | ||
| 12 | * This program is distributed in the hope that it will be useful, | ||
| 13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 15 | * GNU General Public License for more details. | ||
| 16 | * | ||
| 17 | * You should have received a copy of the GNU General Public License | ||
| 18 | * along with this program; if not, write to the Free Software | ||
| 19 | * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | ||
| 20 | * | ||
| 21 | */ | ||
| 22 | |||
| 23 | #define __paravirt_start_gate_fsyscall_patchlist \ | ||
| 24 | __xen_start_gate_fsyscall_patchlist | ||
| 25 | #define __paravirt_end_gate_fsyscall_patchlist \ | ||
| 26 | __xen_end_gate_fsyscall_patchlist | ||
| 27 | #define __paravirt_start_gate_brl_fsys_bubble_down_patchlist \ | ||
| 28 | __xen_start_gate_brl_fsys_bubble_down_patchlist | ||
| 29 | #define __paravirt_end_gate_brl_fsys_bubble_down_patchlist \ | ||
| 30 | __xen_end_gate_brl_fsys_bubble_down_patchlist | ||
| 31 | #define __paravirt_start_gate_vtop_patchlist \ | ||
| 32 | __xen_start_gate_vtop_patchlist | ||
| 33 | #define __paravirt_end_gate_vtop_patchlist \ | ||
| 34 | __xen_end_gate_vtop_patchlist | ||
| 35 | #define __paravirt_start_gate_mckinley_e9_patchlist \ | ||
| 36 | __xen_start_gate_mckinley_e9_patchlist | ||
| 37 | #define __paravirt_end_gate_mckinley_e9_patchlist \ | ||
| 38 | __xen_end_gate_mckinley_e9_patchlist | ||
diff --git a/arch/ia64/include/asm/xen/privop.h b/arch/ia64/include/asm/xen/privop.h index 71ec7546e100..fb4ec5e0b066 100644 --- a/arch/ia64/include/asm/xen/privop.h +++ b/arch/ia64/include/asm/xen/privop.h | |||
| @@ -55,6 +55,8 @@ | |||
| 55 | #define XSI_BANK1_R16 (XSI_BASE + XSI_BANK1_R16_OFS) | 55 | #define XSI_BANK1_R16 (XSI_BASE + XSI_BANK1_R16_OFS) |
| 56 | #define XSI_BANKNUM (XSI_BASE + XSI_BANKNUM_OFS) | 56 | #define XSI_BANKNUM (XSI_BASE + XSI_BANKNUM_OFS) |
| 57 | #define XSI_IHA (XSI_BASE + XSI_IHA_OFS) | 57 | #define XSI_IHA (XSI_BASE + XSI_IHA_OFS) |
| 58 | #define XSI_ITC_OFFSET (XSI_BASE + XSI_ITC_OFFSET_OFS) | ||
| 59 | #define XSI_ITC_LAST (XSI_BASE + XSI_ITC_LAST_OFS) | ||
| 58 | #endif | 60 | #endif |
| 59 | 61 | ||
| 60 | #ifndef __ASSEMBLY__ | 62 | #ifndef __ASSEMBLY__ |
| @@ -67,7 +69,7 @@ | |||
| 67 | * may have different semantics depending on whether they are executed | 69 | * may have different semantics depending on whether they are executed |
| 68 | * at PL0 vs PL!=0. When paravirtualized, these instructions mustn't | 70 | * at PL0 vs PL!=0. When paravirtualized, these instructions mustn't |
| 69 | * be allowed to execute directly, lest incorrect semantics result. */ | 71 | * be allowed to execute directly, lest incorrect semantics result. */ |
| 70 | extern void xen_fc(unsigned long addr); | 72 | extern void xen_fc(void *addr); |
| 71 | extern unsigned long xen_thash(unsigned long addr); | 73 | extern unsigned long xen_thash(unsigned long addr); |
| 72 | 74 | ||
| 73 | /* Note that "ttag" and "cover" are also privilege-sensitive; "ttag" | 75 | /* Note that "ttag" and "cover" are also privilege-sensitive; "ttag" |
| @@ -80,8 +82,10 @@ extern unsigned long xen_thash(unsigned long addr); | |||
| 80 | extern unsigned long xen_get_cpuid(int index); | 82 | extern unsigned long xen_get_cpuid(int index); |
| 81 | extern unsigned long xen_get_pmd(int index); | 83 | extern unsigned long xen_get_pmd(int index); |
| 82 | 84 | ||
| 85 | #ifndef ASM_SUPPORTED | ||
| 83 | extern unsigned long xen_get_eflag(void); /* see xen_ia64_getreg */ | 86 | extern unsigned long xen_get_eflag(void); /* see xen_ia64_getreg */ |
| 84 | extern void xen_set_eflag(unsigned long); /* see xen_ia64_setreg */ | 87 | extern void xen_set_eflag(unsigned long); /* see xen_ia64_setreg */ |
| 88 | #endif | ||
| 85 | 89 | ||
| 86 | /************************************************/ | 90 | /************************************************/ |
| 87 | /* Instructions paravirtualized for performance */ | 91 | /* Instructions paravirtualized for performance */ |
| @@ -106,6 +110,7 @@ extern void xen_set_eflag(unsigned long); /* see xen_ia64_setreg */ | |||
| 106 | #define xen_get_virtual_pend() \ | 110 | #define xen_get_virtual_pend() \ |
| 107 | (*(((uint8_t *)XEN_MAPPEDREGS->interrupt_mask_addr) - 1)) | 111 | (*(((uint8_t *)XEN_MAPPEDREGS->interrupt_mask_addr) - 1)) |
| 108 | 112 | ||
| 113 | #ifndef ASM_SUPPORTED | ||
| 109 | /* Although all privileged operations can be left to trap and will | 114 | /* Although all privileged operations can be left to trap and will |
| 110 | * be properly handled by Xen, some are frequent enough that we use | 115 | * be properly handled by Xen, some are frequent enough that we use |
| 111 | * hyperprivops for performance. */ | 116 | * hyperprivops for performance. */ |
| @@ -123,6 +128,7 @@ extern void xen_set_rr0_to_rr4(unsigned long val0, unsigned long val1, | |||
| 123 | unsigned long val4); | 128 | unsigned long val4); |
| 124 | extern void xen_set_kr(unsigned long index, unsigned long val); | 129 | extern void xen_set_kr(unsigned long index, unsigned long val); |
| 125 | extern void xen_ptcga(unsigned long addr, unsigned long size); | 130 | extern void xen_ptcga(unsigned long addr, unsigned long size); |
| 131 | #endif /* !ASM_SUPPORTED */ | ||
| 126 | 132 | ||
| 127 | #endif /* !__ASSEMBLY__ */ | 133 | #endif /* !__ASSEMBLY__ */ |
| 128 | 134 | ||
