diff options
Diffstat (limited to 'arch/ia64')
32 files changed, 476 insertions, 439 deletions
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig index bef47725d4ad..b0de1132dfc0 100644 --- a/arch/ia64/Kconfig +++ b/arch/ia64/Kconfig | |||
@@ -15,6 +15,8 @@ config IA64 | |||
15 | select ACPI if (!IA64_HP_SIM) | 15 | select ACPI if (!IA64_HP_SIM) |
16 | select PM if (!IA64_HP_SIM) | 16 | select PM if (!IA64_HP_SIM) |
17 | select ARCH_SUPPORTS_MSI | 17 | select ARCH_SUPPORTS_MSI |
18 | select HAVE_OPROFILE | ||
19 | select HAVE_KPROBES | ||
18 | default y | 20 | default y |
19 | help | 21 | help |
20 | The Itanium Processor Family is Intel's 64-bit successor to | 22 | The Itanium Processor Family is Intel's 64-bit successor to |
@@ -42,6 +44,11 @@ config MMU | |||
42 | config SWIOTLB | 44 | config SWIOTLB |
43 | bool | 45 | bool |
44 | 46 | ||
47 | config GENERIC_LOCKBREAK | ||
48 | bool | ||
49 | default y | ||
50 | depends on SMP && PREEMPT | ||
51 | |||
45 | config RWSEM_XCHGADD_ALGORITHM | 52 | config RWSEM_XCHGADD_ALGORITHM |
46 | bool | 53 | bool |
47 | default y | 54 | default y |
@@ -75,6 +82,9 @@ config GENERIC_TIME_VSYSCALL | |||
75 | bool | 82 | bool |
76 | default y | 83 | default y |
77 | 84 | ||
85 | config HAVE_SETUP_PER_CPU_AREA | ||
86 | def_bool y | ||
87 | |||
78 | config DMI | 88 | config DMI |
79 | bool | 89 | bool |
80 | default y | 90 | default y |
@@ -275,8 +285,8 @@ config SMP | |||
275 | single processor systems. On a single processor system, the kernel | 285 | single processor systems. On a single processor system, the kernel |
276 | will run faster if you say N here. | 286 | will run faster if you say N here. |
277 | 287 | ||
278 | See also the <file:Documentation/smp.txt> and the SMP-HOWTO | 288 | See also the SMP-HOWTO available at |
279 | available at <http://www.tldp.org/docs.html#howto>. | 289 | <http://www.tldp.org/docs.html#howto>. |
280 | 290 | ||
281 | If you don't know what to do here, say N. | 291 | If you don't know what to do here, say N. |
282 | 292 | ||
@@ -592,8 +602,6 @@ config IRQ_PER_CPU | |||
592 | 602 | ||
593 | source "arch/ia64/hp/sim/Kconfig" | 603 | source "arch/ia64/hp/sim/Kconfig" |
594 | 604 | ||
595 | source "kernel/Kconfig.instrumentation" | ||
596 | |||
597 | source "arch/ia64/Kconfig.debug" | 605 | source "arch/ia64/Kconfig.debug" |
598 | 606 | ||
599 | source "security/Kconfig" | 607 | source "security/Kconfig" |
diff --git a/arch/ia64/hp/common/sba_iommu.c b/arch/ia64/hp/common/sba_iommu.c index 45bf04eb7d70..a94445422cc6 100644 --- a/arch/ia64/hp/common/sba_iommu.c +++ b/arch/ia64/hp/common/sba_iommu.c | |||
@@ -1265,7 +1265,7 @@ sba_fill_pdir( | |||
1265 | * the sglist do both. | 1265 | * the sglist do both. |
1266 | */ | 1266 | */ |
1267 | static SBA_INLINE int | 1267 | static SBA_INLINE int |
1268 | sba_coalesce_chunks( struct ioc *ioc, | 1268 | sba_coalesce_chunks(struct ioc *ioc, struct device *dev, |
1269 | struct scatterlist *startsg, | 1269 | struct scatterlist *startsg, |
1270 | int nents) | 1270 | int nents) |
1271 | { | 1271 | { |
@@ -1275,6 +1275,7 @@ sba_coalesce_chunks( struct ioc *ioc, | |||
1275 | struct scatterlist *dma_sg; /* next DMA stream head */ | 1275 | struct scatterlist *dma_sg; /* next DMA stream head */ |
1276 | unsigned long dma_offset, dma_len; /* start/len of DMA stream */ | 1276 | unsigned long dma_offset, dma_len; /* start/len of DMA stream */ |
1277 | int n_mappings = 0; | 1277 | int n_mappings = 0; |
1278 | unsigned int max_seg_size = dma_get_max_seg_size(dev); | ||
1278 | 1279 | ||
1279 | while (nents > 0) { | 1280 | while (nents > 0) { |
1280 | unsigned long vaddr = (unsigned long) sba_sg_address(startsg); | 1281 | unsigned long vaddr = (unsigned long) sba_sg_address(startsg); |
@@ -1314,6 +1315,9 @@ sba_coalesce_chunks( struct ioc *ioc, | |||
1314 | > DMA_CHUNK_SIZE) | 1315 | > DMA_CHUNK_SIZE) |
1315 | break; | 1316 | break; |
1316 | 1317 | ||
1318 | if (dma_len + startsg->length > max_seg_size) | ||
1319 | break; | ||
1320 | |||
1317 | /* | 1321 | /* |
1318 | ** Then look for virtually contiguous blocks. | 1322 | ** Then look for virtually contiguous blocks. |
1319 | ** | 1323 | ** |
@@ -1441,7 +1445,7 @@ int sba_map_sg(struct device *dev, struct scatterlist *sglist, int nents, int di | |||
1441 | ** w/o this association, we wouldn't have coherent DMA! | 1445 | ** w/o this association, we wouldn't have coherent DMA! |
1442 | ** Access to the virtual address is what forces a two pass algorithm. | 1446 | ** Access to the virtual address is what forces a two pass algorithm. |
1443 | */ | 1447 | */ |
1444 | coalesced = sba_coalesce_chunks(ioc, sglist, nents); | 1448 | coalesced = sba_coalesce_chunks(ioc, dev, sglist, nents); |
1445 | 1449 | ||
1446 | /* | 1450 | /* |
1447 | ** Program the I/O Pdir | 1451 | ** Program the I/O Pdir |
@@ -1871,7 +1875,7 @@ ioc_show(struct seq_file *s, void *v) | |||
1871 | return 0; | 1875 | return 0; |
1872 | } | 1876 | } |
1873 | 1877 | ||
1874 | static struct seq_operations ioc_seq_ops = { | 1878 | static const struct seq_operations ioc_seq_ops = { |
1875 | .start = ioc_start, | 1879 | .start = ioc_start, |
1876 | .next = ioc_next, | 1880 | .next = ioc_next, |
1877 | .stop = ioc_stop, | 1881 | .stop = ioc_stop, |
diff --git a/arch/ia64/hp/sim/simeth.c b/arch/ia64/hp/sim/simeth.c index 08b117e2c54b..9898febf609a 100644 --- a/arch/ia64/hp/sim/simeth.c +++ b/arch/ia64/hp/sim/simeth.c | |||
@@ -497,11 +497,6 @@ simeth_interrupt(int irq, void *dev_id) | |||
497 | { | 497 | { |
498 | struct net_device *dev = dev_id; | 498 | struct net_device *dev = dev_id; |
499 | 499 | ||
500 | if ( dev == NULL ) { | ||
501 | printk(KERN_WARNING "simeth: irq %d for unknown device\n", irq); | ||
502 | return IRQ_NONE; | ||
503 | } | ||
504 | |||
505 | /* | 500 | /* |
506 | * very simple loop because we get interrupts only when receiving | 501 | * very simple loop because we get interrupts only when receiving |
507 | */ | 502 | */ |
diff --git a/arch/ia64/hp/sim/simscsi.c b/arch/ia64/hp/sim/simscsi.c index 6ef9b5219930..7661bb065fa5 100644 --- a/arch/ia64/hp/sim/simscsi.c +++ b/arch/ia64/hp/sim/simscsi.c | |||
@@ -360,7 +360,6 @@ static struct scsi_host_template driver_template = { | |||
360 | .max_sectors = 1024, | 360 | .max_sectors = 1024, |
361 | .cmd_per_lun = SIMSCSI_REQ_QUEUE_LEN, | 361 | .cmd_per_lun = SIMSCSI_REQ_QUEUE_LEN, |
362 | .use_clustering = DISABLE_CLUSTERING, | 362 | .use_clustering = DISABLE_CLUSTERING, |
363 | .use_sg_chaining = ENABLE_SG_CHAINING, | ||
364 | }; | 363 | }; |
365 | 364 | ||
366 | static int __init | 365 | static int __init |
diff --git a/arch/ia64/ia32/binfmt_elf32.c b/arch/ia64/ia32/binfmt_elf32.c index 3e35987af458..4f0c30c38e99 100644 --- a/arch/ia64/ia32/binfmt_elf32.c +++ b/arch/ia64/ia32/binfmt_elf32.c | |||
@@ -222,7 +222,8 @@ elf32_set_personality (void) | |||
222 | } | 222 | } |
223 | 223 | ||
224 | static unsigned long | 224 | static unsigned long |
225 | elf32_map (struct file *filep, unsigned long addr, struct elf_phdr *eppnt, int prot, int type) | 225 | elf32_map(struct file *filep, unsigned long addr, struct elf_phdr *eppnt, |
226 | int prot, int type, unsigned long unused) | ||
226 | { | 227 | { |
227 | unsigned long pgoff = (eppnt->p_vaddr) & ~IA32_PAGE_MASK; | 228 | unsigned long pgoff = (eppnt->p_vaddr) & ~IA32_PAGE_MASK; |
228 | 229 | ||
diff --git a/arch/ia64/ia32/ia32_support.c b/arch/ia64/ia32/ia32_support.c index d1d50cd1c38a..896b1ebbfb26 100644 --- a/arch/ia64/ia32/ia32_support.c +++ b/arch/ia64/ia32/ia32_support.c | |||
@@ -27,7 +27,7 @@ | |||
27 | 27 | ||
28 | #include "ia32priv.h" | 28 | #include "ia32priv.h" |
29 | 29 | ||
30 | extern void die_if_kernel (char *str, struct pt_regs *regs, long err); | 30 | extern int die_if_kernel (char *str, struct pt_regs *regs, long err); |
31 | 31 | ||
32 | struct exec_domain ia32_exec_domain; | 32 | struct exec_domain ia32_exec_domain; |
33 | struct page *ia32_shared_page[NR_CPUS]; | 33 | struct page *ia32_shared_page[NR_CPUS]; |
@@ -217,7 +217,8 @@ ia32_bad_interrupt (unsigned long int_num, struct pt_regs *regs) | |||
217 | { | 217 | { |
218 | siginfo_t siginfo; | 218 | siginfo_t siginfo; |
219 | 219 | ||
220 | die_if_kernel("Bad IA-32 interrupt", regs, int_num); | 220 | if (die_if_kernel("Bad IA-32 interrupt", regs, int_num)) |
221 | return; | ||
221 | 222 | ||
222 | siginfo.si_signo = SIGTRAP; | 223 | siginfo.si_signo = SIGTRAP; |
223 | siginfo.si_errno = int_num; /* XXX is it OK to abuse si_errno like this? */ | 224 | siginfo.si_errno = int_num; /* XXX is it OK to abuse si_errno like this? */ |
diff --git a/arch/ia64/kernel/acpi.c b/arch/ia64/kernel/acpi.c index 00b5d08f6da8..d20a3cc8b424 100644 --- a/arch/ia64/kernel/acpi.c +++ b/arch/ia64/kernel/acpi.c | |||
@@ -69,6 +69,20 @@ unsigned int acpi_cpei_phys_cpuid; | |||
69 | 69 | ||
70 | unsigned long acpi_wakeup_address = 0; | 70 | unsigned long acpi_wakeup_address = 0; |
71 | 71 | ||
72 | #ifdef CONFIG_IA64_GENERIC | ||
73 | static unsigned long __init acpi_find_rsdp(void) | ||
74 | { | ||
75 | unsigned long rsdp_phys = 0; | ||
76 | |||
77 | if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) | ||
78 | rsdp_phys = efi.acpi20; | ||
79 | else if (efi.acpi != EFI_INVALID_TABLE_ADDR) | ||
80 | printk(KERN_WARNING PREFIX | ||
81 | "v1.0/r0.71 tables no longer supported\n"); | ||
82 | return rsdp_phys; | ||
83 | } | ||
84 | #endif | ||
85 | |||
72 | const char __init * | 86 | const char __init * |
73 | acpi_get_sysname(void) | 87 | acpi_get_sysname(void) |
74 | { | 88 | { |
@@ -631,18 +645,6 @@ static int __init acpi_parse_fadt(struct acpi_table_header *table) | |||
631 | return 0; | 645 | return 0; |
632 | } | 646 | } |
633 | 647 | ||
634 | unsigned long __init acpi_find_rsdp(void) | ||
635 | { | ||
636 | unsigned long rsdp_phys = 0; | ||
637 | |||
638 | if (efi.acpi20 != EFI_INVALID_TABLE_ADDR) | ||
639 | rsdp_phys = efi.acpi20; | ||
640 | else if (efi.acpi != EFI_INVALID_TABLE_ADDR) | ||
641 | printk(KERN_WARNING PREFIX | ||
642 | "v1.0/r0.71 tables no longer supported\n"); | ||
643 | return rsdp_phys; | ||
644 | } | ||
645 | |||
646 | int __init acpi_boot_init(void) | 648 | int __init acpi_boot_init(void) |
647 | { | 649 | { |
648 | 650 | ||
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) \ |
52 | static efi_status_t \ | 53 | static efi_status_t \ |
53 | prefix##_get_time (efi_time_t *tm, efi_time_cap_t *tc) \ | 54 | prefix##_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) \ |
68 | static efi_status_t \ | 70 | static efi_status_t \ |
69 | prefix##_set_time (efi_time_t *tm) \ | 71 | prefix##_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) \ |
81 | static efi_status_t \ | 84 | static efi_status_t \ |
82 | prefix##_get_wakeup_time (efi_bool_t *enabled, efi_bool_t *pending, efi_time_t *tm) \ | 85 | prefix##_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) \ |
95 | static efi_status_t \ | 100 | static efi_status_t \ |
96 | prefix##_set_wakeup_time (efi_bool_t enabled, efi_time_t *tm) \ | 101 | prefix##_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) \ |
112 | static efi_status_t \ | 118 | static efi_status_t \ |
113 | prefix##_get_variable (efi_char16_t *name, efi_guid_t *vendor, u32 *attr, \ | 119 | prefix##_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) \ |
131 | static efi_status_t \ | 138 | static efi_status_t \ |
132 | prefix##_get_next_variable (unsigned long *name_size, efi_char16_t *name, efi_guid_t *vendor) \ | 139 | prefix##_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) \ |
145 | static efi_status_t \ | 154 | static efi_status_t \ |
146 | prefix##_set_variable (efi_char16_t *name, efi_guid_t *vendor, unsigned long attr, \ | 155 | prefix##_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) \ |
161 | static efi_status_t \ | 172 | static efi_status_t \ |
162 | prefix##_get_next_high_mono_count (u32 *count) \ | 173 | prefix##_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) \ |
175 | static void \ | 187 | static void \ |
176 | prefix##_reset_system (int reset_type, efi_status_t status, \ | 188 | prefix##_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 | */ |
303 | void | 317 | void |
304 | efi_memmap_walk (efi_freemem_callback_t callback, void *arg) | 318 | efi_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 | */ |
313 | void | 327 | void |
314 | efi_memmap_walk_uc (efi_freemem_callback_t callback, void *arg) | 328 | efi_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 | |||
325 | void * | 338 | void * |
326 | efi_get_pal_addr (void) | 339 | efi_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 | ||
411 | void __init | 426 | void __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 | */ |
612 | u64 | 643 | u64 |
613 | efi_get_iobase (void) | 644 | efi_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 | ||
737 | u64 | 767 | u64 |
@@ -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 | } |
772 | EXPORT_SYMBOL(kern_mem_attribute); | 802 | EXPORT_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 | */ |
1189 | unsigned long __init | 1231 | unsigned long __init |
1190 | kdump_find_rsvd_region (unsigned long size, | 1232 | kdump_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 | ||
19 | struct itc_jitter_data_t { | 19 | struct 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); | |||
12 | EXPORT_SYMBOL(memcpy); | 12 | EXPORT_SYMBOL(memcpy); |
13 | EXPORT_SYMBOL(strlen); | 13 | EXPORT_SYMBOL(strlen); |
14 | 14 | ||
15 | #include<asm/pgtable.h> | ||
16 | EXPORT_SYMBOL_GPL(empty_zero_page); | ||
17 | |||
15 | #include <asm/checksum.h> | 18 | #include <asm/checksum.h> |
16 | EXPORT_SYMBOL(ip_fast_csum); /* hand-coded assembly */ | 19 | EXPORT_SYMBOL(ip_fast_csum); /* hand-coded assembly */ |
17 | EXPORT_SYMBOL(csum_ipv6_magic); | 20 | EXPORT_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) | |||
381 | static void __kprobes restore_previous_kprobe(struct kprobe_ctlblk *kcb) | 381 | static 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 | ||
389 | static void __kprobes set_current_kprobe(struct kprobe *p, | 390 | static 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/module.c b/arch/ia64/kernel/module.c index 196287928bae..e58f4367cf11 100644 --- a/arch/ia64/kernel/module.c +++ b/arch/ia64/kernel/module.c | |||
@@ -940,14 +940,3 @@ module_arch_cleanup (struct module *mod) | |||
940 | if (mod->arch.core_unw_table) | 940 | if (mod->arch.core_unw_table) |
941 | unw_remove_unwind_table(mod->arch.core_unw_table); | 941 | unw_remove_unwind_table(mod->arch.core_unw_table); |
942 | } | 942 | } |
943 | |||
944 | #ifdef CONFIG_SMP | ||
945 | void | ||
946 | percpu_modcopy (void *pcpudst, const void *src, unsigned long size) | ||
947 | { | ||
948 | unsigned int i; | ||
949 | for_each_possible_cpu(i) { | ||
950 | memcpy(pcpudst + __per_cpu_offset[i], src, size); | ||
951 | } | ||
952 | } | ||
953 | #endif /* CONFIG_SMP */ | ||
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index 73e7c2e40b54..78acd9fe97e9 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c | |||
@@ -2631,7 +2631,7 @@ pfm_task_incompatible(pfm_context_t *ctx, struct task_struct *task) | |||
2631 | */ | 2631 | */ |
2632 | if (task == current) return 0; | 2632 | if (task == current) return 0; |
2633 | 2633 | ||
2634 | if ((task->state != TASK_STOPPED) && (task->state != TASK_TRACED)) { | 2634 | if (!task_is_stopped_or_traced(task)) { |
2635 | DPRINT(("cannot attach to non-stopped task [%d] state=%ld\n", task_pid_nr(task), task->state)); | 2635 | DPRINT(("cannot attach to non-stopped task [%d] state=%ld\n", task_pid_nr(task), task->state)); |
2636 | return -EBUSY; | 2636 | return -EBUSY; |
2637 | } | 2637 | } |
@@ -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); |
@@ -4792,7 +4792,7 @@ recheck: | |||
4792 | * the task must be stopped. | 4792 | * the task must be stopped. |
4793 | */ | 4793 | */ |
4794 | if (PFM_CMD_STOPPED(cmd)) { | 4794 | if (PFM_CMD_STOPPED(cmd)) { |
4795 | if ((task->state != TASK_STOPPED) && (task->state != TASK_TRACED)) { | 4795 | if (!task_is_stopped_or_traced(task)) { |
4796 | DPRINT(("[%d] task not in stopped state\n", task_pid_nr(task))); | 4796 | DPRINT(("[%d] task not in stopped state\n", task_pid_nr(task))); |
4797 | return -EBUSY; | 4797 | return -EBUSY; |
4798 | } | 4798 | } |
@@ -5795,7 +5795,7 @@ pfm_proc_show(struct seq_file *m, void *v) | |||
5795 | return 0; | 5795 | return 0; |
5796 | } | 5796 | } |
5797 | 5797 | ||
5798 | struct seq_operations pfm_seq_ops = { | 5798 | const 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 | } |
287 | EXPORT_SYMBOL_GPL(ia64_sal_cache_flush); | ||
287 | 288 | ||
288 | void __init | 289 | void __init |
289 | ia64_sal_init (struct ia64_sal_systab *systab) | 290 | ia64_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 | } |
374 | EXPORT_SYMBOL(ia64_sal_oemcall_reentrant); | 375 | EXPORT_SYMBOL(ia64_sal_oemcall_reentrant); |
376 | |||
377 | long | ||
378 | ia64_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 | } | ||
388 | EXPORT_SYMBOL_GPL(ia64_sal_freq_base); | ||
diff --git a/arch/ia64/kernel/setup.c b/arch/ia64/kernel/setup.c index 4ac2b1f1bd3b..ebd1a09f3201 100644 --- a/arch/ia64/kernel/setup.c +++ b/arch/ia64/kernel/setup.c | |||
@@ -71,8 +71,6 @@ unsigned long __per_cpu_offset[NR_CPUS]; | |||
71 | EXPORT_SYMBOL(__per_cpu_offset); | 71 | EXPORT_SYMBOL(__per_cpu_offset); |
72 | #endif | 72 | #endif |
73 | 73 | ||
74 | extern void ia64_setup_printk_clock(void); | ||
75 | |||
76 | DEFINE_PER_CPU(struct cpuinfo_ia64, cpu_info); | 74 | DEFINE_PER_CPU(struct cpuinfo_ia64, cpu_info); |
77 | DEFINE_PER_CPU(unsigned long, local_per_cpu_offset); | 75 | DEFINE_PER_CPU(unsigned long, local_per_cpu_offset); |
78 | unsigned long ia64_cycles_per_usec; | 76 | unsigned long ia64_cycles_per_usec; |
@@ -507,8 +505,6 @@ setup_arch (char **cmdline_p) | |||
507 | /* process SAL system table: */ | 505 | /* process SAL system table: */ |
508 | ia64_sal_init(__va(efi.sal_systab)); | 506 | ia64_sal_init(__va(efi.sal_systab)); |
509 | 507 | ||
510 | ia64_setup_printk_clock(); | ||
511 | |||
512 | #ifdef CONFIG_SMP | 508 | #ifdef CONFIG_SMP |
513 | cpu_physical_id(0) = hard_smp_processor_id(); | 509 | cpu_physical_id(0) = hard_smp_processor_id(); |
514 | #endif | 510 | #endif |
@@ -658,7 +654,7 @@ c_stop (struct seq_file *m, void *v) | |||
658 | { | 654 | { |
659 | } | 655 | } |
660 | 656 | ||
661 | struct seq_operations cpuinfo_op = { | 657 | const struct seq_operations cpuinfo_op = { |
662 | .start = c_start, | 658 | .start = c_start, |
663 | .next = c_next, | 659 | .next = c_next, |
664 | .stop = c_stop, | 660 | .stop = c_stop, |
diff --git a/arch/ia64/kernel/smpboot.c b/arch/ia64/kernel/smpboot.c index f0fc4d8465ad..32ee5979a042 100644 --- a/arch/ia64/kernel/smpboot.c +++ b/arch/ia64/kernel/smpboot.c | |||
@@ -120,7 +120,6 @@ static volatile unsigned long go[SLAVE + 1]; | |||
120 | 120 | ||
121 | #define DEBUG_ITC_SYNC 0 | 121 | #define DEBUG_ITC_SYNC 0 |
122 | 122 | ||
123 | extern void __devinit calibrate_delay (void); | ||
124 | extern void start_ap (void); | 123 | extern void start_ap (void); |
125 | extern unsigned long ia64_iobase; | 124 | extern unsigned long ia64_iobase; |
126 | 125 | ||
@@ -477,7 +476,7 @@ start_secondary (void *unused) | |||
477 | return 0; | 476 | return 0; |
478 | } | 477 | } |
479 | 478 | ||
480 | struct pt_regs * __devinit idle_regs(struct pt_regs *regs) | 479 | struct pt_regs * __cpuinit idle_regs(struct pt_regs *regs) |
481 | { | 480 | { |
482 | return NULL; | 481 | return NULL; |
483 | } | 482 | } |
@@ -767,17 +766,6 @@ void __cpu_die(unsigned int cpu) | |||
767 | } | 766 | } |
768 | printk(KERN_ERR "CPU %u didn't die...\n", cpu); | 767 | printk(KERN_ERR "CPU %u didn't die...\n", cpu); |
769 | } | 768 | } |
770 | #else /* !CONFIG_HOTPLUG_CPU */ | ||
771 | int __cpu_disable(void) | ||
772 | { | ||
773 | return -ENOSYS; | ||
774 | } | ||
775 | |||
776 | void __cpu_die(unsigned int cpu) | ||
777 | { | ||
778 | /* We said "no" in __cpu_disable */ | ||
779 | BUG(); | ||
780 | } | ||
781 | #endif /* CONFIG_HOTPLUG_CPU */ | 769 | #endif /* CONFIG_HOTPLUG_CPU */ |
782 | 770 | ||
783 | void | 771 | void |
diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c index 2bb84214e5f1..3ab042720970 100644 --- a/arch/ia64/kernel/time.c +++ b/arch/ia64/kernel/time.c | |||
@@ -344,33 +344,6 @@ udelay (unsigned long usecs) | |||
344 | } | 344 | } |
345 | EXPORT_SYMBOL(udelay); | 345 | EXPORT_SYMBOL(udelay); |
346 | 346 | ||
347 | static unsigned long long ia64_itc_printk_clock(void) | ||
348 | { | ||
349 | if (ia64_get_kr(IA64_KR_PER_CPU_DATA)) | ||
350 | return sched_clock(); | ||
351 | return 0; | ||
352 | } | ||
353 | |||
354 | static unsigned long long ia64_default_printk_clock(void) | ||
355 | { | ||
356 | return (unsigned long long)(jiffies_64 - INITIAL_JIFFIES) * | ||
357 | (1000000000/HZ); | ||
358 | } | ||
359 | |||
360 | unsigned long long (*ia64_printk_clock)(void) = &ia64_default_printk_clock; | ||
361 | |||
362 | unsigned long long printk_clock(void) | ||
363 | { | ||
364 | return ia64_printk_clock(); | ||
365 | } | ||
366 | |||
367 | void __init | ||
368 | ia64_setup_printk_clock(void) | ||
369 | { | ||
370 | if (!(sal_platform_features & IA64_SAL_PLATFORM_FEATURE_ITC_DRIFT)) | ||
371 | ia64_printk_clock = ia64_itc_printk_clock; | ||
372 | } | ||
373 | |||
374 | /* IA64 doesn't cache the timezone */ | 347 | /* IA64 doesn't cache the timezone */ |
375 | void update_vsyscall_tz(void) | 348 | void update_vsyscall_tz(void) |
376 | { | 349 | { |
diff --git a/arch/ia64/kernel/topology.c b/arch/ia64/kernel/topology.c index 14261fee5f4d..a2484fc1a06c 100644 --- a/arch/ia64/kernel/topology.c +++ b/arch/ia64/kernel/topology.c | |||
@@ -354,27 +354,27 @@ static int __cpuinit cache_add_dev(struct sys_device * sys_dev) | |||
354 | if (unlikely(retval < 0)) | 354 | if (unlikely(retval < 0)) |
355 | return retval; | 355 | return retval; |
356 | 356 | ||
357 | all_cpu_cache_info[cpu].kobj.parent = &sys_dev->kobj; | 357 | retval = kobject_init_and_add(&all_cpu_cache_info[cpu].kobj, |
358 | kobject_set_name(&all_cpu_cache_info[cpu].kobj, "%s", "cache"); | 358 | &cache_ktype_percpu_entry, &sys_dev->kobj, |
359 | all_cpu_cache_info[cpu].kobj.ktype = &cache_ktype_percpu_entry; | 359 | "%s", "cache"); |
360 | retval = kobject_register(&all_cpu_cache_info[cpu].kobj); | ||
361 | 360 | ||
362 | for (i = 0; i < all_cpu_cache_info[cpu].num_cache_leaves; i++) { | 361 | for (i = 0; i < all_cpu_cache_info[cpu].num_cache_leaves; i++) { |
363 | this_object = LEAF_KOBJECT_PTR(cpu,i); | 362 | this_object = LEAF_KOBJECT_PTR(cpu,i); |
364 | this_object->kobj.parent = &all_cpu_cache_info[cpu].kobj; | 363 | retval = kobject_init_and_add(&(this_object->kobj), |
365 | kobject_set_name(&(this_object->kobj), "index%1lu", i); | 364 | &cache_ktype, |
366 | this_object->kobj.ktype = &cache_ktype; | 365 | &all_cpu_cache_info[cpu].kobj, |
367 | retval = kobject_register(&(this_object->kobj)); | 366 | "index%1lu", i); |
368 | if (unlikely(retval)) { | 367 | if (unlikely(retval)) { |
369 | for (j = 0; j < i; j++) { | 368 | for (j = 0; j < i; j++) { |
370 | kobject_unregister( | 369 | kobject_put(&(LEAF_KOBJECT_PTR(cpu,j)->kobj)); |
371 | &(LEAF_KOBJECT_PTR(cpu,j)->kobj)); | ||
372 | } | 370 | } |
373 | kobject_unregister(&all_cpu_cache_info[cpu].kobj); | 371 | kobject_put(&all_cpu_cache_info[cpu].kobj); |
374 | cpu_cache_sysfs_exit(cpu); | 372 | cpu_cache_sysfs_exit(cpu); |
375 | break; | 373 | break; |
376 | } | 374 | } |
375 | kobject_uevent(&(this_object->kobj), KOBJ_ADD); | ||
377 | } | 376 | } |
377 | kobject_uevent(&all_cpu_cache_info[cpu].kobj, KOBJ_ADD); | ||
378 | return retval; | 378 | return retval; |
379 | } | 379 | } |
380 | 380 | ||
@@ -385,10 +385,10 @@ static int __cpuinit cache_remove_dev(struct sys_device * sys_dev) | |||
385 | unsigned long i; | 385 | unsigned long i; |
386 | 386 | ||
387 | for (i = 0; i < all_cpu_cache_info[cpu].num_cache_leaves; i++) | 387 | for (i = 0; i < all_cpu_cache_info[cpu].num_cache_leaves; i++) |
388 | kobject_unregister(&(LEAF_KOBJECT_PTR(cpu,i)->kobj)); | 388 | kobject_put(&(LEAF_KOBJECT_PTR(cpu,i)->kobj)); |
389 | 389 | ||
390 | if (all_cpu_cache_info[cpu].kobj.parent) { | 390 | if (all_cpu_cache_info[cpu].kobj.parent) { |
391 | kobject_unregister(&all_cpu_cache_info[cpu].kobj); | 391 | kobject_put(&all_cpu_cache_info[cpu].kobj); |
392 | memset(&all_cpu_cache_info[cpu].kobj, | 392 | memset(&all_cpu_cache_info[cpu].kobj, |
393 | 0, | 393 | 0, |
394 | sizeof(struct kobject)); | 394 | sizeof(struct kobject)); |
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 | ||
38 | void | 38 | int |
39 | die (const char *str, struct pt_regs *regs, long err) | 39 | die (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 | ||
81 | void | 88 | int |
82 | die_if_kernel (char *str, struct pt_regs *regs, long err) | 89 | die_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 | ||
88 | void | 96 | void |
@@ -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, ®s, 0); | 415 | rv.fkt = 0; |
416 | if (die_if_kernel(buf, ®s, 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(®s)->ri); | 422 | si.si_addr = (void __user *) (regs.cr_iip + ia64_psr(®s)->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, ®s, error); | 658 | if (!die_if_kernel(buf, ®s, 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 2173de9fe917..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 | ||
26 | extern void die_if_kernel(char *str, struct pt_regs *regs, long err); | 26 | extern 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 | ||
@@ -1488,16 +1490,19 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs) | |||
1488 | case LDFA_OP: | 1490 | case LDFA_OP: |
1489 | case LDFCCLR_OP: | 1491 | case LDFCCLR_OP: |
1490 | case LDFCNC_OP: | 1492 | case LDFCNC_OP: |
1491 | case LDF_IMM_OP: | ||
1492 | case LDFA_IMM_OP: | ||
1493 | case LDFCCLR_IMM_OP: | ||
1494 | case LDFCNC_IMM_OP: | ||
1495 | if (u.insn.x) | 1493 | if (u.insn.x) |
1496 | ret = emulate_load_floatpair(ifa, u.insn, regs); | 1494 | ret = emulate_load_floatpair(ifa, u.insn, regs); |
1497 | else | 1495 | else |
1498 | ret = emulate_load_float(ifa, u.insn, regs); | 1496 | ret = emulate_load_float(ifa, u.insn, regs); |
1499 | break; | 1497 | break; |
1500 | 1498 | ||
1499 | case LDF_IMM_OP: | ||
1500 | case LDFA_IMM_OP: | ||
1501 | case LDFCCLR_IMM_OP: | ||
1502 | case LDFCNC_IMM_OP: | ||
1503 | ret = emulate_load_float(ifa, u.insn, regs); | ||
1504 | break; | ||
1505 | |||
1501 | case STF_OP: | 1506 | case STF_OP: |
1502 | case STF_IMM_OP: | 1507 | case STF_IMM_OP: |
1503 | ret = emulate_store_float(ifa, u.insn, regs); | 1508 | ret = emulate_store_float(ifa, u.insn, regs); |
@@ -1531,7 +1536,8 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs) | |||
1531 | ia64_handle_exception(regs, eh); | 1536 | ia64_handle_exception(regs, eh); |
1532 | goto done; | 1537 | goto done; |
1533 | } | 1538 | } |
1534 | 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; | ||
1535 | /* NOT_REACHED */ | 1541 | /* NOT_REACHED */ |
1536 | } | 1542 | } |
1537 | force_sigbus: | 1543 | force_sigbus: |
diff --git a/arch/ia64/kernel/vmlinux.lds.S b/arch/ia64/kernel/vmlinux.lds.S index 757e419ebcf8..80622acc95de 100644 --- a/arch/ia64/kernel/vmlinux.lds.S +++ b/arch/ia64/kernel/vmlinux.lds.S | |||
@@ -27,8 +27,8 @@ SECTIONS | |||
27 | { | 27 | { |
28 | /* Sections to be discarded */ | 28 | /* Sections to be discarded */ |
29 | /DISCARD/ : { | 29 | /DISCARD/ : { |
30 | *(.exit.text) | 30 | EXIT_TEXT |
31 | *(.exit.data) | 31 | EXIT_DATA |
32 | *(.exitcall.exit) | 32 | *(.exitcall.exit) |
33 | *(.IA_64.unwind.exit.text) | 33 | *(.IA_64.unwind.exit.text) |
34 | *(.IA_64.unwind_info.exit.text) | 34 | *(.IA_64.unwind_info.exit.text) |
@@ -119,12 +119,12 @@ SECTIONS | |||
119 | .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) | 119 | .init.text : AT(ADDR(.init.text) - LOAD_OFFSET) |
120 | { | 120 | { |
121 | _sinittext = .; | 121 | _sinittext = .; |
122 | *(.init.text) | 122 | INIT_TEXT |
123 | _einittext = .; | 123 | _einittext = .; |
124 | } | 124 | } |
125 | 125 | ||
126 | .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) | 126 | .init.data : AT(ADDR(.init.data) - LOAD_OFFSET) |
127 | { *(.init.data) } | 127 | { INIT_DATA } |
128 | 128 | ||
129 | #ifdef CONFIG_BLK_DEV_INITRD | 129 | #ifdef CONFIG_BLK_DEV_INITRD |
130 | .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) | 130 | .init.ramfs : AT(ADDR(.init.ramfs) - LOAD_OFFSET) |
diff --git a/arch/ia64/mm/fault.c b/arch/ia64/mm/fault.c index 7571076a16a1..3e69881648a3 100644 --- a/arch/ia64/mm/fault.c +++ b/arch/ia64/mm/fault.c | |||
@@ -16,7 +16,7 @@ | |||
16 | #include <asm/system.h> | 16 | #include <asm/system.h> |
17 | #include <asm/uaccess.h> | 17 | #include <asm/uaccess.h> |
18 | 18 | ||
19 | extern void die (char *, struct pt_regs *, long); | 19 | extern int die(char *, struct pt_regs *, long); |
20 | 20 | ||
21 | #ifdef CONFIG_KPROBES | 21 | #ifdef CONFIG_KPROBES |
22 | static inline int notify_page_fault(struct pt_regs *regs, int trap) | 22 | static inline int notify_page_fault(struct pt_regs *regs, int trap) |
@@ -267,9 +267,11 @@ ia64_do_page_fault (unsigned long address, unsigned long isr, struct pt_regs *re | |||
267 | else | 267 | else |
268 | printk(KERN_ALERT "Unable to handle kernel paging request at " | 268 | printk(KERN_ALERT "Unable to handle kernel paging request at " |
269 | "virtual address %016lx\n", address); | 269 | "virtual address %016lx\n", address); |
270 | die("Oops", regs, isr); | 270 | if (die("Oops", regs, isr)) |
271 | regs = NULL; | ||
271 | bust_spinlocks(0); | 272 | bust_spinlocks(0); |
272 | do_exit(SIGKILL); | 273 | if (regs) |
274 | do_exit(SIGKILL); | ||
273 | return; | 275 | return; |
274 | 276 | ||
275 | out_of_memory: | 277 | out_of_memory: |
diff --git a/arch/ia64/sn/kernel/setup.c b/arch/ia64/sn/kernel/setup.c index 1f38a3a68390..bb1d24929640 100644 --- a/arch/ia64/sn/kernel/setup.c +++ b/arch/ia64/sn/kernel/setup.c | |||
@@ -64,7 +64,6 @@ extern void sn_timer_init(void); | |||
64 | extern unsigned long last_time_offset; | 64 | extern unsigned long last_time_offset; |
65 | extern void (*ia64_mark_idle) (int); | 65 | extern void (*ia64_mark_idle) (int); |
66 | extern void snidle(int); | 66 | extern void snidle(int); |
67 | extern unsigned long long (*ia64_printk_clock)(void); | ||
68 | 67 | ||
69 | unsigned long sn_rtc_cycles_per_second; | 68 | unsigned long sn_rtc_cycles_per_second; |
70 | EXPORT_SYMBOL(sn_rtc_cycles_per_second); | 69 | EXPORT_SYMBOL(sn_rtc_cycles_per_second); |
@@ -360,14 +359,6 @@ sn_scan_pcdp(void) | |||
360 | 359 | ||
361 | static unsigned long sn2_rtc_initial; | 360 | static unsigned long sn2_rtc_initial; |
362 | 361 | ||
363 | static unsigned long long ia64_sn2_printk_clock(void) | ||
364 | { | ||
365 | unsigned long rtc_now = rtc_time(); | ||
366 | |||
367 | return (rtc_now - sn2_rtc_initial) * | ||
368 | (1000000000 / sn_rtc_cycles_per_second); | ||
369 | } | ||
370 | |||
371 | /** | 362 | /** |
372 | * sn_setup - SN platform setup routine | 363 | * sn_setup - SN platform setup routine |
373 | * @cmdline_p: kernel command line | 364 | * @cmdline_p: kernel command line |
@@ -468,8 +459,6 @@ void __init sn_setup(char **cmdline_p) | |||
468 | 459 | ||
469 | platform_intr_list[ACPI_INTERRUPT_CPEI] = IA64_CPE_VECTOR; | 460 | platform_intr_list[ACPI_INTERRUPT_CPEI] = IA64_CPE_VECTOR; |
470 | 461 | ||
471 | ia64_printk_clock = ia64_sn2_printk_clock; | ||
472 | |||
473 | printk("SGI SAL version %x.%02x\n", version >> 8, version & 0x00FF); | 462 | printk("SGI SAL version %x.%02x\n", version >> 8, version & 0x00FF); |
474 | 463 | ||
475 | /* | 464 | /* |
diff --git a/arch/ia64/sn/kernel/sn2/sn2_smp.c b/arch/ia64/sn/kernel/sn2/sn2_smp.c index f3c69329e145..dfc6bf1c7b41 100644 --- a/arch/ia64/sn/kernel/sn2/sn2_smp.c +++ b/arch/ia64/sn/kernel/sn2/sn2_smp.c | |||
@@ -523,7 +523,7 @@ static ssize_t sn2_ptc_proc_write(struct file *file, const char __user *user, si | |||
523 | return count; | 523 | return count; |
524 | } | 524 | } |
525 | 525 | ||
526 | static struct seq_operations sn2_ptc_seq_ops = { | 526 | static const struct seq_operations sn2_ptc_seq_ops = { |
527 | .start = sn2_ptc_seq_start, | 527 | .start = sn2_ptc_seq_start, |
528 | .next = sn2_ptc_seq_next, | 528 | .next = sn2_ptc_seq_next, |
529 | .stop = sn2_ptc_seq_stop, | 529 | .stop = sn2_ptc_seq_stop, |
diff --git a/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/arch/ia64/sn/kernel/sn2/sn_hwperf.c index 1a8e49607f11..4b0d1538e7e5 100644 --- a/arch/ia64/sn/kernel/sn2/sn_hwperf.c +++ b/arch/ia64/sn/kernel/sn2/sn_hwperf.c | |||
@@ -33,6 +33,7 @@ | |||
33 | #include <linux/smp_lock.h> | 33 | #include <linux/smp_lock.h> |
34 | #include <linux/nodemask.h> | 34 | #include <linux/nodemask.h> |
35 | #include <linux/smp.h> | 35 | #include <linux/smp.h> |
36 | #include <linux/mutex.h> | ||
36 | 37 | ||
37 | #include <asm/processor.h> | 38 | #include <asm/processor.h> |
38 | #include <asm/topology.h> | 39 | #include <asm/topology.h> |
@@ -50,7 +51,7 @@ static void *sn_hwperf_salheap = NULL; | |||
50 | static int sn_hwperf_obj_cnt = 0; | 51 | static int sn_hwperf_obj_cnt = 0; |
51 | static nasid_t sn_hwperf_master_nasid = INVALID_NASID; | 52 | static nasid_t sn_hwperf_master_nasid = INVALID_NASID; |
52 | static int sn_hwperf_init(void); | 53 | static int sn_hwperf_init(void); |
53 | static DECLARE_MUTEX(sn_hwperf_init_mutex); | 54 | static DEFINE_MUTEX(sn_hwperf_init_mutex); |
54 | 55 | ||
55 | #define cnode_possible(n) ((n) < num_cnodes) | 56 | #define cnode_possible(n) ((n) < num_cnodes) |
56 | 57 | ||
@@ -577,7 +578,7 @@ static void sn_topology_stop(struct seq_file *m, void *v) | |||
577 | /* | 578 | /* |
578 | * /proc/sgi_sn/sn_topology, read-only using seq_file | 579 | * /proc/sgi_sn/sn_topology, read-only using seq_file |
579 | */ | 580 | */ |
580 | static struct seq_operations sn_topology_seq_ops = { | 581 | static const struct seq_operations sn_topology_seq_ops = { |
581 | .start = sn_topology_start, | 582 | .start = sn_topology_start, |
582 | .next = sn_topology_next, | 583 | .next = sn_topology_next, |
583 | .stop = sn_topology_stop, | 584 | .stop = sn_topology_stop, |
@@ -884,10 +885,10 @@ static int sn_hwperf_init(void) | |||
884 | int e = 0; | 885 | int e = 0; |
885 | 886 | ||
886 | /* single threaded, once-only initialization */ | 887 | /* single threaded, once-only initialization */ |
887 | down(&sn_hwperf_init_mutex); | 888 | mutex_lock(&sn_hwperf_init_mutex); |
888 | 889 | ||
889 | if (sn_hwperf_salheap) { | 890 | if (sn_hwperf_salheap) { |
890 | up(&sn_hwperf_init_mutex); | 891 | mutex_unlock(&sn_hwperf_init_mutex); |
891 | return e; | 892 | return e; |
892 | } | 893 | } |
893 | 894 | ||
@@ -936,7 +937,7 @@ out: | |||
936 | sn_hwperf_salheap = NULL; | 937 | sn_hwperf_salheap = NULL; |
937 | sn_hwperf_obj_cnt = 0; | 938 | sn_hwperf_obj_cnt = 0; |
938 | } | 939 | } |
939 | up(&sn_hwperf_init_mutex); | 940 | mutex_unlock(&sn_hwperf_init_mutex); |
940 | return e; | 941 | return e; |
941 | } | 942 | } |
942 | 943 | ||
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_provider.c b/arch/ia64/sn/pci/pcibr/pcibr_provider.c index ab3eaf85fe4d..2c676cc05418 100644 --- a/arch/ia64/sn/pci/pcibr/pcibr_provider.c +++ b/arch/ia64/sn/pci/pcibr/pcibr_provider.c | |||
@@ -100,11 +100,11 @@ u16 sn_ioboard_to_pci_bus(struct pci_bus *pci_bus) | |||
100 | static irqreturn_t | 100 | static irqreturn_t |
101 | pcibr_error_intr_handler(int irq, void *arg) | 101 | pcibr_error_intr_handler(int irq, void *arg) |
102 | { | 102 | { |
103 | struct pcibus_info *soft = (struct pcibus_info *)arg; | 103 | struct pcibus_info *soft = arg; |
104 | 104 | ||
105 | if (sal_pcibr_error_interrupt(soft) < 0) { | 105 | if (sal_pcibr_error_interrupt(soft) < 0) |
106 | panic("pcibr_error_intr_handler(): Fatal Bridge Error"); | 106 | panic("pcibr_error_intr_handler(): Fatal Bridge Error"); |
107 | } | 107 | |
108 | return IRQ_HANDLED; | 108 | return IRQ_HANDLED; |
109 | } | 109 | } |
110 | 110 | ||