diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2015-07-26 14:14:04 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2015-07-26 14:14:04 -0400 |
| commit | 2800348613953b5892c196e4bfab2ae5783a519e (patch) | |
| tree | 228813308b3f34ee67e5fe84a7e0e7675ea14f34 | |
| parent | 26ae19a3883c9d595e9100fd10b856a7cf1a949a (diff) | |
| parent | 1a4e8795711f474b31ff6eac37f3efd304ed8a93 (diff) | |
Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip
Pull x86 fixes from Thomas Gleixner:
"This update contains:
- the manual revert of the SYSCALL32 changes which caused a
regression
- a fix for the MPX vma handling
- three fixes for the ioremap 'is ram' checks.
- PAT warning fixes
- a trivial fix for the size calculation of TLB tracepoints
- handle old EFI structures gracefully
This also contains a PAT fix from Jan plus a revert thereof. Toshi
explained why the code is correct"
* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/mm/pat: Revert 'Adjust default caching mode translation tables'
x86/asm/entry/32: Revert 'Do not use R9 in SYSCALL32' commit
x86/mm: Fix newly introduced printk format warnings
mm: Fix bugs in region_is_ram()
x86/mm: Remove region_is_ram() call from ioremap
x86/mm: Move warning from __ioremap_check_ram() to the call site
x86/mm/pat, drivers/media/ivtv: Move the PAT warning and replace WARN() with pr_warn()
x86/mm/pat, drivers/infiniband/ipath: Replace WARN() with pr_warn()
x86/mm/pat: Adjust default caching mode translation tables
x86/fpu: Disable dependent CPU features on "noxsave"
x86/mpx: Do not set ->vm_ops on MPX VMAs
x86/mm: Add parenthesis for TLB tracepoint size calculation
efi: Handle memory error structures produced based on old versions of standard
| -rw-r--r-- | arch/x86/entry/entry_64_compat.S | 14 | ||||
| -rw-r--r-- | arch/x86/kernel/fpu/init.c | 6 | ||||
| -rw-r--r-- | arch/x86/mm/ioremap.c | 23 | ||||
| -rw-r--r-- | arch/x86/mm/mmap.c | 7 | ||||
| -rw-r--r-- | arch/x86/mm/mpx.c | 24 | ||||
| -rw-r--r-- | arch/x86/mm/tlb.c | 2 | ||||
| -rw-r--r-- | drivers/firmware/efi/cper.c | 15 | ||||
| -rw-r--r-- | drivers/infiniband/hw/ipath/ipath_driver.c | 6 | ||||
| -rw-r--r-- | drivers/media/pci/ivtv/ivtvfb.c | 15 | ||||
| -rw-r--r-- | include/linux/cper.h | 22 | ||||
| -rw-r--r-- | kernel/resource.c | 6 |
11 files changed, 81 insertions, 59 deletions
diff --git a/arch/x86/entry/entry_64_compat.S b/arch/x86/entry/entry_64_compat.S index bb187a6a877c..5a1844765a7a 100644 --- a/arch/x86/entry/entry_64_compat.S +++ b/arch/x86/entry/entry_64_compat.S | |||
| @@ -205,7 +205,6 @@ sysexit_from_sys_call: | |||
| 205 | movl RDX(%rsp), %edx /* arg3 */ | 205 | movl RDX(%rsp), %edx /* arg3 */ |
| 206 | movl RSI(%rsp), %ecx /* arg4 */ | 206 | movl RSI(%rsp), %ecx /* arg4 */ |
| 207 | movl RDI(%rsp), %r8d /* arg5 */ | 207 | movl RDI(%rsp), %r8d /* arg5 */ |
| 208 | movl %ebp, %r9d /* arg6 */ | ||
| 209 | .endm | 208 | .endm |
| 210 | 209 | ||
| 211 | .macro auditsys_exit exit | 210 | .macro auditsys_exit exit |
| @@ -236,6 +235,7 @@ sysexit_from_sys_call: | |||
| 236 | 235 | ||
| 237 | sysenter_auditsys: | 236 | sysenter_auditsys: |
| 238 | auditsys_entry_common | 237 | auditsys_entry_common |
| 238 | movl %ebp, %r9d /* reload 6th syscall arg */ | ||
| 239 | jmp sysenter_dispatch | 239 | jmp sysenter_dispatch |
| 240 | 240 | ||
| 241 | sysexit_audit: | 241 | sysexit_audit: |
| @@ -336,7 +336,7 @@ ENTRY(entry_SYSCALL_compat) | |||
| 336 | * 32-bit zero extended: | 336 | * 32-bit zero extended: |
| 337 | */ | 337 | */ |
| 338 | ASM_STAC | 338 | ASM_STAC |
| 339 | 1: movl (%r8), %ebp | 339 | 1: movl (%r8), %r9d |
| 340 | _ASM_EXTABLE(1b, ia32_badarg) | 340 | _ASM_EXTABLE(1b, ia32_badarg) |
| 341 | ASM_CLAC | 341 | ASM_CLAC |
| 342 | orl $TS_COMPAT, ASM_THREAD_INFO(TI_status, %rsp, SIZEOF_PTREGS) | 342 | orl $TS_COMPAT, ASM_THREAD_INFO(TI_status, %rsp, SIZEOF_PTREGS) |
| @@ -346,7 +346,7 @@ ENTRY(entry_SYSCALL_compat) | |||
| 346 | cstar_do_call: | 346 | cstar_do_call: |
| 347 | /* 32-bit syscall -> 64-bit C ABI argument conversion */ | 347 | /* 32-bit syscall -> 64-bit C ABI argument conversion */ |
| 348 | movl %edi, %r8d /* arg5 */ | 348 | movl %edi, %r8d /* arg5 */ |
| 349 | movl %ebp, %r9d /* arg6 */ | 349 | /* r9 already loaded */ /* arg6 */ |
| 350 | xchg %ecx, %esi /* rsi:arg2, rcx:arg4 */ | 350 | xchg %ecx, %esi /* rsi:arg2, rcx:arg4 */ |
| 351 | movl %ebx, %edi /* arg1 */ | 351 | movl %ebx, %edi /* arg1 */ |
| 352 | movl %edx, %edx /* arg3 (zero extension) */ | 352 | movl %edx, %edx /* arg3 (zero extension) */ |
| @@ -358,7 +358,6 @@ cstar_dispatch: | |||
| 358 | call *ia32_sys_call_table(, %rax, 8) | 358 | call *ia32_sys_call_table(, %rax, 8) |
| 359 | movq %rax, RAX(%rsp) | 359 | movq %rax, RAX(%rsp) |
| 360 | 1: | 360 | 1: |
| 361 | movl RCX(%rsp), %ebp | ||
| 362 | DISABLE_INTERRUPTS(CLBR_NONE) | 361 | DISABLE_INTERRUPTS(CLBR_NONE) |
| 363 | TRACE_IRQS_OFF | 362 | TRACE_IRQS_OFF |
| 364 | testl $_TIF_ALLWORK_MASK, ASM_THREAD_INFO(TI_flags, %rsp, SIZEOF_PTREGS) | 363 | testl $_TIF_ALLWORK_MASK, ASM_THREAD_INFO(TI_flags, %rsp, SIZEOF_PTREGS) |
| @@ -392,7 +391,9 @@ sysretl_from_sys_call: | |||
| 392 | 391 | ||
| 393 | #ifdef CONFIG_AUDITSYSCALL | 392 | #ifdef CONFIG_AUDITSYSCALL |
| 394 | cstar_auditsys: | 393 | cstar_auditsys: |
| 394 | movl %r9d, R9(%rsp) /* register to be clobbered by call */ | ||
| 395 | auditsys_entry_common | 395 | auditsys_entry_common |
| 396 | movl R9(%rsp), %r9d /* reload 6th syscall arg */ | ||
| 396 | jmp cstar_dispatch | 397 | jmp cstar_dispatch |
| 397 | 398 | ||
| 398 | sysretl_audit: | 399 | sysretl_audit: |
| @@ -404,14 +405,16 @@ cstar_tracesys: | |||
| 404 | testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT), ASM_THREAD_INFO(TI_flags, %rsp, SIZEOF_PTREGS) | 405 | testl $(_TIF_WORK_SYSCALL_ENTRY & ~_TIF_SYSCALL_AUDIT), ASM_THREAD_INFO(TI_flags, %rsp, SIZEOF_PTREGS) |
| 405 | jz cstar_auditsys | 406 | jz cstar_auditsys |
| 406 | #endif | 407 | #endif |
| 408 | xchgl %r9d, %ebp | ||
| 407 | SAVE_EXTRA_REGS | 409 | SAVE_EXTRA_REGS |
| 408 | xorl %eax, %eax /* Do not leak kernel information */ | 410 | xorl %eax, %eax /* Do not leak kernel information */ |
| 409 | movq %rax, R11(%rsp) | 411 | movq %rax, R11(%rsp) |
| 410 | movq %rax, R10(%rsp) | 412 | movq %rax, R10(%rsp) |
| 411 | movq %rax, R9(%rsp) | 413 | movq %r9, R9(%rsp) |
| 412 | movq %rax, R8(%rsp) | 414 | movq %rax, R8(%rsp) |
| 413 | movq %rsp, %rdi /* &pt_regs -> arg1 */ | 415 | movq %rsp, %rdi /* &pt_regs -> arg1 */ |
| 414 | call syscall_trace_enter | 416 | call syscall_trace_enter |
| 417 | movl R9(%rsp), %r9d | ||
| 415 | 418 | ||
| 416 | /* Reload arg registers from stack. (see sysenter_tracesys) */ | 419 | /* Reload arg registers from stack. (see sysenter_tracesys) */ |
| 417 | movl RCX(%rsp), %ecx | 420 | movl RCX(%rsp), %ecx |
| @@ -421,6 +424,7 @@ cstar_tracesys: | |||
| 421 | movl %eax, %eax /* zero extension */ | 424 | movl %eax, %eax /* zero extension */ |
| 422 | 425 | ||
| 423 | RESTORE_EXTRA_REGS | 426 | RESTORE_EXTRA_REGS |
| 427 | xchgl %ebp, %r9d | ||
| 424 | jmp cstar_do_call | 428 | jmp cstar_do_call |
| 425 | END(entry_SYSCALL_compat) | 429 | END(entry_SYSCALL_compat) |
| 426 | 430 | ||
diff --git a/arch/x86/kernel/fpu/init.c b/arch/x86/kernel/fpu/init.c index 0b39173dd971..1e173f6285c7 100644 --- a/arch/x86/kernel/fpu/init.c +++ b/arch/x86/kernel/fpu/init.c | |||
| @@ -351,9 +351,15 @@ static int __init x86_noxsave_setup(char *s) | |||
| 351 | 351 | ||
| 352 | setup_clear_cpu_cap(X86_FEATURE_XSAVE); | 352 | setup_clear_cpu_cap(X86_FEATURE_XSAVE); |
| 353 | setup_clear_cpu_cap(X86_FEATURE_XSAVEOPT); | 353 | setup_clear_cpu_cap(X86_FEATURE_XSAVEOPT); |
| 354 | setup_clear_cpu_cap(X86_FEATURE_XSAVEC); | ||
| 354 | setup_clear_cpu_cap(X86_FEATURE_XSAVES); | 355 | setup_clear_cpu_cap(X86_FEATURE_XSAVES); |
| 355 | setup_clear_cpu_cap(X86_FEATURE_AVX); | 356 | setup_clear_cpu_cap(X86_FEATURE_AVX); |
| 356 | setup_clear_cpu_cap(X86_FEATURE_AVX2); | 357 | setup_clear_cpu_cap(X86_FEATURE_AVX2); |
| 358 | setup_clear_cpu_cap(X86_FEATURE_AVX512F); | ||
| 359 | setup_clear_cpu_cap(X86_FEATURE_AVX512PF); | ||
| 360 | setup_clear_cpu_cap(X86_FEATURE_AVX512ER); | ||
| 361 | setup_clear_cpu_cap(X86_FEATURE_AVX512CD); | ||
| 362 | setup_clear_cpu_cap(X86_FEATURE_MPX); | ||
| 357 | 363 | ||
| 358 | return 1; | 364 | return 1; |
| 359 | } | 365 | } |
diff --git a/arch/x86/mm/ioremap.c b/arch/x86/mm/ioremap.c index cc5ccc415cc0..b9c78f3bcd67 100644 --- a/arch/x86/mm/ioremap.c +++ b/arch/x86/mm/ioremap.c | |||
| @@ -63,8 +63,6 @@ static int __ioremap_check_ram(unsigned long start_pfn, unsigned long nr_pages, | |||
| 63 | !PageReserved(pfn_to_page(start_pfn + i))) | 63 | !PageReserved(pfn_to_page(start_pfn + i))) |
| 64 | return 1; | 64 | return 1; |
| 65 | 65 | ||
| 66 | WARN_ONCE(1, "ioremap on RAM pfn 0x%lx\n", start_pfn); | ||
| 67 | |||
| 68 | return 0; | 66 | return 0; |
| 69 | } | 67 | } |
| 70 | 68 | ||
| @@ -94,7 +92,6 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr, | |||
| 94 | pgprot_t prot; | 92 | pgprot_t prot; |
| 95 | int retval; | 93 | int retval; |
| 96 | void __iomem *ret_addr; | 94 | void __iomem *ret_addr; |
| 97 | int ram_region; | ||
| 98 | 95 | ||
| 99 | /* Don't allow wraparound or zero size */ | 96 | /* Don't allow wraparound or zero size */ |
| 100 | last_addr = phys_addr + size - 1; | 97 | last_addr = phys_addr + size - 1; |
| @@ -117,23 +114,15 @@ static void __iomem *__ioremap_caller(resource_size_t phys_addr, | |||
| 117 | /* | 114 | /* |
| 118 | * Don't allow anybody to remap normal RAM that we're using.. | 115 | * Don't allow anybody to remap normal RAM that we're using.. |
| 119 | */ | 116 | */ |
| 120 | /* First check if whole region can be identified as RAM or not */ | 117 | pfn = phys_addr >> PAGE_SHIFT; |
| 121 | ram_region = region_is_ram(phys_addr, size); | 118 | last_pfn = last_addr >> PAGE_SHIFT; |
| 122 | if (ram_region > 0) { | 119 | if (walk_system_ram_range(pfn, last_pfn - pfn + 1, NULL, |
| 123 | WARN_ONCE(1, "ioremap on RAM at 0x%lx - 0x%lx\n", | 120 | __ioremap_check_ram) == 1) { |
| 124 | (unsigned long int)phys_addr, | 121 | WARN_ONCE(1, "ioremap on RAM at %pa - %pa\n", |
| 125 | (unsigned long int)last_addr); | 122 | &phys_addr, &last_addr); |
| 126 | return NULL; | 123 | return NULL; |
| 127 | } | 124 | } |
| 128 | 125 | ||
| 129 | /* If could not be identified(-1), check page by page */ | ||
| 130 | if (ram_region < 0) { | ||
| 131 | pfn = phys_addr >> PAGE_SHIFT; | ||
| 132 | last_pfn = last_addr >> PAGE_SHIFT; | ||
| 133 | if (walk_system_ram_range(pfn, last_pfn - pfn + 1, NULL, | ||
| 134 | __ioremap_check_ram) == 1) | ||
| 135 | return NULL; | ||
| 136 | } | ||
| 137 | /* | 126 | /* |
| 138 | * Mappings have to be page-aligned | 127 | * Mappings have to be page-aligned |
| 139 | */ | 128 | */ |
diff --git a/arch/x86/mm/mmap.c b/arch/x86/mm/mmap.c index 9d518d693b4b..844b06d67df4 100644 --- a/arch/x86/mm/mmap.c +++ b/arch/x86/mm/mmap.c | |||
| @@ -126,3 +126,10 @@ void arch_pick_mmap_layout(struct mm_struct *mm) | |||
| 126 | mm->get_unmapped_area = arch_get_unmapped_area_topdown; | 126 | mm->get_unmapped_area = arch_get_unmapped_area_topdown; |
| 127 | } | 127 | } |
| 128 | } | 128 | } |
| 129 | |||
| 130 | const char *arch_vma_name(struct vm_area_struct *vma) | ||
| 131 | { | ||
| 132 | if (vma->vm_flags & VM_MPX) | ||
| 133 | return "[mpx]"; | ||
| 134 | return NULL; | ||
| 135 | } | ||
diff --git a/arch/x86/mm/mpx.c b/arch/x86/mm/mpx.c index 7a657f58bbea..db1b0bc5017c 100644 --- a/arch/x86/mm/mpx.c +++ b/arch/x86/mm/mpx.c | |||
| @@ -20,20 +20,6 @@ | |||
| 20 | #define CREATE_TRACE_POINTS | 20 | #define CREATE_TRACE_POINTS |
| 21 | #include <asm/trace/mpx.h> | 21 | #include <asm/trace/mpx.h> |
| 22 | 22 | ||
| 23 | static const char *mpx_mapping_name(struct vm_area_struct *vma) | ||
| 24 | { | ||
| 25 | return "[mpx]"; | ||
| 26 | } | ||
| 27 | |||
| 28 | static struct vm_operations_struct mpx_vma_ops = { | ||
| 29 | .name = mpx_mapping_name, | ||
| 30 | }; | ||
| 31 | |||
| 32 | static int is_mpx_vma(struct vm_area_struct *vma) | ||
| 33 | { | ||
| 34 | return (vma->vm_ops == &mpx_vma_ops); | ||
| 35 | } | ||
| 36 | |||
| 37 | static inline unsigned long mpx_bd_size_bytes(struct mm_struct *mm) | 23 | static inline unsigned long mpx_bd_size_bytes(struct mm_struct *mm) |
| 38 | { | 24 | { |
| 39 | if (is_64bit_mm(mm)) | 25 | if (is_64bit_mm(mm)) |
| @@ -53,9 +39,6 @@ static inline unsigned long mpx_bt_size_bytes(struct mm_struct *mm) | |||
| 53 | /* | 39 | /* |
| 54 | * This is really a simplified "vm_mmap". it only handles MPX | 40 | * This is really a simplified "vm_mmap". it only handles MPX |
| 55 | * bounds tables (the bounds directory is user-allocated). | 41 | * bounds tables (the bounds directory is user-allocated). |
| 56 | * | ||
| 57 | * Later on, we use the vma->vm_ops to uniquely identify these | ||
| 58 | * VMAs. | ||
| 59 | */ | 42 | */ |
| 60 | static unsigned long mpx_mmap(unsigned long len) | 43 | static unsigned long mpx_mmap(unsigned long len) |
| 61 | { | 44 | { |
| @@ -101,7 +84,6 @@ static unsigned long mpx_mmap(unsigned long len) | |||
| 101 | ret = -ENOMEM; | 84 | ret = -ENOMEM; |
| 102 | goto out; | 85 | goto out; |
| 103 | } | 86 | } |
| 104 | vma->vm_ops = &mpx_vma_ops; | ||
| 105 | 87 | ||
| 106 | if (vm_flags & VM_LOCKED) { | 88 | if (vm_flags & VM_LOCKED) { |
| 107 | up_write(&mm->mmap_sem); | 89 | up_write(&mm->mmap_sem); |
| @@ -812,7 +794,7 @@ static noinline int zap_bt_entries_mapping(struct mm_struct *mm, | |||
| 812 | * so stop immediately and return an error. This | 794 | * so stop immediately and return an error. This |
| 813 | * probably results in a SIGSEGV. | 795 | * probably results in a SIGSEGV. |
| 814 | */ | 796 | */ |
| 815 | if (!is_mpx_vma(vma)) | 797 | if (!(vma->vm_flags & VM_MPX)) |
| 816 | return -EINVAL; | 798 | return -EINVAL; |
| 817 | 799 | ||
| 818 | len = min(vma->vm_end, end) - addr; | 800 | len = min(vma->vm_end, end) - addr; |
| @@ -945,9 +927,9 @@ static int try_unmap_single_bt(struct mm_struct *mm, | |||
| 945 | * lots of tables even though we have no actual table | 927 | * lots of tables even though we have no actual table |
| 946 | * entries in use. | 928 | * entries in use. |
| 947 | */ | 929 | */ |
| 948 | while (next && is_mpx_vma(next)) | 930 | while (next && (next->vm_flags & VM_MPX)) |
| 949 | next = next->vm_next; | 931 | next = next->vm_next; |
| 950 | while (prev && is_mpx_vma(prev)) | 932 | while (prev && (prev->vm_flags & VM_MPX)) |
| 951 | prev = prev->vm_prev; | 933 | prev = prev->vm_prev; |
| 952 | /* | 934 | /* |
| 953 | * We know 'start' and 'end' lie within an area controlled | 935 | * We know 'start' and 'end' lie within an area controlled |
diff --git a/arch/x86/mm/tlb.c b/arch/x86/mm/tlb.c index 3250f2371aea..90b924acd982 100644 --- a/arch/x86/mm/tlb.c +++ b/arch/x86/mm/tlb.c | |||
| @@ -117,7 +117,7 @@ static void flush_tlb_func(void *info) | |||
| 117 | } else { | 117 | } else { |
| 118 | unsigned long addr; | 118 | unsigned long addr; |
| 119 | unsigned long nr_pages = | 119 | unsigned long nr_pages = |
| 120 | f->flush_end - f->flush_start / PAGE_SIZE; | 120 | (f->flush_end - f->flush_start) / PAGE_SIZE; |
| 121 | addr = f->flush_start; | 121 | addr = f->flush_start; |
| 122 | while (addr < f->flush_end) { | 122 | while (addr < f->flush_end) { |
| 123 | __flush_tlb_single(addr); | 123 | __flush_tlb_single(addr); |
diff --git a/drivers/firmware/efi/cper.c b/drivers/firmware/efi/cper.c index 4fd9961d552e..d42537425438 100644 --- a/drivers/firmware/efi/cper.c +++ b/drivers/firmware/efi/cper.c | |||
| @@ -305,10 +305,17 @@ const char *cper_mem_err_unpack(struct trace_seq *p, | |||
| 305 | return ret; | 305 | return ret; |
| 306 | } | 306 | } |
| 307 | 307 | ||
| 308 | static void cper_print_mem(const char *pfx, const struct cper_sec_mem_err *mem) | 308 | static void cper_print_mem(const char *pfx, const struct cper_sec_mem_err *mem, |
| 309 | int len) | ||
| 309 | { | 310 | { |
| 310 | struct cper_mem_err_compact cmem; | 311 | struct cper_mem_err_compact cmem; |
| 311 | 312 | ||
| 313 | /* Don't trust UEFI 2.1/2.2 structure with bad validation bits */ | ||
| 314 | if (len == sizeof(struct cper_sec_mem_err_old) && | ||
| 315 | (mem->validation_bits & ~(CPER_MEM_VALID_RANK_NUMBER - 1))) { | ||
| 316 | pr_err(FW_WARN "valid bits set for fields beyond structure\n"); | ||
| 317 | return; | ||
| 318 | } | ||
| 312 | if (mem->validation_bits & CPER_MEM_VALID_ERROR_STATUS) | 319 | if (mem->validation_bits & CPER_MEM_VALID_ERROR_STATUS) |
| 313 | printk("%s""error_status: 0x%016llx\n", pfx, mem->error_status); | 320 | printk("%s""error_status: 0x%016llx\n", pfx, mem->error_status); |
| 314 | if (mem->validation_bits & CPER_MEM_VALID_PA) | 321 | if (mem->validation_bits & CPER_MEM_VALID_PA) |
| @@ -405,8 +412,10 @@ static void cper_estatus_print_section( | |||
| 405 | } else if (!uuid_le_cmp(*sec_type, CPER_SEC_PLATFORM_MEM)) { | 412 | } else if (!uuid_le_cmp(*sec_type, CPER_SEC_PLATFORM_MEM)) { |
| 406 | struct cper_sec_mem_err *mem_err = (void *)(gdata + 1); | 413 | struct cper_sec_mem_err *mem_err = (void *)(gdata + 1); |
| 407 | printk("%s""section_type: memory error\n", newpfx); | 414 | printk("%s""section_type: memory error\n", newpfx); |
| 408 | if (gdata->error_data_length >= sizeof(*mem_err)) | 415 | if (gdata->error_data_length >= |
| 409 | cper_print_mem(newpfx, mem_err); | 416 | sizeof(struct cper_sec_mem_err_old)) |
| 417 | cper_print_mem(newpfx, mem_err, | ||
| 418 | gdata->error_data_length); | ||
| 410 | else | 419 | else |
| 411 | goto err_section_too_small; | 420 | goto err_section_too_small; |
| 412 | } else if (!uuid_le_cmp(*sec_type, CPER_SEC_PCIE)) { | 421 | } else if (!uuid_le_cmp(*sec_type, CPER_SEC_PCIE)) { |
diff --git a/drivers/infiniband/hw/ipath/ipath_driver.c b/drivers/infiniband/hw/ipath/ipath_driver.c index 2d7e503d13cb..871dbe56216a 100644 --- a/drivers/infiniband/hw/ipath/ipath_driver.c +++ b/drivers/infiniband/hw/ipath/ipath_driver.c | |||
| @@ -31,6 +31,8 @@ | |||
| 31 | * SOFTWARE. | 31 | * SOFTWARE. |
| 32 | */ | 32 | */ |
| 33 | 33 | ||
| 34 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
| 35 | |||
| 34 | #include <linux/sched.h> | 36 | #include <linux/sched.h> |
| 35 | #include <linux/spinlock.h> | 37 | #include <linux/spinlock.h> |
| 36 | #include <linux/idr.h> | 38 | #include <linux/idr.h> |
| @@ -399,8 +401,8 @@ static int ipath_init_one(struct pci_dev *pdev, const struct pci_device_id *ent) | |||
| 399 | u32 bar0 = 0, bar1 = 0; | 401 | u32 bar0 = 0, bar1 = 0; |
| 400 | 402 | ||
| 401 | #ifdef CONFIG_X86_64 | 403 | #ifdef CONFIG_X86_64 |
| 402 | if (WARN(pat_enabled(), | 404 | if (pat_enabled()) { |
| 403 | "ipath needs PAT disabled, boot with nopat kernel parameter\n")) { | 405 | pr_warn("ipath needs PAT disabled, boot with nopat kernel parameter\n"); |
| 404 | ret = -ENODEV; | 406 | ret = -ENODEV; |
| 405 | goto bail; | 407 | goto bail; |
| 406 | } | 408 | } |
diff --git a/drivers/media/pci/ivtv/ivtvfb.c b/drivers/media/pci/ivtv/ivtvfb.c index 4cb365d4ffdc..8b95eefb610b 100644 --- a/drivers/media/pci/ivtv/ivtvfb.c +++ b/drivers/media/pci/ivtv/ivtvfb.c | |||
| @@ -38,6 +38,8 @@ | |||
| 38 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA | 38 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA |
| 39 | */ | 39 | */ |
| 40 | 40 | ||
| 41 | #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt | ||
| 42 | |||
| 41 | #include <linux/module.h> | 43 | #include <linux/module.h> |
| 42 | #include <linux/kernel.h> | 44 | #include <linux/kernel.h> |
| 43 | #include <linux/fb.h> | 45 | #include <linux/fb.h> |
| @@ -1171,6 +1173,13 @@ static int ivtvfb_init_card(struct ivtv *itv) | |||
| 1171 | { | 1173 | { |
| 1172 | int rc; | 1174 | int rc; |
| 1173 | 1175 | ||
| 1176 | #ifdef CONFIG_X86_64 | ||
| 1177 | if (pat_enabled()) { | ||
| 1178 | pr_warn("ivtvfb needs PAT disabled, boot with nopat kernel parameter\n"); | ||
| 1179 | return -ENODEV; | ||
| 1180 | } | ||
| 1181 | #endif | ||
| 1182 | |||
| 1174 | if (itv->osd_info) { | 1183 | if (itv->osd_info) { |
| 1175 | IVTVFB_ERR("Card %d already initialised\n", ivtvfb_card_id); | 1184 | IVTVFB_ERR("Card %d already initialised\n", ivtvfb_card_id); |
| 1176 | return -EBUSY; | 1185 | return -EBUSY; |
| @@ -1265,12 +1274,6 @@ static int __init ivtvfb_init(void) | |||
| 1265 | int registered = 0; | 1274 | int registered = 0; |
| 1266 | int err; | 1275 | int err; |
| 1267 | 1276 | ||
| 1268 | #ifdef CONFIG_X86_64 | ||
| 1269 | if (WARN(pat_enabled(), | ||
| 1270 | "ivtvfb needs PAT disabled, boot with nopat kernel parameter\n")) { | ||
| 1271 | return -ENODEV; | ||
| 1272 | } | ||
| 1273 | #endif | ||
| 1274 | 1277 | ||
| 1275 | if (ivtvfb_card_id < -1 || ivtvfb_card_id >= IVTV_MAX_CARDS) { | 1278 | if (ivtvfb_card_id < -1 || ivtvfb_card_id >= IVTV_MAX_CARDS) { |
| 1276 | printk(KERN_ERR "ivtvfb: ivtvfb_card_id parameter is out of range (valid range: -1 - %d)\n", | 1279 | printk(KERN_ERR "ivtvfb: ivtvfb_card_id parameter is out of range (valid range: -1 - %d)\n", |
diff --git a/include/linux/cper.h b/include/linux/cper.h index 76abba4b238e..dcacb1a72e26 100644 --- a/include/linux/cper.h +++ b/include/linux/cper.h | |||
| @@ -340,7 +340,27 @@ struct cper_ia_proc_ctx { | |||
| 340 | __u64 mm_reg_addr; | 340 | __u64 mm_reg_addr; |
| 341 | }; | 341 | }; |
| 342 | 342 | ||
| 343 | /* Memory Error Section */ | 343 | /* Old Memory Error Section UEFI 2.1, 2.2 */ |
| 344 | struct cper_sec_mem_err_old { | ||
| 345 | __u64 validation_bits; | ||
| 346 | __u64 error_status; | ||
| 347 | __u64 physical_addr; | ||
| 348 | __u64 physical_addr_mask; | ||
| 349 | __u16 node; | ||
| 350 | __u16 card; | ||
| 351 | __u16 module; | ||
| 352 | __u16 bank; | ||
| 353 | __u16 device; | ||
| 354 | __u16 row; | ||
| 355 | __u16 column; | ||
| 356 | __u16 bit_pos; | ||
| 357 | __u64 requestor_id; | ||
| 358 | __u64 responder_id; | ||
| 359 | __u64 target_id; | ||
| 360 | __u8 error_type; | ||
| 361 | }; | ||
| 362 | |||
| 363 | /* Memory Error Section UEFI >= 2.3 */ | ||
| 344 | struct cper_sec_mem_err { | 364 | struct cper_sec_mem_err { |
| 345 | __u64 validation_bits; | 365 | __u64 validation_bits; |
| 346 | __u64 error_status; | 366 | __u64 error_status; |
diff --git a/kernel/resource.c b/kernel/resource.c index 90552aab5f2d..fed052a1bc9f 100644 --- a/kernel/resource.c +++ b/kernel/resource.c | |||
| @@ -504,13 +504,13 @@ int region_is_ram(resource_size_t start, unsigned long size) | |||
| 504 | { | 504 | { |
| 505 | struct resource *p; | 505 | struct resource *p; |
| 506 | resource_size_t end = start + size - 1; | 506 | resource_size_t end = start + size - 1; |
| 507 | int flags = IORESOURCE_MEM | IORESOURCE_BUSY; | 507 | unsigned long flags = IORESOURCE_MEM | IORESOURCE_BUSY; |
| 508 | const char *name = "System RAM"; | 508 | const char *name = "System RAM"; |
| 509 | int ret = -1; | 509 | int ret = -1; |
| 510 | 510 | ||
| 511 | read_lock(&resource_lock); | 511 | read_lock(&resource_lock); |
| 512 | for (p = iomem_resource.child; p ; p = p->sibling) { | 512 | for (p = iomem_resource.child; p ; p = p->sibling) { |
| 513 | if (end < p->start) | 513 | if (p->end < start) |
| 514 | continue; | 514 | continue; |
| 515 | 515 | ||
| 516 | if (p->start <= start && end <= p->end) { | 516 | if (p->start <= start && end <= p->end) { |
| @@ -521,7 +521,7 @@ int region_is_ram(resource_size_t start, unsigned long size) | |||
| 521 | ret = 1; | 521 | ret = 1; |
| 522 | break; | 522 | break; |
| 523 | } | 523 | } |
| 524 | if (p->end < start) | 524 | if (end < p->start) |
| 525 | break; /* not found */ | 525 | break; /* not found */ |
| 526 | } | 526 | } |
| 527 | read_unlock(&resource_lock); | 527 | read_unlock(&resource_lock); |
