diff options
Diffstat (limited to 'arch/ia64/kernel')
-rw-r--r-- | arch/ia64/kernel/cyclone.c | 2 | ||||
-rw-r--r-- | arch/ia64/kernel/fsys.S | 7 | ||||
-rw-r--r-- | arch/ia64/kernel/ivt.S | 16 | ||||
-rw-r--r-- | arch/ia64/kernel/mca_drv.c | 16 | ||||
-rw-r--r-- | arch/ia64/kernel/unaligned.c | 33 |
5 files changed, 53 insertions, 21 deletions
diff --git a/arch/ia64/kernel/cyclone.c b/arch/ia64/kernel/cyclone.c index 6ade3790ce07..e00b21514f7c 100644 --- a/arch/ia64/kernel/cyclone.c +++ b/arch/ia64/kernel/cyclone.c | |||
@@ -36,7 +36,7 @@ int __init init_cyclone_clock(void) | |||
36 | u32* volatile cyclone_timer; /* Cyclone MPMC0 register */ | 36 | u32* volatile cyclone_timer; /* Cyclone MPMC0 register */ |
37 | 37 | ||
38 | if (!use_cyclone) | 38 | if (!use_cyclone) |
39 | return -ENODEV; | 39 | return 0; |
40 | 40 | ||
41 | printk(KERN_INFO "Summit chipset: Starting Cyclone Counter.\n"); | 41 | printk(KERN_INFO "Summit chipset: Starting Cyclone Counter.\n"); |
42 | 42 | ||
diff --git a/arch/ia64/kernel/fsys.S b/arch/ia64/kernel/fsys.S index ac6055c83115..7a05b1cb2ad5 100644 --- a/arch/ia64/kernel/fsys.S +++ b/arch/ia64/kernel/fsys.S | |||
@@ -878,8 +878,7 @@ fsyscall_table: | |||
878 | data8 0 // timer_delete | 878 | data8 0 // timer_delete |
879 | data8 0 // clock_settime | 879 | data8 0 // clock_settime |
880 | data8 fsys_clock_gettime // clock_gettime | 880 | data8 fsys_clock_gettime // clock_gettime |
881 | #define __NR_syscall_last 1255 | ||
882 | 881 | ||
883 | .space 8*(NR_syscalls + 1024 - __NR_syscall_last), 0 | 882 | // fill in zeros for the remaining entries |
884 | 883 | .zero: | |
885 | .org fsyscall_table + 8*NR_syscalls // guard against failures to increase NR_syscalls | 884 | .space fsyscall_table + 8*NR_syscalls - .zero, 0 |
diff --git a/arch/ia64/kernel/ivt.S b/arch/ia64/kernel/ivt.S index 301f2e9d262e..dcd906fe5749 100644 --- a/arch/ia64/kernel/ivt.S +++ b/arch/ia64/kernel/ivt.S | |||
@@ -561,11 +561,12 @@ ENTRY(dirty_bit) | |||
561 | ;; // avoid RAW on r18 | 561 | ;; // avoid RAW on r18 |
562 | mov ar.ccv=r18 // set compare value for cmpxchg | 562 | mov ar.ccv=r18 // set compare value for cmpxchg |
563 | or r25=_PAGE_D|_PAGE_A,r18 // set the dirty and accessed bits | 563 | or r25=_PAGE_D|_PAGE_A,r18 // set the dirty and accessed bits |
564 | tbit.z p7,p6 = r18,_PAGE_P_BIT // Check present bit | ||
564 | ;; | 565 | ;; |
565 | cmpxchg8.acq r26=[r17],r25,ar.ccv | 566 | (p6) cmpxchg8.acq r26=[r17],r25,ar.ccv // Only update if page is present |
566 | mov r24=PAGE_SHIFT<<2 | 567 | mov r24=PAGE_SHIFT<<2 |
567 | ;; | 568 | ;; |
568 | cmp.eq p6,p7=r26,r18 | 569 | (p6) cmp.eq p6,p7=r26,r18 // Only compare if page is present |
569 | ;; | 570 | ;; |
570 | (p6) itc.d r25 // install updated PTE | 571 | (p6) itc.d r25 // install updated PTE |
571 | ;; | 572 | ;; |
@@ -626,11 +627,12 @@ ENTRY(iaccess_bit) | |||
626 | ;; | 627 | ;; |
627 | mov ar.ccv=r18 // set compare value for cmpxchg | 628 | mov ar.ccv=r18 // set compare value for cmpxchg |
628 | or r25=_PAGE_A,r18 // set the accessed bit | 629 | or r25=_PAGE_A,r18 // set the accessed bit |
630 | tbit.z p7,p6 = r18,_PAGE_P_BIT // Check present bit | ||
629 | ;; | 631 | ;; |
630 | cmpxchg8.acq r26=[r17],r25,ar.ccv | 632 | (p6) cmpxchg8.acq r26=[r17],r25,ar.ccv // Only if page present |
631 | mov r24=PAGE_SHIFT<<2 | 633 | mov r24=PAGE_SHIFT<<2 |
632 | ;; | 634 | ;; |
633 | cmp.eq p6,p7=r26,r18 | 635 | (p6) cmp.eq p6,p7=r26,r18 // Only if page present |
634 | ;; | 636 | ;; |
635 | (p6) itc.i r25 // install updated PTE | 637 | (p6) itc.i r25 // install updated PTE |
636 | ;; | 638 | ;; |
@@ -680,11 +682,12 @@ ENTRY(daccess_bit) | |||
680 | ;; // avoid RAW on r18 | 682 | ;; // avoid RAW on r18 |
681 | mov ar.ccv=r18 // set compare value for cmpxchg | 683 | mov ar.ccv=r18 // set compare value for cmpxchg |
682 | or r25=_PAGE_A,r18 // set the dirty bit | 684 | or r25=_PAGE_A,r18 // set the dirty bit |
685 | tbit.z p7,p6 = r18,_PAGE_P_BIT // Check present bit | ||
683 | ;; | 686 | ;; |
684 | cmpxchg8.acq r26=[r17],r25,ar.ccv | 687 | (p6) cmpxchg8.acq r26=[r17],r25,ar.ccv // Only if page is present |
685 | mov r24=PAGE_SHIFT<<2 | 688 | mov r24=PAGE_SHIFT<<2 |
686 | ;; | 689 | ;; |
687 | cmp.eq p6,p7=r26,r18 | 690 | (p6) cmp.eq p6,p7=r26,r18 // Only if page is present |
688 | ;; | 691 | ;; |
689 | (p6) itc.d r25 // install updated PTE | 692 | (p6) itc.d r25 // install updated PTE |
690 | /* | 693 | /* |
@@ -1362,7 +1365,6 @@ END(debug_vector) | |||
1362 | // 0x5a00 Entry 30 (size 16 bundles) Unaligned Reference (57) | 1365 | // 0x5a00 Entry 30 (size 16 bundles) Unaligned Reference (57) |
1363 | ENTRY(unaligned_access) | 1366 | ENTRY(unaligned_access) |
1364 | DBG_FAULT(30) | 1367 | DBG_FAULT(30) |
1365 | mov r16=cr.ipsr | ||
1366 | mov r31=pr // prepare to save predicates | 1368 | mov r31=pr // prepare to save predicates |
1367 | ;; | 1369 | ;; |
1368 | br.sptk.many dispatch_unaligned_handler | 1370 | br.sptk.many dispatch_unaligned_handler |
diff --git a/arch/ia64/kernel/mca_drv.c b/arch/ia64/kernel/mca_drv.c index 8fd93afa75a7..e883d85906db 100644 --- a/arch/ia64/kernel/mca_drv.c +++ b/arch/ia64/kernel/mca_drv.c | |||
@@ -123,8 +123,9 @@ mca_page_isolate(unsigned long paddr) | |||
123 | void | 123 | void |
124 | mca_handler_bh(unsigned long paddr) | 124 | mca_handler_bh(unsigned long paddr) |
125 | { | 125 | { |
126 | printk(KERN_DEBUG "OS_MCA: process [pid: %d](%s) encounters MCA.\n", | 126 | printk(KERN_ERR |
127 | current->pid, current->comm); | 127 | "OS_MCA: process [pid: %d](%s) encounters MCA (paddr=%lx)\n", |
128 | current->pid, current->comm, paddr); | ||
128 | 129 | ||
129 | spin_lock(&mca_bh_lock); | 130 | spin_lock(&mca_bh_lock); |
130 | switch (mca_page_isolate(paddr)) { | 131 | switch (mca_page_isolate(paddr)) { |
@@ -132,7 +133,7 @@ mca_handler_bh(unsigned long paddr) | |||
132 | printk(KERN_DEBUG "Page isolation: ( %lx ) success.\n", paddr); | 133 | printk(KERN_DEBUG "Page isolation: ( %lx ) success.\n", paddr); |
133 | break; | 134 | break; |
134 | case ISOLATE_NG: | 135 | case ISOLATE_NG: |
135 | printk(KERN_DEBUG "Page isolation: ( %lx ) failure.\n", paddr); | 136 | printk(KERN_CRIT "Page isolation: ( %lx ) failure.\n", paddr); |
136 | break; | 137 | break; |
137 | default: | 138 | default: |
138 | break; | 139 | break; |
@@ -567,10 +568,15 @@ recover_from_processor_error(int platform, slidx_table_t *slidx, | |||
567 | return 0; | 568 | return 0; |
568 | 569 | ||
569 | /* | 570 | /* |
570 | * If there is no bus error, record is weird but we need not to recover. | 571 | * The cache check and bus check bits have four possible states |
572 | * cc bc | ||
573 | * 0 0 Weird record, not recovered | ||
574 | * 1 0 Cache error, not recovered | ||
575 | * 0 1 I/O error, attempt recovery | ||
576 | * 1 1 Memory error, attempt recovery | ||
571 | */ | 577 | */ |
572 | if (psp->bc == 0 || pbci == NULL) | 578 | if (psp->bc == 0 || pbci == NULL) |
573 | return 1; | 579 | return 0; |
574 | 580 | ||
575 | /* | 581 | /* |
576 | * Sorry, we cannot handle so many. | 582 | * Sorry, we cannot handle so many. |
diff --git a/arch/ia64/kernel/unaligned.c b/arch/ia64/kernel/unaligned.c index f9e0ae936d1a..1e357550c776 100644 --- a/arch/ia64/kernel/unaligned.c +++ b/arch/ia64/kernel/unaligned.c | |||
@@ -24,7 +24,7 @@ | |||
24 | #include <asm/uaccess.h> | 24 | #include <asm/uaccess.h> |
25 | #include <asm/unaligned.h> | 25 | #include <asm/unaligned.h> |
26 | 26 | ||
27 | extern void die_if_kernel(char *str, struct pt_regs *regs, long err) __attribute__ ((noreturn)); | 27 | extern void die_if_kernel(char *str, struct pt_regs *regs, long err); |
28 | 28 | ||
29 | #undef DEBUG_UNALIGNED_TRAP | 29 | #undef DEBUG_UNALIGNED_TRAP |
30 | 30 | ||
@@ -53,6 +53,15 @@ dump (const char *str, void *vp, size_t len) | |||
53 | #define SIGN_EXT9 0xffffffffffffff00ul | 53 | #define SIGN_EXT9 0xffffffffffffff00ul |
54 | 54 | ||
55 | /* | 55 | /* |
56 | * sysctl settable hook which tells the kernel whether to honor the | ||
57 | * IA64_THREAD_UAC_NOPRINT prctl. Because this is user settable, we want | ||
58 | * to allow the super user to enable/disable this for security reasons | ||
59 | * (i.e. don't allow attacker to fill up logs with unaligned accesses). | ||
60 | */ | ||
61 | int no_unaligned_warning; | ||
62 | static int noprint_warning; | ||
63 | |||
64 | /* | ||
56 | * For M-unit: | 65 | * For M-unit: |
57 | * | 66 | * |
58 | * opcode | m | x6 | | 67 | * opcode | m | x6 | |
@@ -1324,8 +1333,9 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs) | |||
1324 | if ((current->thread.flags & IA64_THREAD_UAC_SIGBUS) != 0) | 1333 | if ((current->thread.flags & IA64_THREAD_UAC_SIGBUS) != 0) |
1325 | goto force_sigbus; | 1334 | goto force_sigbus; |
1326 | 1335 | ||
1327 | if (!(current->thread.flags & IA64_THREAD_UAC_NOPRINT) | 1336 | if (!no_unaligned_warning && |
1328 | && within_logging_rate_limit()) | 1337 | !(current->thread.flags & IA64_THREAD_UAC_NOPRINT) && |
1338 | within_logging_rate_limit()) | ||
1329 | { | 1339 | { |
1330 | char buf[200]; /* comm[] is at most 16 bytes... */ | 1340 | char buf[200]; /* comm[] is at most 16 bytes... */ |
1331 | size_t len; | 1341 | size_t len; |
@@ -1340,7 +1350,22 @@ ia64_handle_unaligned (unsigned long ifa, struct pt_regs *regs) | |||
1340 | if (user_mode(regs)) | 1350 | if (user_mode(regs)) |
1341 | tty_write_message(current->signal->tty, buf); | 1351 | tty_write_message(current->signal->tty, buf); |
1342 | buf[len-1] = '\0'; /* drop '\r' */ | 1352 | buf[len-1] = '\0'; /* drop '\r' */ |
1343 | printk(KERN_WARNING "%s", buf); /* watch for command names containing %s */ | 1353 | /* watch for command names containing %s */ |
1354 | printk(KERN_WARNING "%s", buf); | ||
1355 | } else { | ||
1356 | if (no_unaligned_warning && !noprint_warning) { | ||
1357 | noprint_warning = 1; | ||
1358 | printk(KERN_WARNING "%s(%d) encountered an " | ||
1359 | "unaligned exception which required\n" | ||
1360 | "kernel assistance, which degrades " | ||
1361 | "the performance of the application.\n" | ||
1362 | "Unaligned exception warnings have " | ||
1363 | "been disabled by the system " | ||
1364 | "administrator\n" | ||
1365 | "echo 0 > /proc/sys/kernel/ignore-" | ||
1366 | "unaligned-usertrap to re-enable\n", | ||
1367 | current->comm, current->pid); | ||
1368 | } | ||
1344 | } | 1369 | } |
1345 | } else { | 1370 | } else { |
1346 | if (within_logging_rate_limit()) | 1371 | if (within_logging_rate_limit()) |