diff options
| -rw-r--r-- | arch/ia64/include/asm/ftrace.h | 1 | ||||
| -rw-r--r-- | arch/ia64/include/asm/kprobes.h | 5 | ||||
| -rw-r--r-- | arch/ia64/include/asm/tlb.h | 2 | ||||
| -rw-r--r-- | arch/ia64/include/asm/topology.h | 4 | ||||
| -rw-r--r-- | arch/ia64/include/asm/types.h | 5 | ||||
| -rw-r--r-- | arch/ia64/kernel/mca.c | 5 | ||||
| -rw-r--r-- | arch/ia64/kernel/perfmon.c | 2 | ||||
| -rw-r--r-- | arch/ia64/mm/init.c | 2 | ||||
| -rw-r--r-- | arch/ia64/mm/tlb.c | 32 |
9 files changed, 34 insertions, 24 deletions
diff --git a/arch/ia64/include/asm/ftrace.h b/arch/ia64/include/asm/ftrace.h index d20db3c2a656..fbd1a2470cae 100644 --- a/arch/ia64/include/asm/ftrace.h +++ b/arch/ia64/include/asm/ftrace.h | |||
| @@ -8,7 +8,6 @@ | |||
| 8 | extern void _mcount(unsigned long pfs, unsigned long r1, unsigned long b0, unsigned long r0); | 8 | extern void _mcount(unsigned long pfs, unsigned long r1, unsigned long b0, unsigned long r0); |
| 9 | #define mcount _mcount | 9 | #define mcount _mcount |
| 10 | 10 | ||
| 11 | #include <asm/kprobes.h> | ||
| 12 | /* In IA64, MCOUNT_ADDR is set in link time, so it's not a constant at compile time */ | 11 | /* In IA64, MCOUNT_ADDR is set in link time, so it's not a constant at compile time */ |
| 13 | #define MCOUNT_ADDR (((struct fnptr *)mcount)->ip) | 12 | #define MCOUNT_ADDR (((struct fnptr *)mcount)->ip) |
| 14 | #define FTRACE_ADDR (((struct fnptr *)ftrace_caller)->ip) | 13 | #define FTRACE_ADDR (((struct fnptr *)ftrace_caller)->ip) |
diff --git a/arch/ia64/include/asm/kprobes.h b/arch/ia64/include/asm/kprobes.h index dbf83fb28db3..d5505d6f2382 100644 --- a/arch/ia64/include/asm/kprobes.h +++ b/arch/ia64/include/asm/kprobes.h | |||
| @@ -103,11 +103,6 @@ typedef struct kprobe_opcode { | |||
| 103 | bundle_t bundle; | 103 | bundle_t bundle; |
| 104 | } kprobe_opcode_t; | 104 | } kprobe_opcode_t; |
| 105 | 105 | ||
| 106 | struct fnptr { | ||
| 107 | unsigned long ip; | ||
| 108 | unsigned long gp; | ||
| 109 | }; | ||
| 110 | |||
| 111 | /* Architecture specific copy of original instruction*/ | 106 | /* Architecture specific copy of original instruction*/ |
| 112 | struct arch_specific_insn { | 107 | struct arch_specific_insn { |
| 113 | /* copy of the instruction to be emulated */ | 108 | /* copy of the instruction to be emulated */ |
diff --git a/arch/ia64/include/asm/tlb.h b/arch/ia64/include/asm/tlb.h index 85d965cb19a0..23cce999eb1c 100644 --- a/arch/ia64/include/asm/tlb.h +++ b/arch/ia64/include/asm/tlb.h | |||
| @@ -74,7 +74,7 @@ struct ia64_tr_entry { | |||
| 74 | extern int ia64_itr_entry(u64 target_mask, u64 va, u64 pte, u64 log_size); | 74 | extern int ia64_itr_entry(u64 target_mask, u64 va, u64 pte, u64 log_size); |
| 75 | extern void ia64_ptr_entry(u64 target_mask, int slot); | 75 | extern void ia64_ptr_entry(u64 target_mask, int slot); |
| 76 | 76 | ||
| 77 | extern struct ia64_tr_entry __per_cpu_idtrs[NR_CPUS][2][IA64_TR_ALLOC_MAX]; | 77 | extern struct ia64_tr_entry *ia64_idtrs[NR_CPUS]; |
| 78 | 78 | ||
| 79 | /* | 79 | /* |
| 80 | region register macros | 80 | region register macros |
diff --git a/arch/ia64/include/asm/topology.h b/arch/ia64/include/asm/topology.h index 3ddb4e709dba..d323071d0f91 100644 --- a/arch/ia64/include/asm/topology.h +++ b/arch/ia64/include/asm/topology.h | |||
| @@ -33,7 +33,9 @@ | |||
| 33 | /* | 33 | /* |
| 34 | * Returns a bitmask of CPUs on Node 'node'. | 34 | * Returns a bitmask of CPUs on Node 'node'. |
| 35 | */ | 35 | */ |
| 36 | #define cpumask_of_node(node) (&node_to_cpu_mask[node]) | 36 | #define cpumask_of_node(node) ((node) == -1 ? \ |
| 37 | cpu_all_mask : \ | ||
| 38 | &node_to_cpu_mask[node]) | ||
| 37 | 39 | ||
| 38 | /* | 40 | /* |
| 39 | * Returns the number of the node containing Node 'nid'. | 41 | * Returns the number of the node containing Node 'nid'. |
diff --git a/arch/ia64/include/asm/types.h b/arch/ia64/include/asm/types.h index bcd260e597de..b8e5d97be158 100644 --- a/arch/ia64/include/asm/types.h +++ b/arch/ia64/include/asm/types.h | |||
| @@ -30,6 +30,11 @@ | |||
| 30 | 30 | ||
| 31 | typedef unsigned int umode_t; | 31 | typedef unsigned int umode_t; |
| 32 | 32 | ||
| 33 | struct fnptr { | ||
| 34 | unsigned long ip; | ||
| 35 | unsigned long gp; | ||
| 36 | }; | ||
| 37 | |||
| 33 | /* | 38 | /* |
| 34 | * These aren't exported outside the kernel to avoid name space clashes | 39 | * These aren't exported outside the kernel to avoid name space clashes |
| 35 | */ | 40 | */ |
diff --git a/arch/ia64/kernel/mca.c b/arch/ia64/kernel/mca.c index 32f2639e9b0a..378b4833024f 100644 --- a/arch/ia64/kernel/mca.c +++ b/arch/ia64/kernel/mca.c | |||
| @@ -1225,9 +1225,12 @@ static void mca_insert_tr(u64 iord) | |||
| 1225 | unsigned long psr; | 1225 | unsigned long psr; |
| 1226 | int cpu = smp_processor_id(); | 1226 | int cpu = smp_processor_id(); |
| 1227 | 1227 | ||
| 1228 | if (!ia64_idtrs[cpu]) | ||
| 1229 | return; | ||
| 1230 | |||
| 1228 | psr = ia64_clear_ic(); | 1231 | psr = ia64_clear_ic(); |
| 1229 | for (i = IA64_TR_ALLOC_BASE; i < IA64_TR_ALLOC_MAX; i++) { | 1232 | for (i = IA64_TR_ALLOC_BASE; i < IA64_TR_ALLOC_MAX; i++) { |
| 1230 | p = &__per_cpu_idtrs[cpu][iord-1][i]; | 1233 | p = ia64_idtrs[cpu] + (iord - 1) * IA64_TR_ALLOC_MAX; |
| 1231 | if (p->pte & 0x1) { | 1234 | if (p->pte & 0x1) { |
| 1232 | old_rr = ia64_get_rr(p->ifa); | 1235 | old_rr = ia64_get_rr(p->ifa); |
| 1233 | if (old_rr != p->rr) { | 1236 | if (old_rr != p->rr) { |
diff --git a/arch/ia64/kernel/perfmon.c b/arch/ia64/kernel/perfmon.c index 5246285a95fb..6bcbe215b9a4 100644 --- a/arch/ia64/kernel/perfmon.c +++ b/arch/ia64/kernel/perfmon.c | |||
| @@ -2293,7 +2293,7 @@ pfm_smpl_buffer_alloc(struct task_struct *task, struct file *filp, pfm_context_t | |||
| 2293 | * if ((mm->total_vm << PAGE_SHIFT) + len> task->rlim[RLIMIT_AS].rlim_cur) | 2293 | * if ((mm->total_vm << PAGE_SHIFT) + len> task->rlim[RLIMIT_AS].rlim_cur) |
| 2294 | * return -ENOMEM; | 2294 | * return -ENOMEM; |
| 2295 | */ | 2295 | */ |
| 2296 | if (size > task->signal->rlim[RLIMIT_MEMLOCK].rlim_cur) | 2296 | if (size > task_rlimit(task, RLIMIT_MEMLOCK)) |
| 2297 | return -ENOMEM; | 2297 | return -ENOMEM; |
| 2298 | 2298 | ||
| 2299 | /* | 2299 | /* |
diff --git a/arch/ia64/mm/init.c b/arch/ia64/mm/init.c index b9609c69343a..7c0d4814a68d 100644 --- a/arch/ia64/mm/init.c +++ b/arch/ia64/mm/init.c | |||
| @@ -91,7 +91,7 @@ dma_mark_clean(void *addr, size_t size) | |||
| 91 | inline void | 91 | inline void |
| 92 | ia64_set_rbs_bot (void) | 92 | ia64_set_rbs_bot (void) |
| 93 | { | 93 | { |
| 94 | unsigned long stack_size = current->signal->rlim[RLIMIT_STACK].rlim_max & -16; | 94 | unsigned long stack_size = rlimit_max(RLIMIT_STACK) & -16; |
| 95 | 95 | ||
| 96 | if (stack_size > MAX_USER_STACK_SIZE) | 96 | if (stack_size > MAX_USER_STACK_SIZE) |
| 97 | stack_size = MAX_USER_STACK_SIZE; | 97 | stack_size = MAX_USER_STACK_SIZE; |
diff --git a/arch/ia64/mm/tlb.c b/arch/ia64/mm/tlb.c index ee09d261f2e6..f3de9d7a98b4 100644 --- a/arch/ia64/mm/tlb.c +++ b/arch/ia64/mm/tlb.c | |||
| @@ -48,7 +48,7 @@ DEFINE_PER_CPU(u8, ia64_need_tlb_flush); | |||
| 48 | DEFINE_PER_CPU(u8, ia64_tr_num); /*Number of TR slots in current processor*/ | 48 | DEFINE_PER_CPU(u8, ia64_tr_num); /*Number of TR slots in current processor*/ |
| 49 | DEFINE_PER_CPU(u8, ia64_tr_used); /*Max Slot number used by kernel*/ | 49 | DEFINE_PER_CPU(u8, ia64_tr_used); /*Max Slot number used by kernel*/ |
| 50 | 50 | ||
| 51 | struct ia64_tr_entry __per_cpu_idtrs[NR_CPUS][2][IA64_TR_ALLOC_MAX]; | 51 | struct ia64_tr_entry *ia64_idtrs[NR_CPUS]; |
| 52 | 52 | ||
| 53 | /* | 53 | /* |
| 54 | * Initializes the ia64_ctx.bitmap array based on max_ctx+1. | 54 | * Initializes the ia64_ctx.bitmap array based on max_ctx+1. |
| @@ -429,10 +429,16 @@ int ia64_itr_entry(u64 target_mask, u64 va, u64 pte, u64 log_size) | |||
| 429 | struct ia64_tr_entry *p; | 429 | struct ia64_tr_entry *p; |
| 430 | int cpu = smp_processor_id(); | 430 | int cpu = smp_processor_id(); |
| 431 | 431 | ||
| 432 | if (!ia64_idtrs[cpu]) { | ||
| 433 | ia64_idtrs[cpu] = kmalloc(2 * IA64_TR_ALLOC_MAX * | ||
| 434 | sizeof (struct ia64_tr_entry), GFP_KERNEL); | ||
| 435 | if (!ia64_idtrs[cpu]) | ||
| 436 | return -ENOMEM; | ||
| 437 | } | ||
| 432 | r = -EINVAL; | 438 | r = -EINVAL; |
| 433 | /*Check overlap with existing TR entries*/ | 439 | /*Check overlap with existing TR entries*/ |
| 434 | if (target_mask & 0x1) { | 440 | if (target_mask & 0x1) { |
| 435 | p = &__per_cpu_idtrs[cpu][0][0]; | 441 | p = ia64_idtrs[cpu]; |
| 436 | for (i = IA64_TR_ALLOC_BASE; i <= per_cpu(ia64_tr_used, cpu); | 442 | for (i = IA64_TR_ALLOC_BASE; i <= per_cpu(ia64_tr_used, cpu); |
| 437 | i++, p++) { | 443 | i++, p++) { |
| 438 | if (p->pte & 0x1) | 444 | if (p->pte & 0x1) |
| @@ -444,7 +450,7 @@ int ia64_itr_entry(u64 target_mask, u64 va, u64 pte, u64 log_size) | |||
| 444 | } | 450 | } |
| 445 | } | 451 | } |
| 446 | if (target_mask & 0x2) { | 452 | if (target_mask & 0x2) { |
| 447 | p = &__per_cpu_idtrs[cpu][1][0]; | 453 | p = ia64_idtrs[cpu] + IA64_TR_ALLOC_MAX; |
| 448 | for (i = IA64_TR_ALLOC_BASE; i <= per_cpu(ia64_tr_used, cpu); | 454 | for (i = IA64_TR_ALLOC_BASE; i <= per_cpu(ia64_tr_used, cpu); |
| 449 | i++, p++) { | 455 | i++, p++) { |
| 450 | if (p->pte & 0x1) | 456 | if (p->pte & 0x1) |
| @@ -459,16 +465,16 @@ int ia64_itr_entry(u64 target_mask, u64 va, u64 pte, u64 log_size) | |||
| 459 | for (i = IA64_TR_ALLOC_BASE; i < per_cpu(ia64_tr_num, cpu); i++) { | 465 | for (i = IA64_TR_ALLOC_BASE; i < per_cpu(ia64_tr_num, cpu); i++) { |
| 460 | switch (target_mask & 0x3) { | 466 | switch (target_mask & 0x3) { |
| 461 | case 1: | 467 | case 1: |
| 462 | if (!(__per_cpu_idtrs[cpu][0][i].pte & 0x1)) | 468 | if (!((ia64_idtrs[cpu] + i)->pte & 0x1)) |
| 463 | goto found; | 469 | goto found; |
| 464 | continue; | 470 | continue; |
| 465 | case 2: | 471 | case 2: |
| 466 | if (!(__per_cpu_idtrs[cpu][1][i].pte & 0x1)) | 472 | if (!((ia64_idtrs[cpu] + IA64_TR_ALLOC_MAX + i)->pte & 0x1)) |
| 467 | goto found; | 473 | goto found; |
| 468 | continue; | 474 | continue; |
| 469 | case 3: | 475 | case 3: |
| 470 | if (!(__per_cpu_idtrs[cpu][0][i].pte & 0x1) && | 476 | if (!((ia64_idtrs[cpu] + i)->pte & 0x1) && |
| 471 | !(__per_cpu_idtrs[cpu][1][i].pte & 0x1)) | 477 | !((ia64_idtrs[cpu] + IA64_TR_ALLOC_MAX + i)->pte & 0x1)) |
| 472 | goto found; | 478 | goto found; |
| 473 | continue; | 479 | continue; |
| 474 | default: | 480 | default: |
| @@ -488,7 +494,7 @@ found: | |||
| 488 | if (target_mask & 0x1) { | 494 | if (target_mask & 0x1) { |
| 489 | ia64_itr(0x1, i, va, pte, log_size); | 495 | ia64_itr(0x1, i, va, pte, log_size); |
| 490 | ia64_srlz_i(); | 496 | ia64_srlz_i(); |
| 491 | p = &__per_cpu_idtrs[cpu][0][i]; | 497 | p = ia64_idtrs[cpu] + i; |
| 492 | p->ifa = va; | 498 | p->ifa = va; |
| 493 | p->pte = pte; | 499 | p->pte = pte; |
| 494 | p->itir = log_size << 2; | 500 | p->itir = log_size << 2; |
| @@ -497,7 +503,7 @@ found: | |||
| 497 | if (target_mask & 0x2) { | 503 | if (target_mask & 0x2) { |
| 498 | ia64_itr(0x2, i, va, pte, log_size); | 504 | ia64_itr(0x2, i, va, pte, log_size); |
| 499 | ia64_srlz_i(); | 505 | ia64_srlz_i(); |
| 500 | p = &__per_cpu_idtrs[cpu][1][i]; | 506 | p = ia64_idtrs[cpu] + IA64_TR_ALLOC_MAX + i; |
| 501 | p->ifa = va; | 507 | p->ifa = va; |
| 502 | p->pte = pte; | 508 | p->pte = pte; |
| 503 | p->itir = log_size << 2; | 509 | p->itir = log_size << 2; |
| @@ -528,7 +534,7 @@ void ia64_ptr_entry(u64 target_mask, int slot) | |||
| 528 | return; | 534 | return; |
| 529 | 535 | ||
| 530 | if (target_mask & 0x1) { | 536 | if (target_mask & 0x1) { |
| 531 | p = &__per_cpu_idtrs[cpu][0][slot]; | 537 | p = ia64_idtrs[cpu] + slot; |
| 532 | if ((p->pte&0x1) && is_tr_overlap(p, p->ifa, p->itir>>2)) { | 538 | if ((p->pte&0x1) && is_tr_overlap(p, p->ifa, p->itir>>2)) { |
| 533 | p->pte = 0; | 539 | p->pte = 0; |
| 534 | ia64_ptr(0x1, p->ifa, p->itir>>2); | 540 | ia64_ptr(0x1, p->ifa, p->itir>>2); |
| @@ -537,7 +543,7 @@ void ia64_ptr_entry(u64 target_mask, int slot) | |||
| 537 | } | 543 | } |
| 538 | 544 | ||
| 539 | if (target_mask & 0x2) { | 545 | if (target_mask & 0x2) { |
| 540 | p = &__per_cpu_idtrs[cpu][1][slot]; | 546 | p = ia64_idtrs[cpu] + IA64_TR_ALLOC_MAX + slot; |
| 541 | if ((p->pte & 0x1) && is_tr_overlap(p, p->ifa, p->itir>>2)) { | 547 | if ((p->pte & 0x1) && is_tr_overlap(p, p->ifa, p->itir>>2)) { |
| 542 | p->pte = 0; | 548 | p->pte = 0; |
| 543 | ia64_ptr(0x2, p->ifa, p->itir>>2); | 549 | ia64_ptr(0x2, p->ifa, p->itir>>2); |
| @@ -546,8 +552,8 @@ void ia64_ptr_entry(u64 target_mask, int slot) | |||
| 546 | } | 552 | } |
| 547 | 553 | ||
| 548 | for (i = per_cpu(ia64_tr_used, cpu); i >= IA64_TR_ALLOC_BASE; i--) { | 554 | for (i = per_cpu(ia64_tr_used, cpu); i >= IA64_TR_ALLOC_BASE; i--) { |
| 549 | if ((__per_cpu_idtrs[cpu][0][i].pte & 0x1) || | 555 | if (((ia64_idtrs[cpu] + i)->pte & 0x1) || |
| 550 | (__per_cpu_idtrs[cpu][1][i].pte & 0x1)) | 556 | ((ia64_idtrs[cpu] + IA64_TR_ALLOC_MAX + i)->pte & 0x1)) |
| 551 | break; | 557 | break; |
| 552 | } | 558 | } |
| 553 | per_cpu(ia64_tr_used, cpu) = i; | 559 | per_cpu(ia64_tr_used, cpu) = i; |
