aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64
diff options
context:
space:
mode:
Diffstat (limited to 'arch/ia64')
-rw-r--r--arch/ia64/Kconfig2
-rw-r--r--arch/ia64/hp/sim/simserial.c2
-rw-r--r--arch/ia64/ia32/sys_ia32.c23
-rw-r--r--arch/ia64/kernel/entry.S4
-rw-r--r--arch/ia64/kernel/kprobes.c98
-rw-r--r--arch/ia64/kernel/mca.c2
-rw-r--r--arch/ia64/kernel/numa.c1
-rw-r--r--arch/ia64/kernel/process.c2
-rw-r--r--arch/ia64/kernel/time.c2
-rw-r--r--arch/ia64/mm/numa.c18
-rw-r--r--arch/ia64/sn/kernel/sn2/sn_hwperf.c2
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_ate.c2
-rw-r--r--arch/ia64/sn/pci/pcibr/pcibr_dma.c2
13 files changed, 97 insertions, 63 deletions
diff --git a/arch/ia64/Kconfig b/arch/ia64/Kconfig
index 0b7f701d5cf7..70f7eb9fed35 100644
--- a/arch/ia64/Kconfig
+++ b/arch/ia64/Kconfig
@@ -516,7 +516,7 @@ source "arch/ia64/oprofile/Kconfig"
516 516
517config KPROBES 517config KPROBES
518 bool "Kprobes (EXPERIMENTAL)" 518 bool "Kprobes (EXPERIMENTAL)"
519 depends on EXPERIMENTAL && MODULES 519 depends on KALLSYMS && EXPERIMENTAL && MODULES
520 help 520 help
521 Kprobes allows you to trap at almost any kernel address and 521 Kprobes allows you to trap at almost any kernel address and
522 execute a callback function. register_kprobe() establishes 522 execute a callback function. register_kprobe() establishes
diff --git a/arch/ia64/hp/sim/simserial.c b/arch/ia64/hp/sim/simserial.c
index 0daacc20ed36..246eb3d3757a 100644
--- a/arch/ia64/hp/sim/simserial.c
+++ b/arch/ia64/hp/sim/simserial.c
@@ -940,7 +940,7 @@ static inline void show_serial_version(void)
940 printk(KERN_INFO " no serial options enabled\n"); 940 printk(KERN_INFO " no serial options enabled\n");
941} 941}
942 942
943static struct tty_operations hp_ops = { 943static const struct tty_operations hp_ops = {
944 .open = rs_open, 944 .open = rs_open,
945 .close = rs_close, 945 .close = rs_close,
946 .write = rs_write, 946 .write = rs_write,
diff --git a/arch/ia64/ia32/sys_ia32.c b/arch/ia64/ia32/sys_ia32.c
index bddbd22706ed..9d6a3f210148 100644
--- a/arch/ia64/ia32/sys_ia32.c
+++ b/arch/ia64/ia32/sys_ia32.c
@@ -125,6 +125,7 @@ sys32_execve (char __user *name, compat_uptr_t __user *argv, compat_uptr_t __use
125 125
126int cp_compat_stat(struct kstat *stat, struct compat_stat __user *ubuf) 126int cp_compat_stat(struct kstat *stat, struct compat_stat __user *ubuf)
127{ 127{
128 compat_ino_t ino;
128 int err; 129 int err;
129 130
130 if ((u64) stat->size > MAX_NON_LFS || 131 if ((u64) stat->size > MAX_NON_LFS ||
@@ -132,11 +133,15 @@ int cp_compat_stat(struct kstat *stat, struct compat_stat __user *ubuf)
132 !old_valid_dev(stat->rdev)) 133 !old_valid_dev(stat->rdev))
133 return -EOVERFLOW; 134 return -EOVERFLOW;
134 135
136 ino = stat->ino;
137 if (sizeof(ino) < sizeof(stat->ino) && ino != stat->ino)
138 return -EOVERFLOW;
139
135 if (clear_user(ubuf, sizeof(*ubuf))) 140 if (clear_user(ubuf, sizeof(*ubuf)))
136 return -EFAULT; 141 return -EFAULT;
137 142
138 err = __put_user(old_encode_dev(stat->dev), &ubuf->st_dev); 143 err = __put_user(old_encode_dev(stat->dev), &ubuf->st_dev);
139 err |= __put_user(stat->ino, &ubuf->st_ino); 144 err |= __put_user(ino, &ubuf->st_ino);
140 err |= __put_user(stat->mode, &ubuf->st_mode); 145 err |= __put_user(stat->mode, &ubuf->st_mode);
141 err |= __put_user(stat->nlink, &ubuf->st_nlink); 146 err |= __put_user(stat->nlink, &ubuf->st_nlink);
142 err |= __put_user(high2lowuid(stat->uid), &ubuf->st_uid); 147 err |= __put_user(high2lowuid(stat->uid), &ubuf->st_uid);
@@ -1222,16 +1227,20 @@ struct readdir32_callback {
1222}; 1227};
1223 1228
1224static int 1229static int
1225filldir32 (void *__buf, const char *name, int namlen, loff_t offset, ino_t ino, 1230filldir32 (void *__buf, const char *name, int namlen, loff_t offset, u64 ino,
1226 unsigned int d_type) 1231 unsigned int d_type)
1227{ 1232{
1228 struct compat_dirent __user * dirent; 1233 struct compat_dirent __user * dirent;
1229 struct getdents32_callback * buf = (struct getdents32_callback *) __buf; 1234 struct getdents32_callback * buf = (struct getdents32_callback *) __buf;
1230 int reclen = ROUND_UP(offsetof(struct compat_dirent, d_name) + namlen + 1, 4); 1235 int reclen = ROUND_UP(offsetof(struct compat_dirent, d_name) + namlen + 1, 4);
1236 u32 d_ino;
1231 1237
1232 buf->error = -EINVAL; /* only used if we fail.. */ 1238 buf->error = -EINVAL; /* only used if we fail.. */
1233 if (reclen > buf->count) 1239 if (reclen > buf->count)
1234 return -EINVAL; 1240 return -EINVAL;
1241 d_ino = ino;
1242 if (sizeof(d_ino) < sizeof(ino) && d_ino != ino)
1243 return -EOVERFLOW;
1235 buf->error = -EFAULT; /* only used if we fail.. */ 1244 buf->error = -EFAULT; /* only used if we fail.. */
1236 dirent = buf->previous; 1245 dirent = buf->previous;
1237 if (dirent) 1246 if (dirent)
@@ -1239,7 +1248,7 @@ filldir32 (void *__buf, const char *name, int namlen, loff_t offset, ino_t ino,
1239 return -EFAULT; 1248 return -EFAULT;
1240 dirent = buf->current_dir; 1249 dirent = buf->current_dir;
1241 buf->previous = dirent; 1250 buf->previous = dirent;
1242 if (put_user(ino, &dirent->d_ino) 1251 if (put_user(d_ino, &dirent->d_ino)
1243 || put_user(reclen, &dirent->d_reclen) 1252 || put_user(reclen, &dirent->d_reclen)
1244 || copy_to_user(dirent->d_name, name, namlen) 1253 || copy_to_user(dirent->d_name, name, namlen)
1245 || put_user(0, dirent->d_name + namlen)) 1254 || put_user(0, dirent->d_name + namlen))
@@ -1287,17 +1296,21 @@ out:
1287} 1296}
1288 1297
1289static int 1298static int
1290fillonedir32 (void * __buf, const char * name, int namlen, loff_t offset, ino_t ino, 1299fillonedir32 (void * __buf, const char * name, int namlen, loff_t offset, u64 ino,
1291 unsigned int d_type) 1300 unsigned int d_type)
1292{ 1301{
1293 struct readdir32_callback * buf = (struct readdir32_callback *) __buf; 1302 struct readdir32_callback * buf = (struct readdir32_callback *) __buf;
1294 struct old_linux32_dirent __user * dirent; 1303 struct old_linux32_dirent __user * dirent;
1304 u32 d_ino;
1295 1305
1296 if (buf->count) 1306 if (buf->count)
1297 return -EINVAL; 1307 return -EINVAL;
1308 d_ino = ino;
1309 if (sizeof(d_ino) < sizeof(ino) && d_ino != ino)
1310 return -EOVERFLOW;
1298 buf->count++; 1311 buf->count++;
1299 dirent = buf->dirent; 1312 dirent = buf->dirent;
1300 if (put_user(ino, &dirent->d_ino) 1313 if (put_user(d_ino, &dirent->d_ino)
1301 || put_user(offset, &dirent->d_offset) 1314 || put_user(offset, &dirent->d_offset)
1302 || put_user(namlen, &dirent->d_namlen) 1315 || put_user(namlen, &dirent->d_namlen)
1303 || copy_to_user(dirent->d_name, name, namlen) 1316 || copy_to_user(dirent->d_name, name, namlen)
diff --git a/arch/ia64/kernel/entry.S b/arch/ia64/kernel/entry.S
index 12701cf32d99..e5b1be51b197 100644
--- a/arch/ia64/kernel/entry.S
+++ b/arch/ia64/kernel/entry.S
@@ -492,11 +492,11 @@ GLOBAL_ENTRY(prefetch_stack)
492 br.ret.sptk.many rp 492 br.ret.sptk.many rp
493END(prefetch_stack) 493END(prefetch_stack)
494 494
495GLOBAL_ENTRY(execve) 495GLOBAL_ENTRY(kernel_execve)
496 mov r15=__NR_execve // put syscall number in place 496 mov r15=__NR_execve // put syscall number in place
497 break __BREAK_SYSCALL 497 break __BREAK_SYSCALL
498 br.ret.sptk.many rp 498 br.ret.sptk.many rp
499END(execve) 499END(kernel_execve)
500 500
501GLOBAL_ENTRY(clone) 501GLOBAL_ENTRY(clone)
502 mov r15=__NR_clone // put syscall number in place 502 mov r15=__NR_clone // put syscall number in place
diff --git a/arch/ia64/kernel/kprobes.c b/arch/ia64/kernel/kprobes.c
index 169ec3a7156c..51217d63285e 100644
--- a/arch/ia64/kernel/kprobes.c
+++ b/arch/ia64/kernel/kprobes.c
@@ -90,7 +90,7 @@ static void __kprobes update_kprobe_inst_flag(uint template, uint slot,
90 p->ainsn.target_br_reg = 0; 90 p->ainsn.target_br_reg = 0;
91 91
92 /* Check for Break instruction 92 /* Check for Break instruction
93 * Bits 37:40 Major opcode to be zero 93 * Bits 37:40 Major opcode to be zero
94 * Bits 27:32 X6 to be zero 94 * Bits 27:32 X6 to be zero
95 * Bits 32:35 X3 to be zero 95 * Bits 32:35 X3 to be zero
96 */ 96 */
@@ -104,19 +104,19 @@ static void __kprobes update_kprobe_inst_flag(uint template, uint slot,
104 switch (major_opcode) { 104 switch (major_opcode) {
105 case INDIRECT_CALL_OPCODE: 105 case INDIRECT_CALL_OPCODE:
106 p->ainsn.inst_flag |= INST_FLAG_FIX_BRANCH_REG; 106 p->ainsn.inst_flag |= INST_FLAG_FIX_BRANCH_REG;
107 p->ainsn.target_br_reg = ((kprobe_inst >> 6) & 0x7); 107 p->ainsn.target_br_reg = ((kprobe_inst >> 6) & 0x7);
108 break; 108 break;
109 case IP_RELATIVE_PREDICT_OPCODE: 109 case IP_RELATIVE_PREDICT_OPCODE:
110 case IP_RELATIVE_BRANCH_OPCODE: 110 case IP_RELATIVE_BRANCH_OPCODE:
111 p->ainsn.inst_flag |= INST_FLAG_FIX_RELATIVE_IP_ADDR; 111 p->ainsn.inst_flag |= INST_FLAG_FIX_RELATIVE_IP_ADDR;
112 break; 112 break;
113 case IP_RELATIVE_CALL_OPCODE: 113 case IP_RELATIVE_CALL_OPCODE:
114 p->ainsn.inst_flag |= INST_FLAG_FIX_RELATIVE_IP_ADDR; 114 p->ainsn.inst_flag |= INST_FLAG_FIX_RELATIVE_IP_ADDR;
115 p->ainsn.inst_flag |= INST_FLAG_FIX_BRANCH_REG; 115 p->ainsn.inst_flag |= INST_FLAG_FIX_BRANCH_REG;
116 p->ainsn.target_br_reg = ((kprobe_inst >> 6) & 0x7); 116 p->ainsn.target_br_reg = ((kprobe_inst >> 6) & 0x7);
117 break; 117 break;
118 } 118 }
119 } else if (bundle_encoding[template][slot] == X) { 119 } else if (bundle_encoding[template][slot] == X) {
120 switch (major_opcode) { 120 switch (major_opcode) {
121 case LONG_CALL_OPCODE: 121 case LONG_CALL_OPCODE:
122 p->ainsn.inst_flag |= INST_FLAG_FIX_BRANCH_REG; 122 p->ainsn.inst_flag |= INST_FLAG_FIX_BRANCH_REG;
@@ -258,18 +258,18 @@ static void __kprobes get_kprobe_inst(bundle_t *bundle, uint slot,
258 258
259 switch (slot) { 259 switch (slot) {
260 case 0: 260 case 0:
261 *major_opcode = (bundle->quad0.slot0 >> SLOT0_OPCODE_SHIFT); 261 *major_opcode = (bundle->quad0.slot0 >> SLOT0_OPCODE_SHIFT);
262 *kprobe_inst = bundle->quad0.slot0; 262 *kprobe_inst = bundle->quad0.slot0;
263 break; 263 break;
264 case 1: 264 case 1:
265 *major_opcode = (bundle->quad1.slot1_p1 >> SLOT1_p1_OPCODE_SHIFT); 265 *major_opcode = (bundle->quad1.slot1_p1 >> SLOT1_p1_OPCODE_SHIFT);
266 kprobe_inst_p0 = bundle->quad0.slot1_p0; 266 kprobe_inst_p0 = bundle->quad0.slot1_p0;
267 kprobe_inst_p1 = bundle->quad1.slot1_p1; 267 kprobe_inst_p1 = bundle->quad1.slot1_p1;
268 *kprobe_inst = kprobe_inst_p0 | (kprobe_inst_p1 << (64-46)); 268 *kprobe_inst = kprobe_inst_p0 | (kprobe_inst_p1 << (64-46));
269 break; 269 break;
270 case 2: 270 case 2:
271 *major_opcode = (bundle->quad1.slot2 >> SLOT2_OPCODE_SHIFT); 271 *major_opcode = (bundle->quad1.slot2 >> SLOT2_OPCODE_SHIFT);
272 *kprobe_inst = bundle->quad1.slot2; 272 *kprobe_inst = bundle->quad1.slot2;
273 break; 273 break;
274 } 274 }
275} 275}
@@ -290,11 +290,11 @@ static int __kprobes valid_kprobe_addr(int template, int slot,
290 return -EINVAL; 290 return -EINVAL;
291 } 291 }
292 292
293 if (in_ivt_functions(addr)) { 293 if (in_ivt_functions(addr)) {
294 printk(KERN_WARNING "Kprobes can't be inserted inside " 294 printk(KERN_WARNING "Kprobes can't be inserted inside "
295 "IVT functions at 0x%lx\n", addr); 295 "IVT functions at 0x%lx\n", addr);
296 return -EINVAL; 296 return -EINVAL;
297 } 297 }
298 298
299 if (slot == 1 && bundle_encoding[template][1] != L) { 299 if (slot == 1 && bundle_encoding[template][1] != L) {
300 printk(KERN_WARNING "Inserting kprobes on slot #1 " 300 printk(KERN_WARNING "Inserting kprobes on slot #1 "
@@ -338,12 +338,13 @@ static void kretprobe_trampoline(void)
338int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs) 338int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
339{ 339{
340 struct kretprobe_instance *ri = NULL; 340 struct kretprobe_instance *ri = NULL;
341 struct hlist_head *head; 341 struct hlist_head *head, empty_rp;
342 struct hlist_node *node, *tmp; 342 struct hlist_node *node, *tmp;
343 unsigned long flags, orig_ret_address = 0; 343 unsigned long flags, orig_ret_address = 0;
344 unsigned long trampoline_address = 344 unsigned long trampoline_address =
345 ((struct fnptr *)kretprobe_trampoline)->ip; 345 ((struct fnptr *)kretprobe_trampoline)->ip;
346 346
347 INIT_HLIST_HEAD(&empty_rp);
347 spin_lock_irqsave(&kretprobe_lock, flags); 348 spin_lock_irqsave(&kretprobe_lock, flags);
348 head = kretprobe_inst_table_head(current); 349 head = kretprobe_inst_table_head(current);
349 350
@@ -369,7 +370,7 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
369 ri->rp->handler(ri, regs); 370 ri->rp->handler(ri, regs);
370 371
371 orig_ret_address = (unsigned long)ri->ret_addr; 372 orig_ret_address = (unsigned long)ri->ret_addr;
372 recycle_rp_inst(ri); 373 recycle_rp_inst(ri, &empty_rp);
373 374
374 if (orig_ret_address != trampoline_address) 375 if (orig_ret_address != trampoline_address)
375 /* 376 /*
@@ -387,6 +388,10 @@ int __kprobes trampoline_probe_handler(struct kprobe *p, struct pt_regs *regs)
387 spin_unlock_irqrestore(&kretprobe_lock, flags); 388 spin_unlock_irqrestore(&kretprobe_lock, flags);
388 preempt_enable_no_resched(); 389 preempt_enable_no_resched();
389 390
391 hlist_for_each_entry_safe(ri, node, tmp, &empty_rp, hlist) {
392 hlist_del(&ri->hlist);
393 kfree(ri);
394 }
390 /* 395 /*
391 * By returning a non-zero value, we are telling 396 * By returning a non-zero value, we are telling
392 * kprobe_handler() that we don't want the post_handler 397 * kprobe_handler() that we don't want the post_handler
@@ -424,14 +429,14 @@ int __kprobes arch_prepare_kprobe(struct kprobe *p)
424 bundle_t *bundle; 429 bundle_t *bundle;
425 430
426 bundle = &((kprobe_opcode_t *)kprobe_addr)->bundle; 431 bundle = &((kprobe_opcode_t *)kprobe_addr)->bundle;
427 template = bundle->quad0.template; 432 template = bundle->quad0.template;
428 433
429 if(valid_kprobe_addr(template, slot, addr)) 434 if(valid_kprobe_addr(template, slot, addr))
430 return -EINVAL; 435 return -EINVAL;
431 436
432 /* Move to slot 2, if bundle is MLX type and kprobe slot is 1 */ 437 /* Move to slot 2, if bundle is MLX type and kprobe slot is 1 */
433 if (slot == 1 && bundle_encoding[template][1] == L) 438 if (slot == 1 && bundle_encoding[template][1] == L)
434 slot++; 439 slot++;
435 440
436 /* Get kprobe_inst and major_opcode from the bundle */ 441 /* Get kprobe_inst and major_opcode from the bundle */
437 get_kprobe_inst(bundle, slot, &kprobe_inst, &major_opcode); 442 get_kprobe_inst(bundle, slot, &kprobe_inst, &major_opcode);
@@ -489,21 +494,22 @@ void __kprobes arch_remove_kprobe(struct kprobe *p)
489 */ 494 */
490static void __kprobes resume_execution(struct kprobe *p, struct pt_regs *regs) 495static void __kprobes resume_execution(struct kprobe *p, struct pt_regs *regs)
491{ 496{
492 unsigned long bundle_addr = (unsigned long) (&p->ainsn.insn->bundle); 497 unsigned long bundle_addr = (unsigned long) (&p->ainsn.insn->bundle);
493 unsigned long resume_addr = (unsigned long)p->addr & ~0xFULL; 498 unsigned long resume_addr = (unsigned long)p->addr & ~0xFULL;
494 unsigned long template; 499 unsigned long template;
495 int slot = ((unsigned long)p->addr & 0xf); 500 int slot = ((unsigned long)p->addr & 0xf);
496 501
497 template = p->ainsn.insn->bundle.quad0.template; 502 template = p->ainsn.insn->bundle.quad0.template;
498 503
499 if (slot == 1 && bundle_encoding[template][1] == L) 504 if (slot == 1 && bundle_encoding[template][1] == L)
500 slot = 2; 505 slot = 2;
501 506
502 if (p->ainsn.inst_flag) { 507 if (p->ainsn.inst_flag) {
503 508
504 if (p->ainsn.inst_flag & INST_FLAG_FIX_RELATIVE_IP_ADDR) { 509 if (p->ainsn.inst_flag & INST_FLAG_FIX_RELATIVE_IP_ADDR) {
505 /* Fix relative IP address */ 510 /* Fix relative IP address */
506 regs->cr_iip = (regs->cr_iip - bundle_addr) + resume_addr; 511 regs->cr_iip = (regs->cr_iip - bundle_addr) +
512 resume_addr;
507 } 513 }
508 514
509 if (p->ainsn.inst_flag & INST_FLAG_FIX_BRANCH_REG) { 515 if (p->ainsn.inst_flag & INST_FLAG_FIX_BRANCH_REG) {
@@ -540,18 +546,18 @@ static void __kprobes resume_execution(struct kprobe *p, struct pt_regs *regs)
540 } 546 }
541 547
542 if (slot == 2) { 548 if (slot == 2) {
543 if (regs->cr_iip == bundle_addr + 0x10) { 549 if (regs->cr_iip == bundle_addr + 0x10) {
544 regs->cr_iip = resume_addr + 0x10; 550 regs->cr_iip = resume_addr + 0x10;
545 } 551 }
546 } else { 552 } else {
547 if (regs->cr_iip == bundle_addr) { 553 if (regs->cr_iip == bundle_addr) {
548 regs->cr_iip = resume_addr; 554 regs->cr_iip = resume_addr;
549 } 555 }
550 } 556 }
551 557
552turn_ss_off: 558turn_ss_off:
553 /* Turn off Single Step bit */ 559 /* Turn off Single Step bit */
554 ia64_psr(regs)->ss = 0; 560 ia64_psr(regs)->ss = 0;
555} 561}
556 562
557static void __kprobes prepare_ss(struct kprobe *p, struct pt_regs *regs) 563static void __kprobes prepare_ss(struct kprobe *p, struct pt_regs *regs)
@@ -587,7 +593,7 @@ static int __kprobes is_ia64_break_inst(struct pt_regs *regs)
587 593
588 /* Move to slot 2, if bundle is MLX type and kprobe slot is 1 */ 594 /* Move to slot 2, if bundle is MLX type and kprobe slot is 1 */
589 if (slot == 1 && bundle_encoding[template][1] == L) 595 if (slot == 1 && bundle_encoding[template][1] == L)
590 slot++; 596 slot++;
591 597
592 /* Get Kprobe probe instruction at given slot*/ 598 /* Get Kprobe probe instruction at given slot*/
593 get_kprobe_inst(&bundle, slot, &kprobe_inst, &major_opcode); 599 get_kprobe_inst(&bundle, slot, &kprobe_inst, &major_opcode);
@@ -627,7 +633,7 @@ static int __kprobes pre_kprobes_handler(struct die_args *args)
627 if (p) { 633 if (p) {
628 if ((kcb->kprobe_status == KPROBE_HIT_SS) && 634 if ((kcb->kprobe_status == KPROBE_HIT_SS) &&
629 (p->ainsn.inst_flag == INST_FLAG_BREAK_INST)) { 635 (p->ainsn.inst_flag == INST_FLAG_BREAK_INST)) {
630 ia64_psr(regs)->ss = 0; 636 ia64_psr(regs)->ss = 0;
631 goto no_kprobe; 637 goto no_kprobe;
632 } 638 }
633 /* We have reentered the pre_kprobe_handler(), since 639 /* We have reentered the pre_kprobe_handler(), since
@@ -887,7 +893,7 @@ int __kprobes setjmp_pre_handler(struct kprobe *p, struct pt_regs *regs)
887 * fix the return address to our jprobe_inst_return() function 893 * fix the return address to our jprobe_inst_return() function
888 * in the jprobes.S file 894 * in the jprobes.S file
889 */ 895 */
890 regs->b0 = ((struct fnptr *)(jprobe_inst_return))->ip; 896 regs->b0 = ((struct fnptr *)(jprobe_inst_return))->ip;
891 897
892 return 1; 898 return 1;
893} 899}
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c
index bfbd8986153b..663230183254 100644
--- a/arch/ia64/kernel/mca.c
+++ b/arch/ia64/kernel/mca.c
@@ -388,7 +388,7 @@ ia64_log_get(int sal_info_type, u8 **buffer, int irq_safe)
388{ 388{
389 sal_log_record_header_t *log_buffer; 389 sal_log_record_header_t *log_buffer;
390 u64 total_len = 0; 390 u64 total_len = 0;
391 int s; 391 unsigned long s;
392 392
393 IA64_LOG_LOCK(sal_info_type); 393 IA64_LOG_LOCK(sal_info_type);
394 394
diff --git a/arch/ia64/kernel/numa.c b/arch/ia64/kernel/numa.c
index 20340631179f..a78b45f5fe2f 100644
--- a/arch/ia64/kernel/numa.c
+++ b/arch/ia64/kernel/numa.c
@@ -28,6 +28,7 @@ u16 cpu_to_node_map[NR_CPUS] __cacheline_aligned;
28EXPORT_SYMBOL(cpu_to_node_map); 28EXPORT_SYMBOL(cpu_to_node_map);
29 29
30cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned; 30cpumask_t node_to_cpu_mask[MAX_NUMNODES] __cacheline_aligned;
31EXPORT_SYMBOL(node_to_cpu_mask);
31 32
32void __cpuinit map_cpu_to_node(int cpu, int nid) 33void __cpuinit map_cpu_to_node(int cpu, int nid)
33{ 34{
diff --git a/arch/ia64/kernel/process.c b/arch/ia64/kernel/process.c
index ea914cc6812a..51922b98086a 100644
--- a/arch/ia64/kernel/process.c
+++ b/arch/ia64/kernel/process.c
@@ -8,8 +8,6 @@
8 * 2005-10-07 Keith Owens <kaos@sgi.com> 8 * 2005-10-07 Keith Owens <kaos@sgi.com>
9 * Add notify_die() hooks. 9 * Add notify_die() hooks.
10 */ 10 */
11#define __KERNEL_SYSCALLS__ /* see <asm/unistd.h> */
12
13#include <linux/cpu.h> 11#include <linux/cpu.h>
14#include <linux/pm.h> 12#include <linux/pm.h>
15#include <linux/elf.h> 13#include <linux/elf.h>
diff --git a/arch/ia64/kernel/time.c b/arch/ia64/kernel/time.c
index 16262687a103..62e07f906e05 100644
--- a/arch/ia64/kernel/time.c
+++ b/arch/ia64/kernel/time.c
@@ -29,8 +29,6 @@
29#include <asm/sections.h> 29#include <asm/sections.h>
30#include <asm/system.h> 30#include <asm/system.h>
31 31
32extern unsigned long wall_jiffies;
33
34volatile int time_keeper_id = 0; /* smp_processor_id() of time-keeper */ 32volatile int time_keeper_id = 0; /* smp_processor_id() of time-keeper */
35 33
36#ifdef CONFIG_IA64_DEBUG_IRQ 34#ifdef CONFIG_IA64_DEBUG_IRQ
diff --git a/arch/ia64/mm/numa.c b/arch/ia64/mm/numa.c
index 64e4c21f311c..7807fc5c0422 100644
--- a/arch/ia64/mm/numa.c
+++ b/arch/ia64/mm/numa.c
@@ -16,6 +16,7 @@
16#include <linux/node.h> 16#include <linux/node.h>
17#include <linux/init.h> 17#include <linux/init.h>
18#include <linux/bootmem.h> 18#include <linux/bootmem.h>
19#include <linux/module.h>
19#include <asm/mmzone.h> 20#include <asm/mmzone.h>
20#include <asm/numa.h> 21#include <asm/numa.h>
21 22
@@ -69,4 +70,21 @@ int early_pfn_to_nid(unsigned long pfn)
69 70
70 return 0; 71 return 0;
71} 72}
73
74#ifdef CONFIG_MEMORY_HOTPLUG
75/*
76 * SRAT information is stored in node_memblk[], then we can use SRAT
77 * information at memory-hot-add if necessary.
78 */
79
80int memory_add_physaddr_to_nid(u64 addr)
81{
82 int nid = paddr_to_nid(addr);
83 if (nid < 0)
84 return 0;
85 return nid;
86}
87
88EXPORT_SYMBOL_GPL(memory_add_physaddr_to_nid);
89#endif
72#endif 90#endif
diff --git a/arch/ia64/sn/kernel/sn2/sn_hwperf.c b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
index b632b9c1e3b3..462ea178f49a 100644
--- a/arch/ia64/sn/kernel/sn2/sn_hwperf.c
+++ b/arch/ia64/sn/kernel/sn2/sn_hwperf.c
@@ -423,7 +423,7 @@ static int sn_topology_show(struct seq_file *s, void *d)
423 "coherency_domain %d, " 423 "coherency_domain %d, "
424 "region_size %d\n", 424 "region_size %d\n",
425 425
426 partid, system_utsname.nodename, 426 partid, utsname()->nodename,
427 shubtype ? "shub2" : "shub1", 427 shubtype ? "shub2" : "shub1",
428 (u64)nasid_mask << nasid_shift, nasid_msb, nasid_shift, 428 (u64)nasid_mask << nasid_shift, nasid_msb, nasid_shift,
429 system_size, sharing_size, coher, region_size); 429 system_size, sharing_size, coher, region_size);
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_ate.c b/arch/ia64/sn/pci/pcibr/pcibr_ate.c
index 1f0253bfe0a0..5eb1e1e078b4 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_ate.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_ate.c
@@ -160,7 +160,7 @@ void pcibr_ate_free(struct pcibus_info *pcibus_info, int index)
160 160
161 volatile u64 ate; 161 volatile u64 ate;
162 int count; 162 int count;
163 u64 flags; 163 unsigned long flags;
164 164
165 if (pcibr_invalidate_ate) { 165 if (pcibr_invalidate_ate) {
166 /* For debugging purposes, clear the valid bit in the ATE */ 166 /* For debugging purposes, clear the valid bit in the ATE */
diff --git a/arch/ia64/sn/pci/pcibr/pcibr_dma.c b/arch/ia64/sn/pci/pcibr/pcibr_dma.c
index a86c7b945962..1ee977fb6ebb 100644
--- a/arch/ia64/sn/pci/pcibr/pcibr_dma.c
+++ b/arch/ia64/sn/pci/pcibr/pcibr_dma.c
@@ -237,7 +237,7 @@ void sn_dma_flush(u64 addr)
237 int is_tio; 237 int is_tio;
238 int wid_num; 238 int wid_num;
239 int i, j; 239 int i, j;
240 u64 flags; 240 unsigned long flags;
241 u64 itte; 241 u64 itte;
242 struct hubdev_info *hubinfo; 242 struct hubdev_info *hubinfo;
243 struct sn_flush_device_kernel *p; 243 struct sn_flush_device_kernel *p;