diff options
author | Tony Luck <tony.luck@intel.com> | 2008-07-17 13:53:37 -0400 |
---|---|---|
committer | Tony Luck <tony.luck@intel.com> | 2008-07-17 13:53:37 -0400 |
commit | fca515fbfa5ecd9f7b54db311317e2c877d7831a (patch) | |
tree | 66b44028b3ab5be068be78650932812520d78865 /include | |
parent | 2b04be7e8ab5756ea36e137dd03c8773d184e67e (diff) | |
parent | 4d58bbcc89e267d52b4df572acbf209a60a8a497 (diff) |
Pull pvops into release branch
Diffstat (limited to 'include')
-rw-r--r-- | include/asm-ia64/Kbuild | 2 | ||||
-rw-r--r-- | include/asm-ia64/gcc_intrin.h | 24 | ||||
-rw-r--r-- | include/asm-ia64/hw_irq.h | 23 | ||||
-rw-r--r-- | include/asm-ia64/intel_intrin.h | 41 | ||||
-rw-r--r-- | include/asm-ia64/intrinsics.h | 55 | ||||
-rw-r--r-- | include/asm-ia64/iosapic.h | 18 | ||||
-rw-r--r-- | include/asm-ia64/irq.h | 9 | ||||
-rw-r--r-- | include/asm-ia64/mmu_context.h | 6 | ||||
-rw-r--r-- | include/asm-ia64/native/inst.h | 175 | ||||
-rw-r--r-- | include/asm-ia64/native/irq.h | 35 | ||||
-rw-r--r-- | include/asm-ia64/paravirt.h | 255 | ||||
-rw-r--r-- | include/asm-ia64/paravirt_privop.h | 114 | ||||
-rw-r--r-- | include/asm-ia64/smp.h | 2 | ||||
-rw-r--r-- | include/asm-ia64/system.h | 11 |
14 files changed, 716 insertions, 54 deletions
diff --git a/include/asm-ia64/Kbuild b/include/asm-ia64/Kbuild index eb24a3f47caa..ccbe8ae47a61 100644 --- a/include/asm-ia64/Kbuild +++ b/include/asm-ia64/Kbuild | |||
@@ -5,12 +5,12 @@ header-y += fpu.h | |||
5 | header-y += fpswa.h | 5 | header-y += fpswa.h |
6 | header-y += ia64regs.h | 6 | header-y += ia64regs.h |
7 | header-y += intel_intrin.h | 7 | header-y += intel_intrin.h |
8 | header-y += intrinsics.h | ||
9 | header-y += perfmon_default_smpl.h | 8 | header-y += perfmon_default_smpl.h |
10 | header-y += ptrace_offsets.h | 9 | header-y += ptrace_offsets.h |
11 | header-y += rse.h | 10 | header-y += rse.h |
12 | header-y += ucontext.h | 11 | header-y += ucontext.h |
13 | 12 | ||
14 | unifdef-y += gcc_intrin.h | 13 | unifdef-y += gcc_intrin.h |
14 | unifdef-y += intrinsics.h | ||
15 | unifdef-y += perfmon.h | 15 | unifdef-y += perfmon.h |
16 | unifdef-y += ustack.h | 16 | unifdef-y += ustack.h |
diff --git a/include/asm-ia64/gcc_intrin.h b/include/asm-ia64/gcc_intrin.h index 2fe292c275fe..0f5b55921758 100644 --- a/include/asm-ia64/gcc_intrin.h +++ b/include/asm-ia64/gcc_intrin.h | |||
@@ -32,7 +32,7 @@ extern void ia64_bad_param_for_getreg (void); | |||
32 | register unsigned long ia64_r13 asm ("r13") __used; | 32 | register unsigned long ia64_r13 asm ("r13") __used; |
33 | #endif | 33 | #endif |
34 | 34 | ||
35 | #define ia64_setreg(regnum, val) \ | 35 | #define ia64_native_setreg(regnum, val) \ |
36 | ({ \ | 36 | ({ \ |
37 | switch (regnum) { \ | 37 | switch (regnum) { \ |
38 | case _IA64_REG_PSR_L: \ | 38 | case _IA64_REG_PSR_L: \ |
@@ -61,7 +61,7 @@ register unsigned long ia64_r13 asm ("r13") __used; | |||
61 | } \ | 61 | } \ |
62 | }) | 62 | }) |
63 | 63 | ||
64 | #define ia64_getreg(regnum) \ | 64 | #define ia64_native_getreg(regnum) \ |
65 | ({ \ | 65 | ({ \ |
66 | __u64 ia64_intri_res; \ | 66 | __u64 ia64_intri_res; \ |
67 | \ | 67 | \ |
@@ -385,7 +385,7 @@ register unsigned long ia64_r13 asm ("r13") __used; | |||
385 | 385 | ||
386 | #define ia64_invala() asm volatile ("invala" ::: "memory") | 386 | #define ia64_invala() asm volatile ("invala" ::: "memory") |
387 | 387 | ||
388 | #define ia64_thash(addr) \ | 388 | #define ia64_native_thash(addr) \ |
389 | ({ \ | 389 | ({ \ |
390 | __u64 ia64_intri_res; \ | 390 | __u64 ia64_intri_res; \ |
391 | asm volatile ("thash %0=%1" : "=r"(ia64_intri_res) : "r" (addr)); \ | 391 | asm volatile ("thash %0=%1" : "=r"(ia64_intri_res) : "r" (addr)); \ |
@@ -438,10 +438,10 @@ register unsigned long ia64_r13 asm ("r13") __used; | |||
438 | #define ia64_set_pmd(index, val) \ | 438 | #define ia64_set_pmd(index, val) \ |
439 | asm volatile ("mov pmd[%0]=%1" :: "r"(index), "r"(val) : "memory") | 439 | asm volatile ("mov pmd[%0]=%1" :: "r"(index), "r"(val) : "memory") |
440 | 440 | ||
441 | #define ia64_set_rr(index, val) \ | 441 | #define ia64_native_set_rr(index, val) \ |
442 | asm volatile ("mov rr[%0]=%1" :: "r"(index), "r"(val) : "memory"); | 442 | asm volatile ("mov rr[%0]=%1" :: "r"(index), "r"(val) : "memory"); |
443 | 443 | ||
444 | #define ia64_get_cpuid(index) \ | 444 | #define ia64_native_get_cpuid(index) \ |
445 | ({ \ | 445 | ({ \ |
446 | __u64 ia64_intri_res; \ | 446 | __u64 ia64_intri_res; \ |
447 | asm volatile ("mov %0=cpuid[%r1]" : "=r"(ia64_intri_res) : "rO"(index)); \ | 447 | asm volatile ("mov %0=cpuid[%r1]" : "=r"(ia64_intri_res) : "rO"(index)); \ |
@@ -477,33 +477,33 @@ register unsigned long ia64_r13 asm ("r13") __used; | |||
477 | }) | 477 | }) |
478 | 478 | ||
479 | 479 | ||
480 | #define ia64_get_pmd(index) \ | 480 | #define ia64_native_get_pmd(index) \ |
481 | ({ \ | 481 | ({ \ |
482 | __u64 ia64_intri_res; \ | 482 | __u64 ia64_intri_res; \ |
483 | asm volatile ("mov %0=pmd[%1]" : "=r"(ia64_intri_res) : "r"(index)); \ | 483 | asm volatile ("mov %0=pmd[%1]" : "=r"(ia64_intri_res) : "r"(index)); \ |
484 | ia64_intri_res; \ | 484 | ia64_intri_res; \ |
485 | }) | 485 | }) |
486 | 486 | ||
487 | #define ia64_get_rr(index) \ | 487 | #define ia64_native_get_rr(index) \ |
488 | ({ \ | 488 | ({ \ |
489 | __u64 ia64_intri_res; \ | 489 | __u64 ia64_intri_res; \ |
490 | asm volatile ("mov %0=rr[%1]" : "=r"(ia64_intri_res) : "r" (index)); \ | 490 | asm volatile ("mov %0=rr[%1]" : "=r"(ia64_intri_res) : "r" (index)); \ |
491 | ia64_intri_res; \ | 491 | ia64_intri_res; \ |
492 | }) | 492 | }) |
493 | 493 | ||
494 | #define ia64_fc(addr) asm volatile ("fc %0" :: "r"(addr) : "memory") | 494 | #define ia64_native_fc(addr) asm volatile ("fc %0" :: "r"(addr) : "memory") |
495 | 495 | ||
496 | 496 | ||
497 | #define ia64_sync_i() asm volatile (";; sync.i" ::: "memory") | 497 | #define ia64_sync_i() asm volatile (";; sync.i" ::: "memory") |
498 | 498 | ||
499 | #define ia64_ssm(mask) asm volatile ("ssm %0":: "i"((mask)) : "memory") | 499 | #define ia64_native_ssm(mask) asm volatile ("ssm %0":: "i"((mask)) : "memory") |
500 | #define ia64_rsm(mask) asm volatile ("rsm %0":: "i"((mask)) : "memory") | 500 | #define ia64_native_rsm(mask) asm volatile ("rsm %0":: "i"((mask)) : "memory") |
501 | #define ia64_sum(mask) asm volatile ("sum %0":: "i"((mask)) : "memory") | 501 | #define ia64_sum(mask) asm volatile ("sum %0":: "i"((mask)) : "memory") |
502 | #define ia64_rum(mask) asm volatile ("rum %0":: "i"((mask)) : "memory") | 502 | #define ia64_rum(mask) asm volatile ("rum %0":: "i"((mask)) : "memory") |
503 | 503 | ||
504 | #define ia64_ptce(addr) asm volatile ("ptc.e %0" :: "r"(addr)) | 504 | #define ia64_ptce(addr) asm volatile ("ptc.e %0" :: "r"(addr)) |
505 | 505 | ||
506 | #define ia64_ptcga(addr, size) \ | 506 | #define ia64_native_ptcga(addr, size) \ |
507 | do { \ | 507 | do { \ |
508 | asm volatile ("ptc.ga %0,%1" :: "r"(addr), "r"(size) : "memory"); \ | 508 | asm volatile ("ptc.ga %0,%1" :: "r"(addr), "r"(size) : "memory"); \ |
509 | ia64_dv_serialize_data(); \ | 509 | ia64_dv_serialize_data(); \ |
@@ -608,7 +608,7 @@ do { \ | |||
608 | } \ | 608 | } \ |
609 | }) | 609 | }) |
610 | 610 | ||
611 | #define ia64_intrin_local_irq_restore(x) \ | 611 | #define ia64_native_intrin_local_irq_restore(x) \ |
612 | do { \ | 612 | do { \ |
613 | asm volatile (";; cmp.ne p6,p7=%0,r0;;" \ | 613 | asm volatile (";; cmp.ne p6,p7=%0,r0;;" \ |
614 | "(p6) ssm psr.i;" \ | 614 | "(p6) ssm psr.i;" \ |
diff --git a/include/asm-ia64/hw_irq.h b/include/asm-ia64/hw_irq.h index 76366dc9c1a0..5c99cbcb8a0d 100644 --- a/include/asm-ia64/hw_irq.h +++ b/include/asm-ia64/hw_irq.h | |||
@@ -15,7 +15,11 @@ | |||
15 | #include <asm/ptrace.h> | 15 | #include <asm/ptrace.h> |
16 | #include <asm/smp.h> | 16 | #include <asm/smp.h> |
17 | 17 | ||
18 | #ifndef CONFIG_PARAVIRT | ||
18 | typedef u8 ia64_vector; | 19 | typedef u8 ia64_vector; |
20 | #else | ||
21 | typedef u16 ia64_vector; | ||
22 | #endif | ||
19 | 23 | ||
20 | /* | 24 | /* |
21 | * 0 special | 25 | * 0 special |
@@ -104,13 +108,24 @@ DECLARE_PER_CPU(int[IA64_NUM_VECTORS], vector_irq); | |||
104 | 108 | ||
105 | extern struct hw_interrupt_type irq_type_ia64_lsapic; /* CPU-internal interrupt controller */ | 109 | extern struct hw_interrupt_type irq_type_ia64_lsapic; /* CPU-internal interrupt controller */ |
106 | 110 | ||
111 | #ifdef CONFIG_PARAVIRT_GUEST | ||
112 | #include <asm/paravirt.h> | ||
113 | #else | ||
114 | #define ia64_register_ipi ia64_native_register_ipi | ||
115 | #define assign_irq_vector ia64_native_assign_irq_vector | ||
116 | #define free_irq_vector ia64_native_free_irq_vector | ||
117 | #define register_percpu_irq ia64_native_register_percpu_irq | ||
118 | #define ia64_resend_irq ia64_native_resend_irq | ||
119 | #endif | ||
120 | |||
121 | extern void ia64_native_register_ipi(void); | ||
107 | extern int bind_irq_vector(int irq, int vector, cpumask_t domain); | 122 | extern int bind_irq_vector(int irq, int vector, cpumask_t domain); |
108 | extern int assign_irq_vector (int irq); /* allocate a free vector */ | 123 | extern int ia64_native_assign_irq_vector (int irq); /* allocate a free vector */ |
109 | extern void free_irq_vector (int vector); | 124 | extern void ia64_native_free_irq_vector (int vector); |
110 | extern int reserve_irq_vector (int vector); | 125 | extern int reserve_irq_vector (int vector); |
111 | extern void __setup_vector_irq(int cpu); | 126 | extern void __setup_vector_irq(int cpu); |
112 | extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect); | 127 | extern void ia64_send_ipi (int cpu, int vector, int delivery_mode, int redirect); |
113 | extern void register_percpu_irq (ia64_vector vec, struct irqaction *action); | 128 | extern void ia64_native_register_percpu_irq (ia64_vector vec, struct irqaction *action); |
114 | extern int check_irq_used (int irq); | 129 | extern int check_irq_used (int irq); |
115 | extern void destroy_and_reserve_irq (unsigned int irq); | 130 | extern void destroy_and_reserve_irq (unsigned int irq); |
116 | 131 | ||
@@ -122,7 +137,7 @@ static inline int irq_prepare_move(int irq, int cpu) { return 0; } | |||
122 | static inline void irq_complete_move(unsigned int irq) {} | 137 | static inline void irq_complete_move(unsigned int irq) {} |
123 | #endif | 138 | #endif |
124 | 139 | ||
125 | static inline void ia64_resend_irq(unsigned int vector) | 140 | static inline void ia64_native_resend_irq(unsigned int vector) |
126 | { | 141 | { |
127 | platform_send_ipi(smp_processor_id(), vector, IA64_IPI_DM_INT, 0); | 142 | platform_send_ipi(smp_processor_id(), vector, IA64_IPI_DM_INT, 0); |
128 | } | 143 | } |
diff --git a/include/asm-ia64/intel_intrin.h b/include/asm-ia64/intel_intrin.h index a520d103d808..53cec577558a 100644 --- a/include/asm-ia64/intel_intrin.h +++ b/include/asm-ia64/intel_intrin.h | |||
@@ -16,8 +16,8 @@ | |||
16 | * intrinsic | 16 | * intrinsic |
17 | */ | 17 | */ |
18 | 18 | ||
19 | #define ia64_getreg __getReg | 19 | #define ia64_native_getreg __getReg |
20 | #define ia64_setreg __setReg | 20 | #define ia64_native_setreg __setReg |
21 | 21 | ||
22 | #define ia64_hint __hint | 22 | #define ia64_hint __hint |
23 | #define ia64_hint_pause __hint_pause | 23 | #define ia64_hint_pause __hint_pause |
@@ -39,10 +39,10 @@ | |||
39 | #define ia64_invala_fr __invala_fr | 39 | #define ia64_invala_fr __invala_fr |
40 | #define ia64_nop __nop | 40 | #define ia64_nop __nop |
41 | #define ia64_sum __sum | 41 | #define ia64_sum __sum |
42 | #define ia64_ssm __ssm | 42 | #define ia64_native_ssm __ssm |
43 | #define ia64_rum __rum | 43 | #define ia64_rum __rum |
44 | #define ia64_rsm __rsm | 44 | #define ia64_native_rsm __rsm |
45 | #define ia64_fc __fc | 45 | #define ia64_native_fc __fc |
46 | 46 | ||
47 | #define ia64_ldfs __ldfs | 47 | #define ia64_ldfs __ldfs |
48 | #define ia64_ldfd __ldfd | 48 | #define ia64_ldfd __ldfd |
@@ -88,16 +88,17 @@ | |||
88 | __setIndReg(_IA64_REG_INDR_PMC, index, val) | 88 | __setIndReg(_IA64_REG_INDR_PMC, index, val) |
89 | #define ia64_set_pmd(index, val) \ | 89 | #define ia64_set_pmd(index, val) \ |
90 | __setIndReg(_IA64_REG_INDR_PMD, index, val) | 90 | __setIndReg(_IA64_REG_INDR_PMD, index, val) |
91 | #define ia64_set_rr(index, val) \ | 91 | #define ia64_native_set_rr(index, val) \ |
92 | __setIndReg(_IA64_REG_INDR_RR, index, val) | 92 | __setIndReg(_IA64_REG_INDR_RR, index, val) |
93 | 93 | ||
94 | #define ia64_get_cpuid(index) __getIndReg(_IA64_REG_INDR_CPUID, index) | 94 | #define ia64_native_get_cpuid(index) \ |
95 | #define __ia64_get_dbr(index) __getIndReg(_IA64_REG_INDR_DBR, index) | 95 | __getIndReg(_IA64_REG_INDR_CPUID, index) |
96 | #define ia64_get_ibr(index) __getIndReg(_IA64_REG_INDR_IBR, index) | 96 | #define __ia64_get_dbr(index) __getIndReg(_IA64_REG_INDR_DBR, index) |
97 | #define ia64_get_pkr(index) __getIndReg(_IA64_REG_INDR_PKR, index) | 97 | #define ia64_get_ibr(index) __getIndReg(_IA64_REG_INDR_IBR, index) |
98 | #define ia64_get_pmc(index) __getIndReg(_IA64_REG_INDR_PMC, index) | 98 | #define ia64_get_pkr(index) __getIndReg(_IA64_REG_INDR_PKR, index) |
99 | #define ia64_get_pmd(index) __getIndReg(_IA64_REG_INDR_PMD, index) | 99 | #define ia64_get_pmc(index) __getIndReg(_IA64_REG_INDR_PMC, index) |
100 | #define ia64_get_rr(index) __getIndReg(_IA64_REG_INDR_RR, index) | 100 | #define ia64_native_get_pmd(index) __getIndReg(_IA64_REG_INDR_PMD, index) |
101 | #define ia64_native_get_rr(index) __getIndReg(_IA64_REG_INDR_RR, index) | ||
101 | 102 | ||
102 | #define ia64_srlz_d __dsrlz | 103 | #define ia64_srlz_d __dsrlz |
103 | #define ia64_srlz_i __isrlz | 104 | #define ia64_srlz_i __isrlz |
@@ -119,16 +120,16 @@ | |||
119 | #define ia64_ld8_acq __ld8_acq | 120 | #define ia64_ld8_acq __ld8_acq |
120 | 121 | ||
121 | #define ia64_sync_i __synci | 122 | #define ia64_sync_i __synci |
122 | #define ia64_thash __thash | 123 | #define ia64_native_thash __thash |
123 | #define ia64_ttag __ttag | 124 | #define ia64_native_ttag __ttag |
124 | #define ia64_itcd __itcd | 125 | #define ia64_itcd __itcd |
125 | #define ia64_itci __itci | 126 | #define ia64_itci __itci |
126 | #define ia64_itrd __itrd | 127 | #define ia64_itrd __itrd |
127 | #define ia64_itri __itri | 128 | #define ia64_itri __itri |
128 | #define ia64_ptce __ptce | 129 | #define ia64_ptce __ptce |
129 | #define ia64_ptcl __ptcl | 130 | #define ia64_ptcl __ptcl |
130 | #define ia64_ptcg __ptcg | 131 | #define ia64_native_ptcg __ptcg |
131 | #define ia64_ptcga __ptcga | 132 | #define ia64_native_ptcga __ptcga |
132 | #define ia64_ptri __ptri | 133 | #define ia64_ptri __ptri |
133 | #define ia64_ptrd __ptrd | 134 | #define ia64_ptrd __ptrd |
134 | #define ia64_dep_mi _m64_dep_mi | 135 | #define ia64_dep_mi _m64_dep_mi |
@@ -145,13 +146,13 @@ | |||
145 | #define ia64_lfetch_fault __lfetch_fault | 146 | #define ia64_lfetch_fault __lfetch_fault |
146 | #define ia64_lfetch_fault_excl __lfetch_fault_excl | 147 | #define ia64_lfetch_fault_excl __lfetch_fault_excl |
147 | 148 | ||
148 | #define ia64_intrin_local_irq_restore(x) \ | 149 | #define ia64_native_intrin_local_irq_restore(x) \ |
149 | do { \ | 150 | do { \ |
150 | if ((x) != 0) { \ | 151 | if ((x) != 0) { \ |
151 | ia64_ssm(IA64_PSR_I); \ | 152 | ia64_native_ssm(IA64_PSR_I); \ |
152 | ia64_srlz_d(); \ | 153 | ia64_srlz_d(); \ |
153 | } else { \ | 154 | } else { \ |
154 | ia64_rsm(IA64_PSR_I); \ | 155 | ia64_native_rsm(IA64_PSR_I); \ |
155 | } \ | 156 | } \ |
156 | } while (0) | 157 | } while (0) |
157 | 158 | ||
diff --git a/include/asm-ia64/intrinsics.h b/include/asm-ia64/intrinsics.h index f1135b5b94c3..47d686dba1eb 100644 --- a/include/asm-ia64/intrinsics.h +++ b/include/asm-ia64/intrinsics.h | |||
@@ -18,6 +18,17 @@ | |||
18 | # include <asm/gcc_intrin.h> | 18 | # include <asm/gcc_intrin.h> |
19 | #endif | 19 | #endif |
20 | 20 | ||
21 | #define ia64_native_get_psr_i() (ia64_native_getreg(_IA64_REG_PSR) & IA64_PSR_I) | ||
22 | |||
23 | #define ia64_native_set_rr0_to_rr4(val0, val1, val2, val3, val4) \ | ||
24 | do { \ | ||
25 | ia64_native_set_rr(0x0000000000000000UL, (val0)); \ | ||
26 | ia64_native_set_rr(0x2000000000000000UL, (val1)); \ | ||
27 | ia64_native_set_rr(0x4000000000000000UL, (val2)); \ | ||
28 | ia64_native_set_rr(0x6000000000000000UL, (val3)); \ | ||
29 | ia64_native_set_rr(0x8000000000000000UL, (val4)); \ | ||
30 | } while (0) | ||
31 | |||
21 | /* | 32 | /* |
22 | * Force an unresolved reference if someone tries to use | 33 | * Force an unresolved reference if someone tries to use |
23 | * ia64_fetch_and_add() with a bad value. | 34 | * ia64_fetch_and_add() with a bad value. |
@@ -183,4 +194,48 @@ extern long ia64_cmpxchg_called_with_bad_pointer (void); | |||
183 | #endif /* !CONFIG_IA64_DEBUG_CMPXCHG */ | 194 | #endif /* !CONFIG_IA64_DEBUG_CMPXCHG */ |
184 | 195 | ||
185 | #endif | 196 | #endif |
197 | |||
198 | #ifdef __KERNEL__ | ||
199 | #include <asm/paravirt_privop.h> | ||
200 | #endif | ||
201 | |||
202 | #ifndef __ASSEMBLY__ | ||
203 | #if defined(CONFIG_PARAVIRT) && defined(__KERNEL__) | ||
204 | #define IA64_INTRINSIC_API(name) pv_cpu_ops.name | ||
205 | #define IA64_INTRINSIC_MACRO(name) paravirt_ ## name | ||
206 | #else | ||
207 | #define IA64_INTRINSIC_API(name) ia64_native_ ## name | ||
208 | #define IA64_INTRINSIC_MACRO(name) ia64_native_ ## name | ||
209 | #endif | ||
210 | |||
211 | /************************************************/ | ||
212 | /* Instructions paravirtualized for correctness */ | ||
213 | /************************************************/ | ||
214 | /* fc, thash, get_cpuid, get_pmd, get_eflags, set_eflags */ | ||
215 | /* Note that "ttag" and "cover" are also privilege-sensitive; "ttag" | ||
216 | * is not currently used (though it may be in a long-format VHPT system!) | ||
217 | */ | ||
218 | #define ia64_fc IA64_INTRINSIC_API(fc) | ||
219 | #define ia64_thash IA64_INTRINSIC_API(thash) | ||
220 | #define ia64_get_cpuid IA64_INTRINSIC_API(get_cpuid) | ||
221 | #define ia64_get_pmd IA64_INTRINSIC_API(get_pmd) | ||
222 | |||
223 | |||
224 | /************************************************/ | ||
225 | /* Instructions paravirtualized for performance */ | ||
226 | /************************************************/ | ||
227 | #define ia64_ssm IA64_INTRINSIC_MACRO(ssm) | ||
228 | #define ia64_rsm IA64_INTRINSIC_MACRO(rsm) | ||
229 | #define ia64_getreg IA64_INTRINSIC_API(getreg) | ||
230 | #define ia64_setreg IA64_INTRINSIC_API(setreg) | ||
231 | #define ia64_set_rr IA64_INTRINSIC_API(set_rr) | ||
232 | #define ia64_get_rr IA64_INTRINSIC_API(get_rr) | ||
233 | #define ia64_ptcga IA64_INTRINSIC_API(ptcga) | ||
234 | #define ia64_get_psr_i IA64_INTRINSIC_API(get_psr_i) | ||
235 | #define ia64_intrin_local_irq_restore \ | ||
236 | IA64_INTRINSIC_API(intrin_local_irq_restore) | ||
237 | #define ia64_set_rr0_to_rr4 IA64_INTRINSIC_API(set_rr0_to_rr4) | ||
238 | |||
239 | #endif /* !__ASSEMBLY__ */ | ||
240 | |||
186 | #endif /* _ASM_IA64_INTRINSICS_H */ | 241 | #endif /* _ASM_IA64_INTRINSICS_H */ |
diff --git a/include/asm-ia64/iosapic.h b/include/asm-ia64/iosapic.h index a3a4288daae8..b9c102e15f22 100644 --- a/include/asm-ia64/iosapic.h +++ b/include/asm-ia64/iosapic.h | |||
@@ -55,13 +55,27 @@ | |||
55 | 55 | ||
56 | #define NR_IOSAPICS 256 | 56 | #define NR_IOSAPICS 256 |
57 | 57 | ||
58 | static inline unsigned int __iosapic_read(char __iomem *iosapic, unsigned int reg) | 58 | #ifdef CONFIG_PARAVIRT_GUEST |
59 | #include <asm/paravirt.h> | ||
60 | #else | ||
61 | #define iosapic_pcat_compat_init ia64_native_iosapic_pcat_compat_init | ||
62 | #define __iosapic_read __ia64_native_iosapic_read | ||
63 | #define __iosapic_write __ia64_native_iosapic_write | ||
64 | #define iosapic_get_irq_chip ia64_native_iosapic_get_irq_chip | ||
65 | #endif | ||
66 | |||
67 | extern void __init ia64_native_iosapic_pcat_compat_init(void); | ||
68 | extern struct irq_chip *ia64_native_iosapic_get_irq_chip(unsigned long trigger); | ||
69 | |||
70 | static inline unsigned int | ||
71 | __ia64_native_iosapic_read(char __iomem *iosapic, unsigned int reg) | ||
59 | { | 72 | { |
60 | writel(reg, iosapic + IOSAPIC_REG_SELECT); | 73 | writel(reg, iosapic + IOSAPIC_REG_SELECT); |
61 | return readl(iosapic + IOSAPIC_WINDOW); | 74 | return readl(iosapic + IOSAPIC_WINDOW); |
62 | } | 75 | } |
63 | 76 | ||
64 | static inline void __iosapic_write(char __iomem *iosapic, unsigned int reg, u32 val) | 77 | static inline void |
78 | __ia64_native_iosapic_write(char __iomem *iosapic, unsigned int reg, u32 val) | ||
65 | { | 79 | { |
66 | writel(reg, iosapic + IOSAPIC_REG_SELECT); | 80 | writel(reg, iosapic + IOSAPIC_REG_SELECT); |
67 | writel(val, iosapic + IOSAPIC_WINDOW); | 81 | writel(val, iosapic + IOSAPIC_WINDOW); |
diff --git a/include/asm-ia64/irq.h b/include/asm-ia64/irq.h index a66d26827cbb..3627116fb0e2 100644 --- a/include/asm-ia64/irq.h +++ b/include/asm-ia64/irq.h | |||
@@ -13,14 +13,7 @@ | |||
13 | 13 | ||
14 | #include <linux/types.h> | 14 | #include <linux/types.h> |
15 | #include <linux/cpumask.h> | 15 | #include <linux/cpumask.h> |
16 | 16 | #include <asm-ia64/nr-irqs.h> | |
17 | #define NR_VECTORS 256 | ||
18 | |||
19 | #if (NR_VECTORS + 32 * NR_CPUS) < 1024 | ||
20 | #define NR_IRQS (NR_VECTORS + 32 * NR_CPUS) | ||
21 | #else | ||
22 | #define NR_IRQS 1024 | ||
23 | #endif | ||
24 | 17 | ||
25 | static __inline__ int | 18 | static __inline__ int |
26 | irq_canonicalize (int irq) | 19 | irq_canonicalize (int irq) |
diff --git a/include/asm-ia64/mmu_context.h b/include/asm-ia64/mmu_context.h index cef2400983fa..040bc87db930 100644 --- a/include/asm-ia64/mmu_context.h +++ b/include/asm-ia64/mmu_context.h | |||
@@ -152,11 +152,7 @@ reload_context (nv_mm_context_t context) | |||
152 | # endif | 152 | # endif |
153 | #endif | 153 | #endif |
154 | 154 | ||
155 | ia64_set_rr(0x0000000000000000UL, rr0); | 155 | ia64_set_rr0_to_rr4(rr0, rr1, rr2, rr3, rr4); |
156 | ia64_set_rr(0x2000000000000000UL, rr1); | ||
157 | ia64_set_rr(0x4000000000000000UL, rr2); | ||
158 | ia64_set_rr(0x6000000000000000UL, rr3); | ||
159 | ia64_set_rr(0x8000000000000000UL, rr4); | ||
160 | ia64_srlz_i(); /* srlz.i implies srlz.d */ | 156 | ia64_srlz_i(); /* srlz.i implies srlz.d */ |
161 | } | 157 | } |
162 | 158 | ||
diff --git a/include/asm-ia64/native/inst.h b/include/asm-ia64/native/inst.h new file mode 100644 index 000000000000..c953a2ca4fce --- /dev/null +++ b/include/asm-ia64/native/inst.h | |||
@@ -0,0 +1,175 @@ | |||
1 | /****************************************************************************** | ||
2 | * include/asm-ia64/native/inst.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 DO_SAVE_MIN IA64_NATIVE_DO_SAVE_MIN | ||
24 | |||
25 | #define __paravirt_switch_to ia64_native_switch_to | ||
26 | #define __paravirt_leave_syscall ia64_native_leave_syscall | ||
27 | #define __paravirt_work_processed_syscall ia64_native_work_processed_syscall | ||
28 | #define __paravirt_leave_kernel ia64_native_leave_kernel | ||
29 | #define __paravirt_pending_syscall_end ia64_work_pending_syscall_end | ||
30 | #define __paravirt_work_processed_syscall_target \ | ||
31 | ia64_work_processed_syscall | ||
32 | |||
33 | #ifdef CONFIG_PARAVIRT_GUEST_ASM_CLOBBER_CHECK | ||
34 | # define PARAVIRT_POISON 0xdeadbeefbaadf00d | ||
35 | # define CLOBBER(clob) \ | ||
36 | ;; \ | ||
37 | movl clob = PARAVIRT_POISON; \ | ||
38 | ;; | ||
39 | #else | ||
40 | # define CLOBBER(clob) /* nothing */ | ||
41 | #endif | ||
42 | |||
43 | #define MOV_FROM_IFA(reg) \ | ||
44 | mov reg = cr.ifa | ||
45 | |||
46 | #define MOV_FROM_ITIR(reg) \ | ||
47 | mov reg = cr.itir | ||
48 | |||
49 | #define MOV_FROM_ISR(reg) \ | ||
50 | mov reg = cr.isr | ||
51 | |||
52 | #define MOV_FROM_IHA(reg) \ | ||
53 | mov reg = cr.iha | ||
54 | |||
55 | #define MOV_FROM_IPSR(pred, reg) \ | ||
56 | (pred) mov reg = cr.ipsr | ||
57 | |||
58 | #define MOV_FROM_IIM(reg) \ | ||
59 | mov reg = cr.iim | ||
60 | |||
61 | #define MOV_FROM_IIP(reg) \ | ||
62 | mov reg = cr.iip | ||
63 | |||
64 | #define MOV_FROM_IVR(reg, clob) \ | ||
65 | mov reg = cr.ivr \ | ||
66 | CLOBBER(clob) | ||
67 | |||
68 | #define MOV_FROM_PSR(pred, reg, clob) \ | ||
69 | (pred) mov reg = psr \ | ||
70 | CLOBBER(clob) | ||
71 | |||
72 | #define MOV_TO_IFA(reg, clob) \ | ||
73 | mov cr.ifa = reg \ | ||
74 | CLOBBER(clob) | ||
75 | |||
76 | #define MOV_TO_ITIR(pred, reg, clob) \ | ||
77 | (pred) mov cr.itir = reg \ | ||
78 | CLOBBER(clob) | ||
79 | |||
80 | #define MOV_TO_IHA(pred, reg, clob) \ | ||
81 | (pred) mov cr.iha = reg \ | ||
82 | CLOBBER(clob) | ||
83 | |||
84 | #define MOV_TO_IPSR(pred, reg, clob) \ | ||
85 | (pred) mov cr.ipsr = reg \ | ||
86 | CLOBBER(clob) | ||
87 | |||
88 | #define MOV_TO_IFS(pred, reg, clob) \ | ||
89 | (pred) mov cr.ifs = reg \ | ||
90 | CLOBBER(clob) | ||
91 | |||
92 | #define MOV_TO_IIP(reg, clob) \ | ||
93 | mov cr.iip = reg \ | ||
94 | CLOBBER(clob) | ||
95 | |||
96 | #define MOV_TO_KR(kr, reg, clob0, clob1) \ | ||
97 | mov IA64_KR(kr) = reg \ | ||
98 | CLOBBER(clob0) \ | ||
99 | CLOBBER(clob1) | ||
100 | |||
101 | #define ITC_I(pred, reg, clob) \ | ||
102 | (pred) itc.i reg \ | ||
103 | CLOBBER(clob) | ||
104 | |||
105 | #define ITC_D(pred, reg, clob) \ | ||
106 | (pred) itc.d reg \ | ||
107 | CLOBBER(clob) | ||
108 | |||
109 | #define ITC_I_AND_D(pred_i, pred_d, reg, clob) \ | ||
110 | (pred_i) itc.i reg; \ | ||
111 | (pred_d) itc.d reg \ | ||
112 | CLOBBER(clob) | ||
113 | |||
114 | #define THASH(pred, reg0, reg1, clob) \ | ||
115 | (pred) thash reg0 = reg1 \ | ||
116 | CLOBBER(clob) | ||
117 | |||
118 | #define SSM_PSR_IC_AND_DEFAULT_BITS_AND_SRLZ_I(clob0, clob1) \ | ||
119 | ssm psr.ic | PSR_DEFAULT_BITS \ | ||
120 | CLOBBER(clob0) \ | ||
121 | CLOBBER(clob1) \ | ||
122 | ;; \ | ||
123 | srlz.i /* guarantee that interruption collectin is on */ \ | ||
124 | ;; | ||
125 | |||
126 | #define SSM_PSR_IC_AND_SRLZ_D(clob0, clob1) \ | ||
127 | ssm psr.ic \ | ||
128 | CLOBBER(clob0) \ | ||
129 | CLOBBER(clob1) \ | ||
130 | ;; \ | ||
131 | srlz.d | ||
132 | |||
133 | #define RSM_PSR_IC(clob) \ | ||
134 | rsm psr.ic \ | ||
135 | CLOBBER(clob) | ||
136 | |||
137 | #define SSM_PSR_I(pred, pred_clob, clob) \ | ||
138 | (pred) ssm psr.i \ | ||
139 | CLOBBER(clob) | ||
140 | |||
141 | #define RSM_PSR_I(pred, clob0, clob1) \ | ||
142 | (pred) rsm psr.i \ | ||
143 | CLOBBER(clob0) \ | ||
144 | CLOBBER(clob1) | ||
145 | |||
146 | #define RSM_PSR_I_IC(clob0, clob1, clob2) \ | ||
147 | rsm psr.i | psr.ic \ | ||
148 | CLOBBER(clob0) \ | ||
149 | CLOBBER(clob1) \ | ||
150 | CLOBBER(clob2) | ||
151 | |||
152 | #define RSM_PSR_DT \ | ||
153 | rsm psr.dt | ||
154 | |||
155 | #define SSM_PSR_DT_AND_SRLZ_I \ | ||
156 | ssm psr.dt \ | ||
157 | ;; \ | ||
158 | srlz.i | ||
159 | |||
160 | #define BSW_0(clob0, clob1, clob2) \ | ||
161 | bsw.0 \ | ||
162 | CLOBBER(clob0) \ | ||
163 | CLOBBER(clob1) \ | ||
164 | CLOBBER(clob2) | ||
165 | |||
166 | #define BSW_1(clob0, clob1) \ | ||
167 | bsw.1 \ | ||
168 | CLOBBER(clob0) \ | ||
169 | CLOBBER(clob1) | ||
170 | |||
171 | #define COVER \ | ||
172 | cover | ||
173 | |||
174 | #define RFI \ | ||
175 | rfi | ||
diff --git a/include/asm-ia64/native/irq.h b/include/asm-ia64/native/irq.h new file mode 100644 index 000000000000..efe9ff74a3c4 --- /dev/null +++ b/include/asm-ia64/native/irq.h | |||
@@ -0,0 +1,35 @@ | |||
1 | /****************************************************************************** | ||
2 | * include/asm-ia64/native/irq.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 | * moved from linux/include/asm-ia64/irq.h. | ||
22 | */ | ||
23 | |||
24 | #ifndef _ASM_IA64_NATIVE_IRQ_H | ||
25 | #define _ASM_IA64_NATIVE_IRQ_H | ||
26 | |||
27 | #define NR_VECTORS 256 | ||
28 | |||
29 | #if (NR_VECTORS + 32 * NR_CPUS) < 1024 | ||
30 | #define IA64_NATIVE_NR_IRQS (NR_VECTORS + 32 * NR_CPUS) | ||
31 | #else | ||
32 | #define IA64_NATIVE_NR_IRQS 1024 | ||
33 | #endif | ||
34 | |||
35 | #endif /* _ASM_IA64_NATIVE_IRQ_H */ | ||
diff --git a/include/asm-ia64/paravirt.h b/include/asm-ia64/paravirt.h new file mode 100644 index 000000000000..1b4df129f579 --- /dev/null +++ b/include/asm-ia64/paravirt.h | |||
@@ -0,0 +1,255 @@ | |||
1 | /****************************************************************************** | ||
2 | * include/asm-ia64/paravirt.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 | |||
24 | #ifndef __ASM_PARAVIRT_H | ||
25 | #define __ASM_PARAVIRT_H | ||
26 | |||
27 | #ifdef CONFIG_PARAVIRT_GUEST | ||
28 | |||
29 | #define PARAVIRT_HYPERVISOR_TYPE_DEFAULT 0 | ||
30 | #define PARAVIRT_HYPERVISOR_TYPE_XEN 1 | ||
31 | |||
32 | #ifndef __ASSEMBLY__ | ||
33 | |||
34 | #include <asm/hw_irq.h> | ||
35 | #include <asm/meminit.h> | ||
36 | |||
37 | /****************************************************************************** | ||
38 | * general info | ||
39 | */ | ||
40 | struct pv_info { | ||
41 | unsigned int kernel_rpl; | ||
42 | int paravirt_enabled; | ||
43 | const char *name; | ||
44 | }; | ||
45 | |||
46 | extern struct pv_info pv_info; | ||
47 | |||
48 | static inline int paravirt_enabled(void) | ||
49 | { | ||
50 | return pv_info.paravirt_enabled; | ||
51 | } | ||
52 | |||
53 | static inline unsigned int get_kernel_rpl(void) | ||
54 | { | ||
55 | return pv_info.kernel_rpl; | ||
56 | } | ||
57 | |||
58 | /****************************************************************************** | ||
59 | * initialization hooks. | ||
60 | */ | ||
61 | struct rsvd_region; | ||
62 | |||
63 | struct pv_init_ops { | ||
64 | void (*banner)(void); | ||
65 | |||
66 | int (*reserve_memory)(struct rsvd_region *region); | ||
67 | |||
68 | void (*arch_setup_early)(void); | ||
69 | void (*arch_setup_console)(char **cmdline_p); | ||
70 | int (*arch_setup_nomca)(void); | ||
71 | |||
72 | void (*post_smp_prepare_boot_cpu)(void); | ||
73 | }; | ||
74 | |||
75 | extern struct pv_init_ops pv_init_ops; | ||
76 | |||
77 | static inline void paravirt_banner(void) | ||
78 | { | ||
79 | if (pv_init_ops.banner) | ||
80 | pv_init_ops.banner(); | ||
81 | } | ||
82 | |||
83 | static inline int paravirt_reserve_memory(struct rsvd_region *region) | ||
84 | { | ||
85 | if (pv_init_ops.reserve_memory) | ||
86 | return pv_init_ops.reserve_memory(region); | ||
87 | return 0; | ||
88 | } | ||
89 | |||
90 | static inline void paravirt_arch_setup_early(void) | ||
91 | { | ||
92 | if (pv_init_ops.arch_setup_early) | ||
93 | pv_init_ops.arch_setup_early(); | ||
94 | } | ||
95 | |||
96 | static inline void paravirt_arch_setup_console(char **cmdline_p) | ||
97 | { | ||
98 | if (pv_init_ops.arch_setup_console) | ||
99 | pv_init_ops.arch_setup_console(cmdline_p); | ||
100 | } | ||
101 | |||
102 | static inline int paravirt_arch_setup_nomca(void) | ||
103 | { | ||
104 | if (pv_init_ops.arch_setup_nomca) | ||
105 | return pv_init_ops.arch_setup_nomca(); | ||
106 | return 0; | ||
107 | } | ||
108 | |||
109 | static inline void paravirt_post_smp_prepare_boot_cpu(void) | ||
110 | { | ||
111 | if (pv_init_ops.post_smp_prepare_boot_cpu) | ||
112 | pv_init_ops.post_smp_prepare_boot_cpu(); | ||
113 | } | ||
114 | |||
115 | /****************************************************************************** | ||
116 | * replacement of iosapic operations. | ||
117 | */ | ||
118 | |||
119 | struct pv_iosapic_ops { | ||
120 | void (*pcat_compat_init)(void); | ||
121 | |||
122 | struct irq_chip *(*get_irq_chip)(unsigned long trigger); | ||
123 | |||
124 | unsigned int (*__read)(char __iomem *iosapic, unsigned int reg); | ||
125 | void (*__write)(char __iomem *iosapic, unsigned int reg, u32 val); | ||
126 | }; | ||
127 | |||
128 | extern struct pv_iosapic_ops pv_iosapic_ops; | ||
129 | |||
130 | static inline void | ||
131 | iosapic_pcat_compat_init(void) | ||
132 | { | ||
133 | if (pv_iosapic_ops.pcat_compat_init) | ||
134 | pv_iosapic_ops.pcat_compat_init(); | ||
135 | } | ||
136 | |||
137 | static inline struct irq_chip* | ||
138 | iosapic_get_irq_chip(unsigned long trigger) | ||
139 | { | ||
140 | return pv_iosapic_ops.get_irq_chip(trigger); | ||
141 | } | ||
142 | |||
143 | static inline unsigned int | ||
144 | __iosapic_read(char __iomem *iosapic, unsigned int reg) | ||
145 | { | ||
146 | return pv_iosapic_ops.__read(iosapic, reg); | ||
147 | } | ||
148 | |||
149 | static inline void | ||
150 | __iosapic_write(char __iomem *iosapic, unsigned int reg, u32 val) | ||
151 | { | ||
152 | return pv_iosapic_ops.__write(iosapic, reg, val); | ||
153 | } | ||
154 | |||
155 | /****************************************************************************** | ||
156 | * replacement of irq operations. | ||
157 | */ | ||
158 | |||
159 | struct pv_irq_ops { | ||
160 | void (*register_ipi)(void); | ||
161 | |||
162 | int (*assign_irq_vector)(int irq); | ||
163 | void (*free_irq_vector)(int vector); | ||
164 | |||
165 | void (*register_percpu_irq)(ia64_vector vec, | ||
166 | struct irqaction *action); | ||
167 | |||
168 | void (*resend_irq)(unsigned int vector); | ||
169 | }; | ||
170 | |||
171 | extern struct pv_irq_ops pv_irq_ops; | ||
172 | |||
173 | static inline void | ||
174 | ia64_register_ipi(void) | ||
175 | { | ||
176 | pv_irq_ops.register_ipi(); | ||
177 | } | ||
178 | |||
179 | static inline int | ||
180 | assign_irq_vector(int irq) | ||
181 | { | ||
182 | return pv_irq_ops.assign_irq_vector(irq); | ||
183 | } | ||
184 | |||
185 | static inline void | ||
186 | free_irq_vector(int vector) | ||
187 | { | ||
188 | return pv_irq_ops.free_irq_vector(vector); | ||
189 | } | ||
190 | |||
191 | static inline void | ||
192 | register_percpu_irq(ia64_vector vec, struct irqaction *action) | ||
193 | { | ||
194 | pv_irq_ops.register_percpu_irq(vec, action); | ||
195 | } | ||
196 | |||
197 | static inline void | ||
198 | ia64_resend_irq(unsigned int vector) | ||
199 | { | ||
200 | pv_irq_ops.resend_irq(vector); | ||
201 | } | ||
202 | |||
203 | /****************************************************************************** | ||
204 | * replacement of time operations. | ||
205 | */ | ||
206 | |||
207 | extern struct itc_jitter_data_t itc_jitter_data; | ||
208 | extern volatile int time_keeper_id; | ||
209 | |||
210 | struct pv_time_ops { | ||
211 | void (*init_missing_ticks_accounting)(int cpu); | ||
212 | int (*do_steal_accounting)(unsigned long *new_itm); | ||
213 | |||
214 | void (*clocksource_resume)(void); | ||
215 | }; | ||
216 | |||
217 | extern struct pv_time_ops pv_time_ops; | ||
218 | |||
219 | static inline void | ||
220 | paravirt_init_missing_ticks_accounting(int cpu) | ||
221 | { | ||
222 | if (pv_time_ops.init_missing_ticks_accounting) | ||
223 | pv_time_ops.init_missing_ticks_accounting(cpu); | ||
224 | } | ||
225 | |||
226 | static inline int | ||
227 | paravirt_do_steal_accounting(unsigned long *new_itm) | ||
228 | { | ||
229 | return pv_time_ops.do_steal_accounting(new_itm); | ||
230 | } | ||
231 | |||
232 | #endif /* !__ASSEMBLY__ */ | ||
233 | |||
234 | #else | ||
235 | /* fallback for native case */ | ||
236 | |||
237 | #ifndef __ASSEMBLY__ | ||
238 | |||
239 | #define paravirt_banner() do { } while (0) | ||
240 | #define paravirt_reserve_memory(region) 0 | ||
241 | |||
242 | #define paravirt_arch_setup_early() do { } while (0) | ||
243 | #define paravirt_arch_setup_console(cmdline_p) do { } while (0) | ||
244 | #define paravirt_arch_setup_nomca() 0 | ||
245 | #define paravirt_post_smp_prepare_boot_cpu() do { } while (0) | ||
246 | |||
247 | #define paravirt_init_missing_ticks_accounting(cpu) do { } while (0) | ||
248 | #define paravirt_do_steal_accounting(new_itm) 0 | ||
249 | |||
250 | #endif /* __ASSEMBLY__ */ | ||
251 | |||
252 | |||
253 | #endif /* CONFIG_PARAVIRT_GUEST */ | ||
254 | |||
255 | #endif /* __ASM_PARAVIRT_H */ | ||
diff --git a/include/asm-ia64/paravirt_privop.h b/include/asm-ia64/paravirt_privop.h new file mode 100644 index 000000000000..52482e6940ac --- /dev/null +++ b/include/asm-ia64/paravirt_privop.h | |||
@@ -0,0 +1,114 @@ | |||
1 | /****************************************************************************** | ||
2 | * include/asm-ia64/paravirt_privops.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 | #ifndef _ASM_IA64_PARAVIRT_PRIVOP_H | ||
24 | #define _ASM_IA64_PARAVIRT_PRIVOP_H | ||
25 | |||
26 | #ifdef CONFIG_PARAVIRT | ||
27 | |||
28 | #ifndef __ASSEMBLY__ | ||
29 | |||
30 | #include <linux/types.h> | ||
31 | #include <asm/kregs.h> /* for IA64_PSR_I */ | ||
32 | |||
33 | /****************************************************************************** | ||
34 | * replacement of intrinsics operations. | ||
35 | */ | ||
36 | |||
37 | struct pv_cpu_ops { | ||
38 | void (*fc)(unsigned long addr); | ||
39 | unsigned long (*thash)(unsigned long addr); | ||
40 | unsigned long (*get_cpuid)(int index); | ||
41 | unsigned long (*get_pmd)(int index); | ||
42 | unsigned long (*getreg)(int reg); | ||
43 | void (*setreg)(int reg, unsigned long val); | ||
44 | void (*ptcga)(unsigned long addr, unsigned long size); | ||
45 | unsigned long (*get_rr)(unsigned long index); | ||
46 | void (*set_rr)(unsigned long index, unsigned long val); | ||
47 | void (*set_rr0_to_rr4)(unsigned long val0, unsigned long val1, | ||
48 | unsigned long val2, unsigned long val3, | ||
49 | unsigned long val4); | ||
50 | void (*ssm_i)(void); | ||
51 | void (*rsm_i)(void); | ||
52 | unsigned long (*get_psr_i)(void); | ||
53 | void (*intrin_local_irq_restore)(unsigned long flags); | ||
54 | }; | ||
55 | |||
56 | extern struct pv_cpu_ops pv_cpu_ops; | ||
57 | |||
58 | extern void ia64_native_setreg_func(int regnum, unsigned long val); | ||
59 | extern unsigned long ia64_native_getreg_func(int regnum); | ||
60 | |||
61 | /************************************************/ | ||
62 | /* Instructions paravirtualized for performance */ | ||
63 | /************************************************/ | ||
64 | |||
65 | /* mask for ia64_native_ssm/rsm() must be constant.("i" constraing). | ||
66 | * static inline function doesn't satisfy it. */ | ||
67 | #define paravirt_ssm(mask) \ | ||
68 | do { \ | ||
69 | if ((mask) == IA64_PSR_I) \ | ||
70 | pv_cpu_ops.ssm_i(); \ | ||
71 | else \ | ||
72 | ia64_native_ssm(mask); \ | ||
73 | } while (0) | ||
74 | |||
75 | #define paravirt_rsm(mask) \ | ||
76 | do { \ | ||
77 | if ((mask) == IA64_PSR_I) \ | ||
78 | pv_cpu_ops.rsm_i(); \ | ||
79 | else \ | ||
80 | ia64_native_rsm(mask); \ | ||
81 | } while (0) | ||
82 | |||
83 | /****************************************************************************** | ||
84 | * replacement of hand written assembly codes. | ||
85 | */ | ||
86 | struct pv_cpu_asm_switch { | ||
87 | unsigned long switch_to; | ||
88 | unsigned long leave_syscall; | ||
89 | unsigned long work_processed_syscall; | ||
90 | unsigned long leave_kernel; | ||
91 | }; | ||
92 | void paravirt_cpu_asm_init(const struct pv_cpu_asm_switch *cpu_asm_switch); | ||
93 | |||
94 | #endif /* __ASSEMBLY__ */ | ||
95 | |||
96 | #define IA64_PARAVIRT_ASM_FUNC(name) paravirt_ ## name | ||
97 | |||
98 | #else | ||
99 | |||
100 | /* fallback for native case */ | ||
101 | #define IA64_PARAVIRT_ASM_FUNC(name) ia64_native_ ## name | ||
102 | |||
103 | #endif /* CONFIG_PARAVIRT */ | ||
104 | |||
105 | /* these routines utilize privilege-sensitive or performance-sensitive | ||
106 | * privileged instructions so the code must be replaced with | ||
107 | * paravirtualized versions */ | ||
108 | #define ia64_switch_to IA64_PARAVIRT_ASM_FUNC(switch_to) | ||
109 | #define ia64_leave_syscall IA64_PARAVIRT_ASM_FUNC(leave_syscall) | ||
110 | #define ia64_work_processed_syscall \ | ||
111 | IA64_PARAVIRT_ASM_FUNC(work_processed_syscall) | ||
112 | #define ia64_leave_kernel IA64_PARAVIRT_ASM_FUNC(leave_kernel) | ||
113 | |||
114 | #endif /* _ASM_IA64_PARAVIRT_PRIVOP_H */ | ||
diff --git a/include/asm-ia64/smp.h b/include/asm-ia64/smp.h index 27731e032ee9..12d96e0cd513 100644 --- a/include/asm-ia64/smp.h +++ b/include/asm-ia64/smp.h | |||
@@ -15,6 +15,7 @@ | |||
15 | #include <linux/kernel.h> | 15 | #include <linux/kernel.h> |
16 | #include <linux/cpumask.h> | 16 | #include <linux/cpumask.h> |
17 | #include <linux/bitops.h> | 17 | #include <linux/bitops.h> |
18 | #include <linux/irqreturn.h> | ||
18 | 19 | ||
19 | #include <asm/io.h> | 20 | #include <asm/io.h> |
20 | #include <asm/param.h> | 21 | #include <asm/param.h> |
@@ -120,6 +121,7 @@ extern void __init smp_build_cpu_map(void); | |||
120 | extern void __init init_smp_config (void); | 121 | extern void __init init_smp_config (void); |
121 | extern void smp_do_timer (struct pt_regs *regs); | 122 | extern void smp_do_timer (struct pt_regs *regs); |
122 | 123 | ||
124 | extern irqreturn_t handle_IPI(int irq, void *dev_id); | ||
123 | extern void smp_send_reschedule (int cpu); | 125 | extern void smp_send_reschedule (int cpu); |
124 | extern void identify_siblings (struct cpuinfo_ia64 *); | 126 | extern void identify_siblings (struct cpuinfo_ia64 *); |
125 | extern int is_multithreading_enabled(void); | 127 | extern int is_multithreading_enabled(void); |
diff --git a/include/asm-ia64/system.h b/include/asm-ia64/system.h index 26e250bfb912..927a381c20ca 100644 --- a/include/asm-ia64/system.h +++ b/include/asm-ia64/system.h | |||
@@ -26,6 +26,7 @@ | |||
26 | */ | 26 | */ |
27 | #define KERNEL_START (GATE_ADDR+__IA64_UL_CONST(0x100000000)) | 27 | #define KERNEL_START (GATE_ADDR+__IA64_UL_CONST(0x100000000)) |
28 | #define PERCPU_ADDR (-PERCPU_PAGE_SIZE) | 28 | #define PERCPU_ADDR (-PERCPU_PAGE_SIZE) |
29 | #define LOAD_OFFSET (KERNEL_START - KERNEL_TR_PAGE_SIZE) | ||
29 | 30 | ||
30 | #ifndef __ASSEMBLY__ | 31 | #ifndef __ASSEMBLY__ |
31 | 32 | ||
@@ -122,10 +123,16 @@ extern struct ia64_boot_param { | |||
122 | * write a floating-point register right before reading the PSR | 123 | * write a floating-point register right before reading the PSR |
123 | * and that writes to PSR.mfl | 124 | * and that writes to PSR.mfl |
124 | */ | 125 | */ |
126 | #ifdef CONFIG_PARAVIRT | ||
127 | #define __local_save_flags() ia64_get_psr_i() | ||
128 | #else | ||
129 | #define __local_save_flags() ia64_getreg(_IA64_REG_PSR) | ||
130 | #endif | ||
131 | |||
125 | #define __local_irq_save(x) \ | 132 | #define __local_irq_save(x) \ |
126 | do { \ | 133 | do { \ |
127 | ia64_stop(); \ | 134 | ia64_stop(); \ |
128 | (x) = ia64_getreg(_IA64_REG_PSR); \ | 135 | (x) = __local_save_flags(); \ |
129 | ia64_stop(); \ | 136 | ia64_stop(); \ |
130 | ia64_rsm(IA64_PSR_I); \ | 137 | ia64_rsm(IA64_PSR_I); \ |
131 | } while (0) | 138 | } while (0) |
@@ -173,7 +180,7 @@ do { \ | |||
173 | #endif /* !CONFIG_IA64_DEBUG_IRQ */ | 180 | #endif /* !CONFIG_IA64_DEBUG_IRQ */ |
174 | 181 | ||
175 | #define local_irq_enable() ({ ia64_stop(); ia64_ssm(IA64_PSR_I); ia64_srlz_d(); }) | 182 | #define local_irq_enable() ({ ia64_stop(); ia64_ssm(IA64_PSR_I); ia64_srlz_d(); }) |
176 | #define local_save_flags(flags) ({ ia64_stop(); (flags) = ia64_getreg(_IA64_REG_PSR); }) | 183 | #define local_save_flags(flags) ({ ia64_stop(); (flags) = __local_save_flags(); }) |
177 | 184 | ||
178 | #define irqs_disabled() \ | 185 | #define irqs_disabled() \ |
179 | ({ \ | 186 | ({ \ |