aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64/kernel')
-rw-r--r--arch/ia64/kernel/efi.c502
-rw-r--r--arch/ia64/kernel/entry.S2
-rw-r--r--arch/ia64/kernel/fsyscall_gtod_data.h4
-rw-r--r--arch/ia64/kernel/ia64_ksyms.c3
-rw-r--r--arch/ia64/kernel/kprobes.c7
-rw-r--r--arch/ia64/kernel/mca.c66
-rw-r--r--arch/ia64/kernel/mca_asm.S46
-rw-r--r--arch/ia64/kernel/mca_drv.c2
-rw-r--r--arch/ia64/kernel/mca_drv.h2
-rw-r--r--arch/ia64/kernel/mca_drv_asm.S2
-rw-r--r--arch/ia64/kernel/perfmon.c6
-rw-r--r--arch/ia64/kernel/sal.c14
-rw-r--r--arch/ia64/kernel/setup.c2
-rw-r--r--arch/ia64/kernel/smpboot.c11
-rw-r--r--arch/ia64/kernel/traps.c35
-rw-r--r--arch/ia64/kernel/unaligned.c13
16 files changed, 396 insertions, 321 deletions
diff --git a/arch/ia64/kernel/efi.c b/arch/ia64/kernel/efi.c
index 242d79341120..919070a9aed7 100644
--- a/arch/ia64/kernel/efi.c
+++ b/arch/ia64/kernel/efi.c
@@ -1,7 +1,8 @@
1/* 1/*
2 * Extensible Firmware Interface 2 * Extensible Firmware Interface
3 * 3 *
4 * Based on Extensible Firmware Interface Specification version 0.9 April 30, 1999 4 * Based on Extensible Firmware Interface Specification version 0.9
5 * April 30, 1999
5 * 6 *
6 * Copyright (C) 1999 VA Linux Systems 7 * Copyright (C) 1999 VA Linux Systems
7 * Copyright (C) 1999 Walt Drummond <drummond@valinux.com> 8 * Copyright (C) 1999 Walt Drummond <drummond@valinux.com>
@@ -48,145 +49,157 @@ static unsigned long mem_limit = ~0UL, max_addr = ~0UL, min_addr = 0UL;
48 49
49#define efi_call_virt(f, args...) (*(f))(args) 50#define efi_call_virt(f, args...) (*(f))(args)
50 51
51#define STUB_GET_TIME(prefix, adjust_arg) \ 52#define STUB_GET_TIME(prefix, adjust_arg) \
52static efi_status_t \ 53static efi_status_t \
53prefix##_get_time (efi_time_t *tm, efi_time_cap_t *tc) \ 54prefix##_get_time (efi_time_t *tm, efi_time_cap_t *tc) \
54{ \ 55{ \
55 struct ia64_fpreg fr[6]; \ 56 struct ia64_fpreg fr[6]; \
56 efi_time_cap_t *atc = NULL; \ 57 efi_time_cap_t *atc = NULL; \
57 efi_status_t ret; \ 58 efi_status_t ret; \
58 \ 59 \
59 if (tc) \ 60 if (tc) \
60 atc = adjust_arg(tc); \ 61 atc = adjust_arg(tc); \
61 ia64_save_scratch_fpregs(fr); \ 62 ia64_save_scratch_fpregs(fr); \
62 ret = efi_call_##prefix((efi_get_time_t *) __va(runtime->get_time), adjust_arg(tm), atc); \ 63 ret = efi_call_##prefix((efi_get_time_t *) __va(runtime->get_time), \
63 ia64_load_scratch_fpregs(fr); \ 64 adjust_arg(tm), atc); \
64 return ret; \ 65 ia64_load_scratch_fpregs(fr); \
66 return ret; \
65} 67}
66 68
67#define STUB_SET_TIME(prefix, adjust_arg) \ 69#define STUB_SET_TIME(prefix, adjust_arg) \
68static efi_status_t \ 70static efi_status_t \
69prefix##_set_time (efi_time_t *tm) \ 71prefix##_set_time (efi_time_t *tm) \
70{ \ 72{ \
71 struct ia64_fpreg fr[6]; \ 73 struct ia64_fpreg fr[6]; \
72 efi_status_t ret; \ 74 efi_status_t ret; \
73 \ 75 \
74 ia64_save_scratch_fpregs(fr); \ 76 ia64_save_scratch_fpregs(fr); \
75 ret = efi_call_##prefix((efi_set_time_t *) __va(runtime->set_time), adjust_arg(tm)); \ 77 ret = efi_call_##prefix((efi_set_time_t *) __va(runtime->set_time), \
76 ia64_load_scratch_fpregs(fr); \ 78 adjust_arg(tm)); \
77 return ret; \ 79 ia64_load_scratch_fpregs(fr); \
80 return ret; \
78} 81}
79 82
80#define STUB_GET_WAKEUP_TIME(prefix, adjust_arg) \ 83#define STUB_GET_WAKEUP_TIME(prefix, adjust_arg) \
81static efi_status_t \ 84static efi_status_t \
82prefix##_get_wakeup_time (efi_bool_t *enabled, efi_bool_t *pending, efi_time_t *tm) \ 85prefix##_get_wakeup_time (efi_bool_t *enabled, efi_bool_t *pending, \
83{ \ 86 efi_time_t *tm) \
84 struct ia64_fpreg fr[6]; \ 87{ \
85 efi_status_t ret; \ 88 struct ia64_fpreg fr[6]; \
86 \ 89 efi_status_t ret; \
87 ia64_save_scratch_fpregs(fr); \ 90 \
88 ret = efi_call_##prefix((efi_get_wakeup_time_t *) __va(runtime->get_wakeup_time), \ 91 ia64_save_scratch_fpregs(fr); \
89 adjust_arg(enabled), adjust_arg(pending), adjust_arg(tm)); \ 92 ret = efi_call_##prefix( \
90 ia64_load_scratch_fpregs(fr); \ 93 (efi_get_wakeup_time_t *) __va(runtime->get_wakeup_time), \
91 return ret; \ 94 adjust_arg(enabled), adjust_arg(pending), adjust_arg(tm)); \
95 ia64_load_scratch_fpregs(fr); \
96 return ret; \
92} 97}
93 98
94#define STUB_SET_WAKEUP_TIME(prefix, adjust_arg) \ 99#define STUB_SET_WAKEUP_TIME(prefix, adjust_arg) \
95static efi_status_t \ 100static efi_status_t \
96prefix##_set_wakeup_time (efi_bool_t enabled, efi_time_t *tm) \ 101prefix##_set_wakeup_time (efi_bool_t enabled, efi_time_t *tm) \
97{ \ 102{ \
98 struct ia64_fpreg fr[6]; \ 103 struct ia64_fpreg fr[6]; \
99 efi_time_t *atm = NULL; \ 104 efi_time_t *atm = NULL; \
100 efi_status_t ret; \ 105 efi_status_t ret; \
101 \ 106 \
102 if (tm) \ 107 if (tm) \
103 atm = adjust_arg(tm); \ 108 atm = adjust_arg(tm); \
104 ia64_save_scratch_fpregs(fr); \ 109 ia64_save_scratch_fpregs(fr); \
105 ret = efi_call_##prefix((efi_set_wakeup_time_t *) __va(runtime->set_wakeup_time), \ 110 ret = efi_call_##prefix( \
106 enabled, atm); \ 111 (efi_set_wakeup_time_t *) __va(runtime->set_wakeup_time), \
107 ia64_load_scratch_fpregs(fr); \ 112 enabled, atm); \
108 return ret; \ 113 ia64_load_scratch_fpregs(fr); \
114 return ret; \
109} 115}
110 116
111#define STUB_GET_VARIABLE(prefix, adjust_arg) \ 117#define STUB_GET_VARIABLE(prefix, adjust_arg) \
112static efi_status_t \ 118static efi_status_t \
113prefix##_get_variable (efi_char16_t *name, efi_guid_t *vendor, u32 *attr, \ 119prefix##_get_variable (efi_char16_t *name, efi_guid_t *vendor, u32 *attr, \
114 unsigned long *data_size, void *data) \ 120 unsigned long *data_size, void *data) \
115{ \ 121{ \
116 struct ia64_fpreg fr[6]; \ 122 struct ia64_fpreg fr[6]; \
117 u32 *aattr = NULL; \ 123 u32 *aattr = NULL; \
118 efi_status_t ret; \ 124 efi_status_t ret; \
119 \ 125 \
120 if (attr) \ 126 if (attr) \
121 aattr = adjust_arg(attr); \ 127 aattr = adjust_arg(attr); \
122 ia64_save_scratch_fpregs(fr); \ 128 ia64_save_scratch_fpregs(fr); \
123 ret = efi_call_##prefix((efi_get_variable_t *) __va(runtime->get_variable), \ 129 ret = efi_call_##prefix( \
124 adjust_arg(name), adjust_arg(vendor), aattr, \ 130 (efi_get_variable_t *) __va(runtime->get_variable), \
125 adjust_arg(data_size), adjust_arg(data)); \ 131 adjust_arg(name), adjust_arg(vendor), aattr, \
126 ia64_load_scratch_fpregs(fr); \ 132 adjust_arg(data_size), adjust_arg(data)); \
127 return ret; \ 133 ia64_load_scratch_fpregs(fr); \
134 return ret; \
128} 135}
129 136
130#define STUB_GET_NEXT_VARIABLE(prefix, adjust_arg) \ 137#define STUB_GET_NEXT_VARIABLE(prefix, adjust_arg) \
131static efi_status_t \ 138static efi_status_t \
132prefix##_get_next_variable (unsigned long *name_size, efi_char16_t *name, efi_guid_t *vendor) \ 139prefix##_get_next_variable (unsigned long *name_size, efi_char16_t *name, \
133{ \ 140 efi_guid_t *vendor) \
134 struct ia64_fpreg fr[6]; \ 141{ \
135 efi_status_t ret; \ 142 struct ia64_fpreg fr[6]; \
136 \ 143 efi_status_t ret; \
137 ia64_save_scratch_fpregs(fr); \ 144 \
138 ret = efi_call_##prefix((efi_get_next_variable_t *) __va(runtime->get_next_variable), \ 145 ia64_save_scratch_fpregs(fr); \
139 adjust_arg(name_size), adjust_arg(name), adjust_arg(vendor)); \ 146 ret = efi_call_##prefix( \
140 ia64_load_scratch_fpregs(fr); \ 147 (efi_get_next_variable_t *) __va(runtime->get_next_variable), \
141 return ret; \ 148 adjust_arg(name_size), adjust_arg(name), adjust_arg(vendor)); \
149 ia64_load_scratch_fpregs(fr); \
150 return ret; \
142} 151}
143 152
144#define STUB_SET_VARIABLE(prefix, adjust_arg) \ 153#define STUB_SET_VARIABLE(prefix, adjust_arg) \
145static efi_status_t \ 154static efi_status_t \
146prefix##_set_variable (efi_char16_t *name, efi_guid_t *vendor, unsigned long attr, \ 155prefix##_set_variable (efi_char16_t *name, efi_guid_t *vendor, \
147 unsigned long data_size, void *data) \ 156 unsigned long attr, unsigned long data_size, \
148{ \ 157 void *data) \
149 struct ia64_fpreg fr[6]; \ 158{ \
150 efi_status_t ret; \ 159 struct ia64_fpreg fr[6]; \
151 \ 160 efi_status_t ret; \
152 ia64_save_scratch_fpregs(fr); \ 161 \
153 ret = efi_call_##prefix((efi_set_variable_t *) __va(runtime->set_variable), \ 162 ia64_save_scratch_fpregs(fr); \
154 adjust_arg(name), adjust_arg(vendor), attr, data_size, \ 163 ret = efi_call_##prefix( \
155 adjust_arg(data)); \ 164 (efi_set_variable_t *) __va(runtime->set_variable), \
156 ia64_load_scratch_fpregs(fr); \ 165 adjust_arg(name), adjust_arg(vendor), attr, data_size, \
157 return ret; \ 166 adjust_arg(data)); \
167 ia64_load_scratch_fpregs(fr); \
168 return ret; \
158} 169}
159 170
160#define STUB_GET_NEXT_HIGH_MONO_COUNT(prefix, adjust_arg) \ 171#define STUB_GET_NEXT_HIGH_MONO_COUNT(prefix, adjust_arg) \
161static efi_status_t \ 172static efi_status_t \
162prefix##_get_next_high_mono_count (u32 *count) \ 173prefix##_get_next_high_mono_count (u32 *count) \
163{ \ 174{ \
164 struct ia64_fpreg fr[6]; \ 175 struct ia64_fpreg fr[6]; \
165 efi_status_t ret; \ 176 efi_status_t ret; \
166 \ 177 \
167 ia64_save_scratch_fpregs(fr); \ 178 ia64_save_scratch_fpregs(fr); \
168 ret = efi_call_##prefix((efi_get_next_high_mono_count_t *) \ 179 ret = efi_call_##prefix((efi_get_next_high_mono_count_t *) \
169 __va(runtime->get_next_high_mono_count), adjust_arg(count)); \ 180 __va(runtime->get_next_high_mono_count), \
170 ia64_load_scratch_fpregs(fr); \ 181 adjust_arg(count)); \
171 return ret; \ 182 ia64_load_scratch_fpregs(fr); \
183 return ret; \
172} 184}
173 185
174#define STUB_RESET_SYSTEM(prefix, adjust_arg) \ 186#define STUB_RESET_SYSTEM(prefix, adjust_arg) \
175static void \ 187static void \
176prefix##_reset_system (int reset_type, efi_status_t status, \ 188prefix##_reset_system (int reset_type, efi_status_t status, \
177 unsigned long data_size, efi_char16_t *data) \ 189 unsigned long data_size, efi_char16_t *data) \
178{ \ 190{ \
179 struct ia64_fpreg fr[6]; \ 191 struct ia64_fpreg fr[6]; \
180 efi_char16_t *adata = NULL; \ 192 efi_char16_t *adata = NULL; \
181 \ 193 \
182 if (data) \ 194 if (data) \
183 adata = adjust_arg(data); \ 195 adata = adjust_arg(data); \
184 \ 196 \
185 ia64_save_scratch_fpregs(fr); \ 197 ia64_save_scratch_fpregs(fr); \
186 efi_call_##prefix((efi_reset_system_t *) __va(runtime->reset_system), \ 198 efi_call_##prefix( \
187 reset_type, status, data_size, adata); \ 199 (efi_reset_system_t *) __va(runtime->reset_system), \
188 /* should not return, but just in case... */ \ 200 reset_type, status, data_size, adata); \
189 ia64_load_scratch_fpregs(fr); \ 201 /* should not return, but just in case... */ \
202 ia64_load_scratch_fpregs(fr); \
190} 203}
191 204
192#define phys_ptr(arg) ((__typeof__(arg)) ia64_tpa(arg)) 205#define phys_ptr(arg) ((__typeof__(arg)) ia64_tpa(arg))
@@ -223,7 +236,8 @@ efi_gettimeofday (struct timespec *ts)
223 return; 236 return;
224 } 237 }
225 238
226 ts->tv_sec = mktime(tm.year, tm.month, tm.day, tm.hour, tm.minute, tm.second); 239 ts->tv_sec = mktime(tm.year, tm.month, tm.day,
240 tm.hour, tm.minute, tm.second);
227 ts->tv_nsec = tm.nanosecond; 241 ts->tv_nsec = tm.nanosecond;
228} 242}
229 243
@@ -297,8 +311,8 @@ walk (efi_freemem_callback_t callback, void *arg, u64 attr)
297} 311}
298 312
299/* 313/*
300 * Walks the EFI memory map and calls CALLBACK once for each EFI memory descriptor that 314 * Walk the EFI memory map and call CALLBACK once for each EFI memory
301 * has memory that is available for OS use. 315 * descriptor that has memory that is available for OS use.
302 */ 316 */
303void 317void
304efi_memmap_walk (efi_freemem_callback_t callback, void *arg) 318efi_memmap_walk (efi_freemem_callback_t callback, void *arg)
@@ -307,8 +321,8 @@ efi_memmap_walk (efi_freemem_callback_t callback, void *arg)
307} 321}
308 322
309/* 323/*
310 * Walks the EFI memory map and calls CALLBACK once for each EFI memory descriptor that 324 * Walk the EFI memory map and call CALLBACK once for each EFI memory
311 * has memory that is available for uncached allocator. 325 * descriptor that has memory that is available for uncached allocator.
312 */ 326 */
313void 327void
314efi_memmap_walk_uc (efi_freemem_callback_t callback, void *arg) 328efi_memmap_walk_uc (efi_freemem_callback_t callback, void *arg)
@@ -317,11 +331,10 @@ efi_memmap_walk_uc (efi_freemem_callback_t callback, void *arg)
317} 331}
318 332
319/* 333/*
320 * Look for the PAL_CODE region reported by EFI and maps it using an 334 * Look for the PAL_CODE region reported by EFI and map it using an
321 * ITR to enable safe PAL calls in virtual mode. See IA-64 Processor 335 * ITR to enable safe PAL calls in virtual mode. See IA-64 Processor
322 * Abstraction Layer chapter 11 in ADAG 336 * Abstraction Layer chapter 11 in ADAG
323 */ 337 */
324
325void * 338void *
326efi_get_pal_addr (void) 339efi_get_pal_addr (void)
327{ 340{
@@ -341,45 +354,47 @@ efi_get_pal_addr (void)
341 continue; 354 continue;
342 355
343 if (++pal_code_count > 1) { 356 if (++pal_code_count > 1) {
344 printk(KERN_ERR "Too many EFI Pal Code memory ranges, dropped @ %lx\n", 357 printk(KERN_ERR "Too many EFI Pal Code memory ranges, "
345 md->phys_addr); 358 "dropped @ %lx\n", md->phys_addr);
346 continue; 359 continue;
347 } 360 }
348 /* 361 /*
349 * The only ITLB entry in region 7 that is used is the one installed by 362 * The only ITLB entry in region 7 that is used is the one
350 * __start(). That entry covers a 64MB range. 363 * installed by __start(). That entry covers a 64MB range.
351 */ 364 */
352 mask = ~((1 << KERNEL_TR_PAGE_SHIFT) - 1); 365 mask = ~((1 << KERNEL_TR_PAGE_SHIFT) - 1);
353 vaddr = PAGE_OFFSET + md->phys_addr; 366 vaddr = PAGE_OFFSET + md->phys_addr;
354 367
355 /* 368 /*
356 * We must check that the PAL mapping won't overlap with the kernel 369 * We must check that the PAL mapping won't overlap with the
357 * mapping. 370 * kernel mapping.
358 * 371 *
359 * PAL code is guaranteed to be aligned on a power of 2 between 4k and 372 * PAL code is guaranteed to be aligned on a power of 2 between
360 * 256KB and that only one ITR is needed to map it. This implies that the 373 * 4k and 256KB and that only one ITR is needed to map it. This
361 * PAL code is always aligned on its size, i.e., the closest matching page 374 * implies that the PAL code is always aligned on its size,
362 * size supported by the TLB. Therefore PAL code is guaranteed never to 375 * i.e., the closest matching page size supported by the TLB.
363 * cross a 64MB unless it is bigger than 64MB (very unlikely!). So for 376 * Therefore PAL code is guaranteed never to cross a 64MB unless
364 * now the following test is enough to determine whether or not we need a 377 * it is bigger than 64MB (very unlikely!). So for now the
365 * dedicated ITR for the PAL code. 378 * following test is enough to determine whether or not we need
379 * a dedicated ITR for the PAL code.
366 */ 380 */
367 if ((vaddr & mask) == (KERNEL_START & mask)) { 381 if ((vaddr & mask) == (KERNEL_START & mask)) {
368 printk(KERN_INFO "%s: no need to install ITR for PAL code\n", 382 printk(KERN_INFO "%s: no need to install ITR for "
369 __FUNCTION__); 383 "PAL code\n", __FUNCTION__);
370 continue; 384 continue;
371 } 385 }
372 386
373 if (efi_md_size(md) > IA64_GRANULE_SIZE) 387 if (efi_md_size(md) > IA64_GRANULE_SIZE)
374 panic("Woah! PAL code size bigger than a granule!"); 388 panic("Whoa! PAL code size bigger than a granule!");
375 389
376#if EFI_DEBUG 390#if EFI_DEBUG
377 mask = ~((1 << IA64_GRANULE_SHIFT) - 1); 391 mask = ~((1 << IA64_GRANULE_SHIFT) - 1);
378 392
379 printk(KERN_INFO "CPU %d: mapping PAL code [0x%lx-0x%lx) into [0x%lx-0x%lx)\n", 393 printk(KERN_INFO "CPU %d: mapping PAL code "
380 smp_processor_id(), md->phys_addr, 394 "[0x%lx-0x%lx) into [0x%lx-0x%lx)\n",
381 md->phys_addr + efi_md_size(md), 395 smp_processor_id(), md->phys_addr,
382 vaddr & mask, (vaddr & mask) + IA64_GRANULE_SIZE); 396 md->phys_addr + efi_md_size(md),
397 vaddr & mask, (vaddr & mask) + IA64_GRANULE_SIZE);
383#endif 398#endif
384 return __va(md->phys_addr); 399 return __va(md->phys_addr);
385 } 400 }
@@ -401,11 +416,11 @@ efi_map_pal_code (void)
401 * Cannot write to CRx with PSR.ic=1 416 * Cannot write to CRx with PSR.ic=1
402 */ 417 */
403 psr = ia64_clear_ic(); 418 psr = ia64_clear_ic();
404 ia64_itr(0x1, IA64_TR_PALCODE, GRANULEROUNDDOWN((unsigned long) pal_vaddr), 419 ia64_itr(0x1, IA64_TR_PALCODE,
420 GRANULEROUNDDOWN((unsigned long) pal_vaddr),
405 pte_val(pfn_pte(__pa(pal_vaddr) >> PAGE_SHIFT, PAGE_KERNEL)), 421 pte_val(pfn_pte(__pa(pal_vaddr) >> PAGE_SHIFT, PAGE_KERNEL)),
406 IA64_GRANULE_SHIFT); 422 IA64_GRANULE_SHIFT);
407 ia64_set_psr(psr); /* restore psr */ 423 ia64_set_psr(psr); /* restore psr */
408 ia64_srlz_i();
409} 424}
410 425
411void __init 426void __init
@@ -418,7 +433,10 @@ efi_init (void)
418 char *cp, vendor[100] = "unknown"; 433 char *cp, vendor[100] = "unknown";
419 int i; 434 int i;
420 435
421 /* it's too early to be able to use the standard kernel command line support... */ 436 /*
437 * It's too early to be able to use the standard kernel command line
438 * support...
439 */
422 for (cp = boot_command_line; *cp; ) { 440 for (cp = boot_command_line; *cp; ) {
423 if (memcmp(cp, "mem=", 4) == 0) { 441 if (memcmp(cp, "mem=", 4) == 0) {
424 mem_limit = memparse(cp + 4, &cp); 442 mem_limit = memparse(cp + 4, &cp);
@@ -434,9 +452,11 @@ efi_init (void)
434 } 452 }
435 } 453 }
436 if (min_addr != 0UL) 454 if (min_addr != 0UL)
437 printk(KERN_INFO "Ignoring memory below %luMB\n", min_addr >> 20); 455 printk(KERN_INFO "Ignoring memory below %luMB\n",
456 min_addr >> 20);
438 if (max_addr != ~0UL) 457 if (max_addr != ~0UL)
439 printk(KERN_INFO "Ignoring memory above %luMB\n", max_addr >> 20); 458 printk(KERN_INFO "Ignoring memory above %luMB\n",
459 max_addr >> 20);
440 460
441 efi.systab = __va(ia64_boot_param->efi_systab); 461 efi.systab = __va(ia64_boot_param->efi_systab);
442 462
@@ -444,9 +464,9 @@ efi_init (void)
444 * Verify the EFI Table 464 * Verify the EFI Table
445 */ 465 */
446 if (efi.systab == NULL) 466 if (efi.systab == NULL)
447 panic("Woah! Can't find EFI system table.\n"); 467 panic("Whoa! Can't find EFI system table.\n");
448 if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE) 468 if (efi.systab->hdr.signature != EFI_SYSTEM_TABLE_SIGNATURE)
449 panic("Woah! EFI system table signature incorrect\n"); 469 panic("Whoa! EFI system table signature incorrect\n");
450 if ((efi.systab->hdr.revision >> 16) == 0) 470 if ((efi.systab->hdr.revision >> 16) == 0)
451 printk(KERN_WARNING "Warning: EFI system table version " 471 printk(KERN_WARNING "Warning: EFI system table version "
452 "%d.%02d, expected 1.00 or greater\n", 472 "%d.%02d, expected 1.00 or greater\n",
@@ -464,7 +484,8 @@ efi_init (void)
464 } 484 }
465 485
466 printk(KERN_INFO "EFI v%u.%.02u by %s:", 486 printk(KERN_INFO "EFI v%u.%.02u by %s:",
467 efi.systab->hdr.revision >> 16, efi.systab->hdr.revision & 0xffff, vendor); 487 efi.systab->hdr.revision >> 16,
488 efi.systab->hdr.revision & 0xffff, vendor);
468 489
469 efi.mps = EFI_INVALID_TABLE_ADDR; 490 efi.mps = EFI_INVALID_TABLE_ADDR;
470 efi.acpi = EFI_INVALID_TABLE_ADDR; 491 efi.acpi = EFI_INVALID_TABLE_ADDR;
@@ -519,9 +540,12 @@ efi_init (void)
519 efi_memory_desc_t *md; 540 efi_memory_desc_t *md;
520 void *p; 541 void *p;
521 542
522 for (i = 0, p = efi_map_start; p < efi_map_end; ++i, p += efi_desc_size) { 543 for (i = 0, p = efi_map_start; p < efi_map_end;
544 ++i, p += efi_desc_size)
545 {
523 md = p; 546 md = p;
524 printk("mem%02u: type=%u, attr=0x%lx, range=[0x%016lx-0x%016lx) (%luMB)\n", 547 printk("mem%02u: type=%u, attr=0x%lx, "
548 "range=[0x%016lx-0x%016lx) (%luMB)\n",
525 i, md->type, md->attribute, md->phys_addr, 549 i, md->type, md->attribute, md->phys_addr,
526 md->phys_addr + efi_md_size(md), 550 md->phys_addr + efi_md_size(md),
527 md->num_pages >> (20 - EFI_PAGE_SHIFT)); 551 md->num_pages >> (20 - EFI_PAGE_SHIFT));
@@ -549,8 +573,8 @@ efi_enter_virtual_mode (void)
549 md = p; 573 md = p;
550 if (md->attribute & EFI_MEMORY_RUNTIME) { 574 if (md->attribute & EFI_MEMORY_RUNTIME) {
551 /* 575 /*
552 * Some descriptors have multiple bits set, so the order of 576 * Some descriptors have multiple bits set, so the
553 * the tests is relevant. 577 * order of the tests is relevant.
554 */ 578 */
555 if (md->attribute & EFI_MEMORY_WB) { 579 if (md->attribute & EFI_MEMORY_WB) {
556 md->virt_addr = (u64) __va(md->phys_addr); 580 md->virt_addr = (u64) __va(md->phys_addr);
@@ -558,21 +582,26 @@ efi_enter_virtual_mode (void)
558 md->virt_addr = (u64) ioremap(md->phys_addr, 0); 582 md->virt_addr = (u64) ioremap(md->phys_addr, 0);
559 } else if (md->attribute & EFI_MEMORY_WC) { 583 } else if (md->attribute & EFI_MEMORY_WC) {
560#if 0 584#if 0
561 md->virt_addr = ia64_remap(md->phys_addr, (_PAGE_A | _PAGE_P 585 md->virt_addr = ia64_remap(md->phys_addr,
562 | _PAGE_D 586 (_PAGE_A |
563 | _PAGE_MA_WC 587 _PAGE_P |
564 | _PAGE_PL_0 588 _PAGE_D |
565 | _PAGE_AR_RW)); 589 _PAGE_MA_WC |
590 _PAGE_PL_0 |
591 _PAGE_AR_RW));
566#else 592#else
567 printk(KERN_INFO "EFI_MEMORY_WC mapping\n"); 593 printk(KERN_INFO "EFI_MEMORY_WC mapping\n");
568 md->virt_addr = (u64) ioremap(md->phys_addr, 0); 594 md->virt_addr = (u64) ioremap(md->phys_addr, 0);
569#endif 595#endif
570 } else if (md->attribute & EFI_MEMORY_WT) { 596 } else if (md->attribute & EFI_MEMORY_WT) {
571#if 0 597#if 0
572 md->virt_addr = ia64_remap(md->phys_addr, (_PAGE_A | _PAGE_P 598 md->virt_addr = ia64_remap(md->phys_addr,
573 | _PAGE_D | _PAGE_MA_WT 599 (_PAGE_A |
574 | _PAGE_PL_0 600 _PAGE_P |
575 | _PAGE_AR_RW)); 601 _PAGE_D |
602 _PAGE_MA_WT |
603 _PAGE_PL_0 |
604 _PAGE_AR_RW));
576#else 605#else
577 printk(KERN_INFO "EFI_MEMORY_WT mapping\n"); 606 printk(KERN_INFO "EFI_MEMORY_WT mapping\n");
578 md->virt_addr = (u64) ioremap(md->phys_addr, 0); 607 md->virt_addr = (u64) ioremap(md->phys_addr, 0);
@@ -583,16 +612,18 @@ efi_enter_virtual_mode (void)
583 612
584 status = efi_call_phys(__va(runtime->set_virtual_address_map), 613 status = efi_call_phys(__va(runtime->set_virtual_address_map),
585 ia64_boot_param->efi_memmap_size, 614 ia64_boot_param->efi_memmap_size,
586 efi_desc_size, ia64_boot_param->efi_memdesc_version, 615 efi_desc_size,
616 ia64_boot_param->efi_memdesc_version,
587 ia64_boot_param->efi_memmap); 617 ia64_boot_param->efi_memmap);
588 if (status != EFI_SUCCESS) { 618 if (status != EFI_SUCCESS) {
589 printk(KERN_WARNING "warning: unable to switch EFI into virtual mode " 619 printk(KERN_WARNING "warning: unable to switch EFI into "
590 "(status=%lu)\n", status); 620 "virtual mode (status=%lu)\n", status);
591 return; 621 return;
592 } 622 }
593 623
594 /* 624 /*
595 * Now that EFI is in virtual mode, we call the EFI functions more efficiently: 625 * Now that EFI is in virtual mode, we call the EFI functions more
626 * efficiently:
596 */ 627 */
597 efi.get_time = virt_get_time; 628 efi.get_time = virt_get_time;
598 efi.set_time = virt_set_time; 629 efi.set_time = virt_set_time;
@@ -606,8 +637,8 @@ efi_enter_virtual_mode (void)
606} 637}
607 638
608/* 639/*
609 * Walk the EFI memory map looking for the I/O port range. There can only be one entry of 640 * Walk the EFI memory map looking for the I/O port range. There can only be
610 * this type, other I/O port ranges should be described via ACPI. 641 * one entry of this type, other I/O port ranges should be described via ACPI.
611 */ 642 */
612u64 643u64
613efi_get_iobase (void) 644efi_get_iobase (void)
@@ -678,7 +709,6 @@ efi_memmap_intersects (unsigned long phys_addr, unsigned long size)
678 709
679 for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) { 710 for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) {
680 md = p; 711 md = p;
681
682 if (md->phys_addr < end && efi_md_end(md) > phys_addr) 712 if (md->phys_addr < end && efi_md_end(md) > phys_addr)
683 return 1; 713 return 1;
684 } 714 }
@@ -731,7 +761,7 @@ efi_mem_attribute (unsigned long phys_addr, unsigned long size)
731 if (!md || (md->attribute & ~EFI_MEMORY_RUNTIME) != attr) 761 if (!md || (md->attribute & ~EFI_MEMORY_RUNTIME) != attr)
732 return 0; 762 return 0;
733 } while (md); 763 } while (md);
734 return 0; 764 return 0; /* never reached */
735} 765}
736 766
737u64 767u64
@@ -767,7 +797,7 @@ kern_mem_attribute (unsigned long phys_addr, unsigned long size)
767 if (!md || md->attribute != attr) 797 if (!md || md->attribute != attr)
768 return 0; 798 return 0;
769 } while (md); 799 } while (md);
770 return 0; 800 return 0; /* never reached */
771} 801}
772EXPORT_SYMBOL(kern_mem_attribute); 802EXPORT_SYMBOL(kern_mem_attribute);
773 803
@@ -883,7 +913,7 @@ efi_uart_console_only(void)
883 return 1; 913 return 1;
884 uart = 0; 914 uart = 0;
885 } 915 }
886 hdr = (struct efi_generic_dev_path *) ((u8 *) hdr + hdr->length); 916 hdr = (struct efi_generic_dev_path *)((u8 *) hdr + hdr->length);
887 } 917 }
888 printk(KERN_ERR "Malformed %s value\n", name); 918 printk(KERN_ERR "Malformed %s value\n", name);
889 return 0; 919 return 0;
@@ -921,10 +951,12 @@ find_memmap_space (void)
921 if (!efi_wb(md)) { 951 if (!efi_wb(md)) {
922 continue; 952 continue;
923 } 953 }
924 if (pmd == NULL || !efi_wb(pmd) || efi_md_end(pmd) != md->phys_addr) { 954 if (pmd == NULL || !efi_wb(pmd) ||
955 efi_md_end(pmd) != md->phys_addr) {
925 contig_low = GRANULEROUNDUP(md->phys_addr); 956 contig_low = GRANULEROUNDUP(md->phys_addr);
926 contig_high = efi_md_end(md); 957 contig_high = efi_md_end(md);
927 for (q = p + efi_desc_size; q < efi_map_end; q += efi_desc_size) { 958 for (q = p + efi_desc_size; q < efi_map_end;
959 q += efi_desc_size) {
928 check_md = q; 960 check_md = q;
929 if (!efi_wb(check_md)) 961 if (!efi_wb(check_md))
930 break; 962 break;
@@ -988,8 +1020,9 @@ efi_memmap_init(unsigned long *s, unsigned long *e)
988 for (p = efi_map_start; p < efi_map_end; pmd = md, p += efi_desc_size) { 1020 for (p = efi_map_start; p < efi_map_end; pmd = md, p += efi_desc_size) {
989 md = p; 1021 md = p;
990 if (!efi_wb(md)) { 1022 if (!efi_wb(md)) {
991 if (efi_uc(md) && (md->type == EFI_CONVENTIONAL_MEMORY || 1023 if (efi_uc(md) &&
992 md->type == EFI_BOOT_SERVICES_DATA)) { 1024 (md->type == EFI_CONVENTIONAL_MEMORY ||
1025 md->type == EFI_BOOT_SERVICES_DATA)) {
993 k->attribute = EFI_MEMORY_UC; 1026 k->attribute = EFI_MEMORY_UC;
994 k->start = md->phys_addr; 1027 k->start = md->phys_addr;
995 k->num_pages = md->num_pages; 1028 k->num_pages = md->num_pages;
@@ -997,10 +1030,12 @@ efi_memmap_init(unsigned long *s, unsigned long *e)
997 } 1030 }
998 continue; 1031 continue;
999 } 1032 }
1000 if (pmd == NULL || !efi_wb(pmd) || efi_md_end(pmd) != md->phys_addr) { 1033 if (pmd == NULL || !efi_wb(pmd) ||
1034 efi_md_end(pmd) != md->phys_addr) {
1001 contig_low = GRANULEROUNDUP(md->phys_addr); 1035 contig_low = GRANULEROUNDUP(md->phys_addr);
1002 contig_high = efi_md_end(md); 1036 contig_high = efi_md_end(md);
1003 for (q = p + efi_desc_size; q < efi_map_end; q += efi_desc_size) { 1037 for (q = p + efi_desc_size; q < efi_map_end;
1038 q += efi_desc_size) {
1004 check_md = q; 1039 check_md = q;
1005 if (!efi_wb(check_md)) 1040 if (!efi_wb(check_md))
1006 break; 1041 break;
@@ -1025,13 +1060,17 @@ efi_memmap_init(unsigned long *s, unsigned long *e)
1025 if (md->phys_addr < contig_low) { 1060 if (md->phys_addr < contig_low) {
1026 lim = min(efi_md_end(md), contig_low); 1061 lim = min(efi_md_end(md), contig_low);
1027 if (efi_uc(md)) { 1062 if (efi_uc(md)) {
1028 if (k > kern_memmap && (k-1)->attribute == EFI_MEMORY_UC && 1063 if (k > kern_memmap &&
1064 (k-1)->attribute == EFI_MEMORY_UC &&
1029 kmd_end(k-1) == md->phys_addr) { 1065 kmd_end(k-1) == md->phys_addr) {
1030 (k-1)->num_pages += (lim - md->phys_addr) >> EFI_PAGE_SHIFT; 1066 (k-1)->num_pages +=
1067 (lim - md->phys_addr)
1068 >> EFI_PAGE_SHIFT;
1031 } else { 1069 } else {
1032 k->attribute = EFI_MEMORY_UC; 1070 k->attribute = EFI_MEMORY_UC;
1033 k->start = md->phys_addr; 1071 k->start = md->phys_addr;
1034 k->num_pages = (lim - md->phys_addr) >> EFI_PAGE_SHIFT; 1072 k->num_pages = (lim - md->phys_addr)
1073 >> EFI_PAGE_SHIFT;
1035 k++; 1074 k++;
1036 } 1075 }
1037 } 1076 }
@@ -1049,7 +1088,8 @@ efi_memmap_init(unsigned long *s, unsigned long *e)
1049 } else { 1088 } else {
1050 k->attribute = EFI_MEMORY_UC; 1089 k->attribute = EFI_MEMORY_UC;
1051 k->start = lim; 1090 k->start = lim;
1052 k->num_pages = (efi_md_end(md) - lim) >> EFI_PAGE_SHIFT; 1091 k->num_pages = (efi_md_end(md) - lim)
1092 >> EFI_PAGE_SHIFT;
1053 k++; 1093 k++;
1054 } 1094 }
1055 } 1095 }
@@ -1151,8 +1191,10 @@ efi_initialize_iomem_resources(struct resource *code_resource,
1151 break; 1191 break;
1152 } 1192 }
1153 1193
1154 if ((res = kzalloc(sizeof(struct resource), GFP_KERNEL)) == NULL) { 1194 if ((res = kzalloc(sizeof(struct resource),
1155 printk(KERN_ERR "failed to alocate resource for iomem\n"); 1195 GFP_KERNEL)) == NULL) {
1196 printk(KERN_ERR
1197 "failed to allocate resource for iomem\n");
1156 return; 1198 return;
1157 } 1199 }
1158 1200
@@ -1187,44 +1229,44 @@ efi_initialize_iomem_resources(struct resource *code_resource,
1187 rsvd_regions are sorted 1229 rsvd_regions are sorted
1188 */ 1230 */
1189unsigned long __init 1231unsigned long __init
1190kdump_find_rsvd_region (unsigned long size, 1232kdump_find_rsvd_region (unsigned long size, struct rsvd_region *r, int n)
1191 struct rsvd_region *r, int n)
1192{ 1233{
1193 int i; 1234 int i;
1194 u64 start, end; 1235 u64 start, end;
1195 u64 alignment = 1UL << _PAGE_SIZE_64M; 1236 u64 alignment = 1UL << _PAGE_SIZE_64M;
1196 void *efi_map_start, *efi_map_end, *p; 1237 void *efi_map_start, *efi_map_end, *p;
1197 efi_memory_desc_t *md; 1238 efi_memory_desc_t *md;
1198 u64 efi_desc_size; 1239 u64 efi_desc_size;
1199 1240
1200 efi_map_start = __va(ia64_boot_param->efi_memmap); 1241 efi_map_start = __va(ia64_boot_param->efi_memmap);
1201 efi_map_end = efi_map_start + ia64_boot_param->efi_memmap_size; 1242 efi_map_end = efi_map_start + ia64_boot_param->efi_memmap_size;
1202 efi_desc_size = ia64_boot_param->efi_memdesc_size; 1243 efi_desc_size = ia64_boot_param->efi_memdesc_size;
1203 1244
1204 for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) { 1245 for (p = efi_map_start; p < efi_map_end; p += efi_desc_size) {
1205 md = p; 1246 md = p;
1206 if (!efi_wb(md)) 1247 if (!efi_wb(md))
1207 continue; 1248 continue;
1208 start = ALIGN(md->phys_addr, alignment); 1249 start = ALIGN(md->phys_addr, alignment);
1209 end = efi_md_end(md); 1250 end = efi_md_end(md);
1210 for (i = 0; i < n; i++) { 1251 for (i = 0; i < n; i++) {
1211 if (__pa(r[i].start) >= start && __pa(r[i].end) < end) { 1252 if (__pa(r[i].start) >= start && __pa(r[i].end) < end) {
1212 if (__pa(r[i].start) > start + size) 1253 if (__pa(r[i].start) > start + size)
1213 return start; 1254 return start;
1214 start = ALIGN(__pa(r[i].end), alignment); 1255 start = ALIGN(__pa(r[i].end), alignment);
1215 if (i < n-1 && __pa(r[i+1].start) < start + size) 1256 if (i < n-1 &&
1216 continue; 1257 __pa(r[i+1].start) < start + size)
1217 else 1258 continue;
1218 break; 1259 else
1260 break;
1261 }
1219 } 1262 }
1220 } 1263 if (end > start + size)
1221 if (end > start + size) 1264 return start;
1222 return start; 1265 }
1223 } 1266
1224 1267 printk(KERN_WARNING
1225 printk(KERN_WARNING "Cannot reserve 0x%lx byte of memory for crashdump\n", 1268 "Cannot reserve 0x%lx byte of memory for crashdump\n", size);
1226 size); 1269 return ~0UL;
1227 return ~0UL;
1228} 1270}
1229#endif 1271#endif
1230 1272
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index c36f43c94600..f5d3efbfbeda 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -1586,7 +1586,7 @@ sys_call_table:
1586 data8 sys_epoll_pwait // 1305 1586 data8 sys_epoll_pwait // 1305
1587 data8 sys_utimensat 1587 data8 sys_utimensat
1588 data8 sys_signalfd 1588 data8 sys_signalfd
1589 data8 sys_timerfd 1589 data8 sys_ni_syscall
1590 data8 sys_eventfd 1590 data8 sys_eventfd
1591 1591
1592 .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls 1592 .org sys_call_table + 8*NR_syscalls // guard against failures to increase NR_syscalls
diff --git a/arch/ia64/kernel/fsyscall_gtod_data.h b/arch/ia64/kernel/fsyscall_gtod_data.h
index 490dab55fba3..57d2ee6c83e1 100644
--- a/arch/ia64/kernel/fsyscall_gtod_data.h
+++ b/arch/ia64/kernel/fsyscall_gtod_data.h
@@ -14,10 +14,10 @@ struct fsyscall_gtod_data_t {
14 u32 clk_shift; 14 u32 clk_shift;
15 void *clk_fsys_mmio; 15 void *clk_fsys_mmio;
16 cycle_t clk_cycle_last; 16 cycle_t clk_cycle_last;
17} __attribute__ ((aligned (L1_CACHE_BYTES))); 17} ____cacheline_aligned;
18 18
19struct itc_jitter_data_t { 19struct itc_jitter_data_t {
20 int itc_jitter; 20 int itc_jitter;
21 cycle_t itc_lastcycle; 21 cycle_t itc_lastcycle;
22} __attribute__ ((aligned (L1_CACHE_BYTES))); 22} ____cacheline_aligned;
23 23
diff --git a/arch/ia64/kernel/ia64_ksyms.c b/arch/ia64/kernel/ia64_ksyms.c
index c3b4412ccc67..8e7193d55528 100644
--- a/arch/ia64/kernel/ia64_ksyms.c
+++ b/arch/ia64/kernel/ia64_ksyms.c
@@ -12,6 +12,9 @@ EXPORT_SYMBOL(memset);
12EXPORT_SYMBOL(memcpy); 12EXPORT_SYMBOL(memcpy);
13EXPORT_SYMBOL(strlen); 13EXPORT_SYMBOL(strlen);
14 14
15#include<asm/pgtable.h>
16EXPORT_SYMBOL_GPL(empty_zero_page);
17
15#include <asm/checksum.h> 18#include <asm/checksum.h>
16EXPORT_SYMBOL(ip_fast_csum); /* hand-coded assembly */ 19EXPORT_SYMBOL(ip_fast_csum); /* hand-coded assembly */
17EXPORT_SYMBOL(csum_ipv6_magic); 20EXPORT_SYMBOL(csum_ipv6_magic);
diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c
index fc4d2676264f..b618487cdc85 100644
--- a/arch/ia64/kernel/kprobes.c
+++ b/arch/ia64/kernel/kprobes.c
@@ -381,9 +381,10 @@ static void __kprobes save_previous_kprobe(struct kprobe_ctlblk *kcb)
381static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb) 381static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb)
382{ 382{
383 unsigned int i; 383 unsigned int i;
384 i = atomic_sub_return(1, &kcb->prev_kprobe_index); 384 i = atomic_read(&kcb->prev_kprobe_index);
385 __get_cpu_var(current_kprobe) = kcb->prev_kprobe[i].kp; 385 __get_cpu_var(current_kprobe) = kcb->prev_kprobe[i-1].kp;
386 kcb->kprobe_status = kcb->prev_kprobe[i].status; 386 kcb->kprobe_status = kcb->prev_kprobe[i-1].status;
387 atomic_sub(1, &kcb->prev_kprobe_index);
387} 388}
388 389
389static void __kprobes set_current_kprobe(struct kprobe *p, 390static void __kprobes set_current_kprobe(struct kprobe *p,
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
index 6dbf5919d2d0..846e7e036b13 100644
--- a/arch/ia64/kernel/mca.c
+++ b/arch/ia64/kernel/mca.c
@@ -2,61 +2,69 @@
2 * File: mca.c 2 * File: mca.c
3 * Purpose: Generic MCA handling layer 3 * Purpose: Generic MCA handling layer
4 * 4 *
5 * Updated for latest kernel
6 * Copyright (C) 2003 Hewlett-Packard Co 5 * Copyright (C) 2003 Hewlett-Packard Co
7 * David Mosberger-Tang <davidm@hpl.hp.com> 6 * David Mosberger-Tang <davidm@hpl.hp.com>
8 * 7 *
9 * Copyright (C) 2002 Dell Inc. 8 * Copyright (C) 2002 Dell Inc.
10 * Copyright (C) Matt Domsch (Matt_Domsch@dell.com) 9 * Copyright (C) Matt Domsch <Matt_Domsch@dell.com>
11 * 10 *
12 * Copyright (C) 2002 Intel 11 * Copyright (C) 2002 Intel
13 * Copyright (C) Jenna Hall (jenna.s.hall@intel.com) 12 * Copyright (C) Jenna Hall <jenna.s.hall@intel.com>
14 * 13 *
15 * Copyright (C) 2001 Intel 14 * Copyright (C) 2001 Intel
16 * Copyright (C) Fred Lewis (frederick.v.lewis@intel.com) 15 * Copyright (C) Fred Lewis <frederick.v.lewis@intel.com>
17 * 16 *
18 * Copyright (C) 2000 Intel 17 * Copyright (C) 2000 Intel
19 * Copyright (C) Chuck Fleckenstein (cfleck@co.intel.com) 18 * Copyright (C) Chuck Fleckenstein <cfleck@co.intel.com>
20 * 19 *
21 * Copyright (C) 1999, 2004 Silicon Graphics, Inc. 20 * Copyright (C) 1999, 2004 Silicon Graphics, Inc.
22 * Copyright (C) Vijay Chander(vijay@engr.sgi.com) 21 * Copyright (C) Vijay Chander <vijay@engr.sgi.com>
23 * 22 *
24 * 03/04/15 D. Mosberger Added INIT backtrace support. 23 * Copyright (C) 2006 FUJITSU LIMITED
25 * 02/03/25 M. Domsch GUID cleanups 24 * Copyright (C) Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
26 * 25 *
27 * 02/01/04 J. Hall Aligned MCA stack to 16 bytes, added platform vs. CPU 26 * 2000-03-29 Chuck Fleckenstein <cfleck@co.intel.com>
28 * error flag, set SAL default return values, changed 27 * Fixed PAL/SAL update issues, began MCA bug fixes, logging issues,
29 * error record structure to linked list, added init call 28 * added min save state dump, added INIT handler.
30 * to sal_get_state_info_size().
31 * 29 *
32 * 01/01/03 F. Lewis Added setup of CMCI and CPEI IRQs, logging of corrected 30 * 2001-01-03 Fred Lewis <frederick.v.lewis@intel.com>
33 * platform errors, completed code for logging of 31 * Added setup of CMCI and CPEI IRQs, logging of corrected platform
34 * corrected & uncorrected machine check errors, and 32 * errors, completed code for logging of corrected & uncorrected
35 * updated for conformance with Nov. 2000 revision of the 33 * machine check errors, and updated for conformance with Nov. 2000
36 * SAL 3.0 spec. 34 * revision of the SAL 3.0 spec.
37 * 00/03/29 C. Fleckenstein Fixed PAL/SAL update issues, began MCA bug fixes, logging issues, 35 *
38 * added min save state dump, added INIT handler. 36 * 2002-01-04 Jenna Hall <jenna.s.hall@intel.com>
37 * Aligned MCA stack to 16 bytes, added platform vs. CPU error flag,
38 * set SAL default return values, changed error record structure to
39 * linked list, added init call to sal_get_state_info_size().
40 *
41 * 2002-03-25 Matt Domsch <Matt_Domsch@dell.com>
42 * GUID cleanups.
43 *
44 * 2003-04-15 David Mosberger-Tang <davidm@hpl.hp.com>
45 * Added INIT backtrace support.
39 * 46 *
40 * 2003-12-08 Keith Owens <kaos@sgi.com> 47 * 2003-12-08 Keith Owens <kaos@sgi.com>
41 * smp_call_function() must not be called from interrupt context (can 48 * smp_call_function() must not be called from interrupt context
42 * deadlock on tasklist_lock). Use keventd to call smp_call_function(). 49 * (can deadlock on tasklist_lock).
50 * Use keventd to call smp_call_function().
43 * 51 *
44 * 2004-02-01 Keith Owens <kaos@sgi.com> 52 * 2004-02-01 Keith Owens <kaos@sgi.com>
45 * Avoid deadlock when using printk() for MCA and INIT records. 53 * Avoid deadlock when using printk() for MCA and INIT records.
46 * Delete all record printing code, moved to salinfo_decode in user space. 54 * Delete all record printing code, moved to salinfo_decode in user
47 * Mark variables and functions static where possible. 55 * space. Mark variables and functions static where possible.
48 * Delete dead variables and functions. 56 * Delete dead variables and functions. Reorder to remove the need
49 * Reorder to remove the need for forward declarations and to consolidate 57 * for forward declarations and to consolidate related code.
50 * related code.
51 * 58 *
52 * 2005-08-12 Keith Owens <kaos@sgi.com> 59 * 2005-08-12 Keith Owens <kaos@sgi.com>
53 * Convert MCA/INIT handlers to use per event stacks and SAL/OS state. 60 * Convert MCA/INIT handlers to use per event stacks and SAL/OS
61 * state.
54 * 62 *
55 * 2005-10-07 Keith Owens <kaos@sgi.com> 63 * 2005-10-07 Keith Owens <kaos@sgi.com>
56 * Add notify_die() hooks. 64 * Add notify_die() hooks.
57 * 65 *
58 * 2006-09-15 Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com> 66 * 2006-09-15 Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
59 * Add printing support for MCA/INIT. 67 * Add printing support for MCA/INIT.
60 * 68 *
61 * 2007-04-27 Russ Anderson <rja@sgi.com> 69 * 2007-04-27 Russ Anderson <rja@sgi.com>
62 * Support multiple cpus going through OS_MCA in the same event. 70 * Support multiple cpus going through OS_MCA in the same event.
diff --git a/arch/ia64/kernel/mca_asm.S b/arch/ia64/kernel/mca_asm.S
index 0f5965fcdf85..8bc7d259e0c6 100644
--- a/arch/ia64/kernel/mca_asm.S
+++ b/arch/ia64/kernel/mca_asm.S
@@ -1,24 +1,28 @@
1// 1/*
2// assembly portion of the IA64 MCA handling 2 * File: mca_asm.S
3// 3 * Purpose: assembly portion of the IA64 MCA handling
4// Mods by cfleck to integrate into kernel build 4 *
5// 00/03/15 davidm Added various stop bits to get a clean compile 5 * Mods by cfleck to integrate into kernel build
6// 6 *
7// 00/03/29 cfleck Added code to save INIT handoff state in pt_regs format, switch to temp 7 * 2000-03-15 David Mosberger-Tang <davidm@hpl.hp.com>
8// kstack, switch modes, jump to C INIT handler 8 * Added various stop bits to get a clean compile
9// 9 *
10// 02/01/04 J.Hall <jenna.s.hall@intel.com> 10 * 2000-03-29 Chuck Fleckenstein <cfleck@co.intel.com>
11// Before entering virtual mode code: 11 * Added code to save INIT handoff state in pt_regs format,
12// 1. Check for TLB CPU error 12 * switch to temp kstack, switch modes, jump to C INIT handler
13// 2. Restore current thread pointer to kr6 13 *
14// 3. Move stack ptr 16 bytes to conform to C calling convention 14 * 2002-01-04 J.Hall <jenna.s.hall@intel.com>
15// 15 * Before entering virtual mode code:
16// 04/11/12 Russ Anderson <rja@sgi.com> 16 * 1. Check for TLB CPU error
17// Added per cpu MCA/INIT stack save areas. 17 * 2. Restore current thread pointer to kr6
18// 18 * 3. Move stack ptr 16 bytes to conform to C calling convention
19// 12/08/05 Keith Owens <kaos@sgi.com> 19 *
20// Use per cpu MCA/INIT stacks for all data. 20 * 2004-11-12 Russ Anderson <rja@sgi.com>
21// 21 * Added per cpu MCA/INIT stack save areas.
22 *
23 * 2005-12-08 Keith Owens <kaos@sgi.com>
24 * Use per cpu MCA/INIT stacks for all data.
25 */
22#include <linux/threads.h> 26#include <linux/threads.h>
23 27
24#include <asm/asmmacro.h> 28#include <asm/asmmacro.h>
diff --git a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c
index aba813c2c150..fab1d21a4f2c 100644
--- a/arch/ia64/kernel/mca_drv.c
+++ b/arch/ia64/kernel/mca_drv.c
@@ -3,7 +3,7 @@
3 * Purpose: Generic MCA handling layer 3 * Purpose: Generic MCA handling layer
4 * 4 *
5 * Copyright (C) 2004 FUJITSU LIMITED 5 * Copyright (C) 2004 FUJITSU LIMITED
6 * Copyright (C) Hidetoshi Seto (seto.hidetoshi@jp.fujitsu.com) 6 * Copyright (C) 2004 Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
7 * Copyright (C) 2005 Silicon Graphics, Inc 7 * Copyright (C) 2005 Silicon Graphics, Inc
8 * Copyright (C) 2005 Keith Owens <kaos@sgi.com> 8 * Copyright (C) 2005 Keith Owens <kaos@sgi.com>
9 * Copyright (C) 2006 Russ Anderson <rja@sgi.com> 9 * Copyright (C) 2006 Russ Anderson <rja@sgi.com>
diff --git a/arch/ia64/kernel/mca_drv.h b/arch/ia64/kernel/mca_drv.h
index 485e34d0b199..53b8ecb5b4b9 100644
--- a/arch/ia64/kernel/mca_drv.h
+++ b/arch/ia64/kernel/mca_drv.h
@@ -3,7 +3,7 @@
3 * Purpose: Define helpers for Generic MCA handling 3 * Purpose: Define helpers for Generic MCA handling
4 * 4 *
5 * Copyright (C) 2004 FUJITSU LIMITED 5 * Copyright (C) 2004 FUJITSU LIMITED
6 * Copyright (C) Hidetoshi Seto (seto.hidetoshi@jp.fujitsu.com) 6 * Copyright (C) 2004 Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
7 */ 7 */
8/* 8/*
9 * Processor error section: 9 * Processor error section:
diff --git a/arch/ia64/kernel/mca_drv_asm.S b/arch/ia64/kernel/mca_drv_asm.S
index 3bccb06c8d21..767ac2c20d16 100644
--- a/arch/ia64/kernel/mca_drv_asm.S
+++ b/arch/ia64/kernel/mca_drv_asm.S
@@ -3,7 +3,7 @@
3 * Purpose: Assembly portion of Generic MCA handling 3 * Purpose: Assembly portion of Generic MCA handling
4 * 4 *
5 * Copyright (C) 2004 FUJITSU LIMITED 5 * Copyright (C) 2004 FUJITSU LIMITED
6 * Copyright (C) Hidetoshi Seto (seto.hidetoshi@jp.fujitsu.com) 6 * Copyright (C) 2004 Hidetoshi Seto <seto.hidetoshi@jp.fujitsu.com>
7 */ 7 */
8#include <linux/threads.h> 8#include <linux/threads.h>
9 9
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c
index 5ae177f557d8..78acd9fe97e9 100644
--- a/arch/ia64/kernel/perfmon.c
+++ b/arch/ia64/kernel/perfmon.c
@@ -2654,11 +2654,11 @@ pfm_get_task(pfm_context_t *ctx, pid_t pid, struct task_struct **task)
2654 /* XXX: need to add more checks here */ 2654 /* XXX: need to add more checks here */
2655 if (pid < 2) return -EPERM; 2655 if (pid < 2) return -EPERM;
2656 2656
2657 if (pid != current->pid) { 2657 if (pid != task_pid_vnr(current)) {
2658 2658
2659 read_lock(&tasklist_lock); 2659 read_lock(&tasklist_lock);
2660 2660
2661 p = find_task_by_pid(pid); 2661 p = find_task_by_vpid(pid);
2662 2662
2663 /* make sure task cannot go away while we operate on it */ 2663 /* make sure task cannot go away while we operate on it */
2664 if (p) get_task_struct(p); 2664 if (p) get_task_struct(p);
@@ -5795,7 +5795,7 @@ pfm_proc_show(struct seq_file *m, void *v)
5795 return 0; 5795 return 0;
5796} 5796}
5797 5797
5798struct seq_operations pfm_seq_ops = { 5798const struct seq_operations pfm_seq_ops = {
5799 .start = pfm_proc_start, 5799 .start = pfm_proc_start,
5800 .next = pfm_proc_next, 5800 .next = pfm_proc_next,
5801 .stop = pfm_proc_stop, 5801 .stop = pfm_proc_stop,
diff --git a/arch/ia64/kernel/sal.c b/arch/ia64/kernel/sal.c
index 27c2ef445a56..f44fe8412162 100644
--- a/arch/ia64/kernel/sal.c
+++ b/arch/ia64/kernel/sal.c
@@ -284,6 +284,7 @@ ia64_sal_cache_flush (u64 cache_type)
284 SAL_CALL(isrv, SAL_CACHE_FLUSH, cache_type, 0, 0, 0, 0, 0, 0); 284 SAL_CALL(isrv, SAL_CACHE_FLUSH, cache_type, 0, 0, 0, 0, 0, 0);
285 return isrv.status; 285 return isrv.status;
286} 286}
287EXPORT_SYMBOL_GPL(ia64_sal_cache_flush);
287 288
288void __init 289void __init
289ia64_sal_init (struct ia64_sal_systab *systab) 290ia64_sal_init (struct ia64_sal_systab *systab)
@@ -372,3 +373,16 @@ ia64_sal_oemcall_reentrant(struct ia64_sal_retval *isrvp, u64 oemfunc,
372 return 0; 373 return 0;
373} 374}
374EXPORT_SYMBOL(ia64_sal_oemcall_reentrant); 375EXPORT_SYMBOL(ia64_sal_oemcall_reentrant);
376
377long
378ia64_sal_freq_base (unsigned long which, unsigned long *ticks_per_second,
379 unsigned long *drift_info)
380{
381 struct ia64_sal_retval isrv;
382
383 SAL_CALL(isrv, SAL_FREQ_BASE, which, 0, 0, 0, 0, 0, 0);
384 *ticks_per_second = isrv.v0;
385 *drift_info = isrv.v1;
386 return isrv.status;
387}
388EXPORT_SYMBOL_GPL(ia64_sal_freq_base);
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c
index 86028c69861e..ebd1a09f3201 100644
--- a/arch/ia64/kernel/setup.c
+++ b/arch/ia64/kernel/setup.c
@@ -654,7 +654,7 @@ c_stop (struct seq_file *m, void *v)
654{ 654{
655} 655}
656 656
657struct seq_operations cpuinfo_op = { 657const struct seq_operations cpuinfo_op = {
658 .start = c_start, 658 .start = c_start,
659 .next = c_next, 659 .next = c_next,
660 .stop = c_stop, 660 .stop = c_stop,
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c
index f0fc4d8465ad..480b1a5085d5 100644
--- a/arch/ia64/kernel/smpboot.c
+++ b/arch/ia64/kernel/smpboot.c
@@ -767,17 +767,6 @@ void __cpu_die(unsigned int cpu)
767 } 767 }
768 printk(KERN_ERR "CPU %u didn't die...\n", cpu); 768 printk(KERN_ERR "CPU %u didn't die...\n", cpu);
769} 769}
770#else /* !CONFIG_HOTPLUG_CPU */
771int __cpu_disable(void)
772{
773 return -ENOSYS;
774}
775
776void __cpu_die(unsigned int cpu)
777{
778 /* We said "no" in __cpu_disable */
779 BUG();
780}
781#endif /* CONFIG_HOTPLUG_CPU */ 770#endif /* CONFIG_HOTPLUG_CPU */
782 771
783void 772void
diff --git a/arch/ia64/kernel/traps.c b/arch/ia64/kernel/traps.c
index 78d65cb947d2..f0cda765e681 100644
--- a/arch/ia64/kernel/traps.c
+++ b/arch/ia64/kernel/traps.c
@@ -35,7 +35,7 @@ trap_init (void)
35 fpswa_interface = __va(ia64_boot_param->fpswa); 35 fpswa_interface = __va(ia64_boot_param->fpswa);
36} 36}
37 37
38void 38int
39die (const char *str, struct pt_regs *regs, long err) 39die (const char *str, struct pt_regs *regs, long err)
40{ 40{
41 static struct { 41 static struct {
@@ -62,8 +62,11 @@ die (const char *str, struct pt_regs *regs, long err)
62 if (++die.lock_owner_depth < 3) { 62 if (++die.lock_owner_depth < 3) {
63 printk("%s[%d]: %s %ld [%d]\n", 63 printk("%s[%d]: %s %ld [%d]\n",
64 current->comm, task_pid_nr(current), str, err, ++die_counter); 64 current->comm, task_pid_nr(current), str, err, ++die_counter);
65 (void) notify_die(DIE_OOPS, (char *)str, regs, err, 255, SIGSEGV); 65 if (notify_die(DIE_OOPS, str, regs, err, 255, SIGSEGV)
66 show_regs(regs); 66 != NOTIFY_STOP)
67 show_regs(regs);
68 else
69 regs = NULL;
67 } else 70 } else
68 printk(KERN_ERR "Recursive die() failure, output suppressed\n"); 71 printk(KERN_ERR "Recursive die() failure, output suppressed\n");
69 72
@@ -72,17 +75,22 @@ die (const char *str, struct pt_regs *regs, long err)
72 add_taint(TAINT_DIE); 75 add_taint(TAINT_DIE);
73 spin_unlock_irq(&die.lock); 76 spin_unlock_irq(&die.lock);
74 77
78 if (!regs)
79 return 1;
80
75 if (panic_on_oops) 81 if (panic_on_oops)
76 panic("Fatal exception"); 82 panic("Fatal exception");
77 83
78 do_exit(SIGSEGV); 84 do_exit(SIGSEGV);
85 return 0;
79} 86}
80 87
81void 88int
82die_if_kernel (char *str, struct pt_regs *regs, long err) 89die_if_kernel (char *str, struct pt_regs *regs, long err)
83{ 90{
84 if (!user_mode(regs)) 91 if (!user_mode(regs))
85 die(str, regs, err); 92 return die(str, regs, err);
93 return 0;
86} 94}
87 95
88void 96void
@@ -102,7 +110,8 @@ __kprobes ia64_bad_break (unsigned long break_num, struct pt_regs *regs)
102 if (notify_die(DIE_BREAK, "break 0", regs, break_num, TRAP_BRKPT, SIGTRAP) 110 if (notify_die(DIE_BREAK, "break 0", regs, break_num, TRAP_BRKPT, SIGTRAP)
103 == NOTIFY_STOP) 111 == NOTIFY_STOP)
104 return; 112 return;
105 die_if_kernel("bugcheck!", regs, break_num); 113 if (die_if_kernel("bugcheck!", regs, break_num))
114 return;
106 sig = SIGILL; code = ILL_ILLOPC; 115 sig = SIGILL; code = ILL_ILLOPC;
107 break; 116 break;
108 117
@@ -155,8 +164,9 @@ __kprobes ia64_bad_break (unsigned long break_num, struct pt_regs *regs)
155 break; 164 break;
156 165
157 default: 166 default:
158 if (break_num < 0x40000 || break_num > 0x100000) 167 if ((break_num < 0x40000 || break_num > 0x100000)
159 die_if_kernel("Bad break", regs, break_num); 168 && die_if_kernel("Bad break", regs, break_num))
169 return;
160 170
161 if (break_num < 0x80000) { 171 if (break_num < 0x80000) {
162 sig = SIGILL; code = __ILL_BREAK; 172 sig = SIGILL; code = __ILL_BREAK;
@@ -402,14 +412,15 @@ ia64_illegal_op_fault (unsigned long ec, long arg1, long arg2, long arg3,
402#endif 412#endif
403 413
404 sprintf(buf, "IA-64 Illegal operation fault"); 414 sprintf(buf, "IA-64 Illegal operation fault");
405 die_if_kernel(buf, &regs, 0); 415 rv.fkt = 0;
416 if (die_if_kernel(buf, &regs, 0))
417 return rv;
406 418
407 memset(&si, 0, sizeof(si)); 419 memset(&si, 0, sizeof(si));
408 si.si_signo = SIGILL; 420 si.si_signo = SIGILL;
409 si.si_code = ILL_ILLOPC; 421 si.si_code = ILL_ILLOPC;
410 si.si_addr = (void __user *) (regs.cr_iip + ia64_psr(&regs)->ri); 422 si.si_addr = (void __user *) (regs.cr_iip + ia64_psr(&regs)->ri);
411 force_sig_info(SIGILL, &si, current); 423 force_sig_info(SIGILL, &si, current);
412 rv.fkt = 0;
413 return rv; 424 return rv;
414} 425}
415 426
@@ -644,6 +655,6 @@ ia64_fault (unsigned long vector, unsigned long isr, unsigned long ifa,
644 sprintf(buf, "Fault %lu", vector); 655 sprintf(buf, "Fault %lu", vector);
645 break; 656 break;
646 } 657 }
647 die_if_kernel(buf, &regs, error); 658 if (!die_if_kernel(buf, &regs, error))
648 force_sig(SIGILL, current); 659 force_sig(SIGILL, current);
649} 660}
diff --git a/arch/ia64/kernel/unaligned.c b/arch/ia64/kernel/unaligned.c
index f6a1aeb742b3..52f70bbc192a 100644
--- a/arch/ia64/kernel/unaligned.c
+++ b/arch/ia64/kernel/unaligned.c
@@ -23,7 +23,7 @@
23#include <asm/uaccess.h> 23#include <asm/uaccess.h>
24#include <asm/unaligned.h> 24#include <asm/unaligned.h>
25 25
26extern void die_if_kernel(char *str, struct pt_regs *regs, long err); 26extern int die_if_kernel(char *str, struct pt_regs *regs, long err);
27 27
28#undef DEBUG_UNALIGNED_TRAP 28#undef DEBUG_UNALIGNED_TRAP
29 29
@@ -675,8 +675,9 @@ emulate_load_updates (update_t type, load_store_t ld, struct pt_regs *regs, unsi
675 */ 675 */
676 if (ld.x6_op == 1 || ld.x6_op == 3) { 676 if (ld.x6_op == 1 || ld.x6_op == 3) {
677 printk(KERN_ERR "%s: register update on speculative load, error\n", __FUNCTION__); 677 printk(KERN_ERR "%s: register update on speculative load, error\n", __FUNCTION__);
678 die_if_kernel("unaligned reference on speculative load with register update\n", 678 if (die_if_kernel("unaligned reference on speculative load with register update\n",
679 regs, 30); 679 regs, 30))
680 return;
680 } 681 }
681 682
682 683
@@ -1317,7 +1318,8 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
1317 1318
1318 if (ia64_psr(regs)->be) { 1319 if (ia64_psr(regs)->be) {
1319 /* we don't support big-endian accesses */ 1320 /* we don't support big-endian accesses */
1320 die_if_kernel("big-endian unaligned accesses are not supported", regs, 0); 1321 if (die_if_kernel("big-endian unaligned accesses are not supported", regs, 0))
1322 return;
1321 goto force_sigbus; 1323 goto force_sigbus;
1322 } 1324 }
1323 1325
@@ -1534,7 +1536,8 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs)
1534 ia64_handle_exception(regs, eh); 1536 ia64_handle_exception(regs, eh);
1535 goto done; 1537 goto done;
1536 } 1538 }
1537 die_if_kernel("error during unaligned kernel access\n", regs, ret); 1539 if (die_if_kernel("error during unaligned kernel access\n", regs, ret))
1540 return;
1538 /* NOT_REACHED */ 1541 /* NOT_REACHED */
1539 } 1542 }
1540 force_sigbus: 1543 force_sigbus: