Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip

Pull x86 fixes from Ingo Molnar:
"Misc fixes:

- revert a /dev/mem restriction change that crashes with certain boot
parameters

- an AMD erratum fix for cases where the BIOS doesn't apply it

- fix unwinder debuginfo

- improve ORC unwinder warning printouts"

* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
Revert "x86/mm: Limit mmap() of /dev/mem to valid physical addresses"
x86/unwind: Show function name+offset in ORC error messages
x86/entry: Fix idtentry unwind hint
x86/cpu/AMD: Apply the Erratum 688 fix when the BIOS doesn't

+57 -31
+1 -1
arch/x86/entry/entry_64.S
··· 808 808 809 809 .macro idtentry sym do_sym has_error_code:req paranoid=0 shift_ist=-1 810 810 ENTRY(\sym) 811 - UNWIND_HINT_IRET_REGS offset=8 811 + UNWIND_HINT_IRET_REGS offset=\has_error_code*8 812 812 813 813 /* Sanity check */ 814 814 .if \shift_ist != -1 && \paranoid == 0
-4
arch/x86/include/asm/io.h
··· 110 110 111 111 #endif 112 112 113 - #define ARCH_HAS_VALID_PHYS_ADDR_RANGE 114 - extern int valid_phys_addr_range(phys_addr_t addr, size_t size); 115 - extern int valid_mmap_phys_addr_range(unsigned long pfn, size_t size); 116 - 117 113 /** 118 114 * virt_to_phys - map virtual addresses to physical 119 115 * @address: address to remap
+41
arch/x86/kernel/amd_nb.c
··· 27 27 {} 28 28 }; 29 29 30 + #define PCI_DEVICE_ID_AMD_CNB17H_F4 0x1704 31 + 30 32 const struct pci_device_id amd_nb_misc_ids[] = { 31 33 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_K8_NB_MISC) }, 32 34 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_10H_NB_MISC) }, ··· 39 37 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_NB_F3) }, 40 38 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F3) }, 41 39 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_DF_F3) }, 40 + { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F3) }, 42 41 {} 43 42 }; 44 43 EXPORT_SYMBOL_GPL(amd_nb_misc_ids); ··· 51 48 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_NB_F4) }, 52 49 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_16H_M30H_NB_F4) }, 53 50 { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_17H_DF_F4) }, 51 + { PCI_DEVICE(PCI_VENDOR_ID_AMD, PCI_DEVICE_ID_AMD_CNB17H_F4) }, 54 52 {} 55 53 }; 56 54 ··· 406 402 } 407 403 EXPORT_SYMBOL_GPL(amd_flush_garts); 408 404 405 + static void __fix_erratum_688(void *info) 406 + { 407 + #define MSR_AMD64_IC_CFG 0xC0011021 408 + 409 + msr_set_bit(MSR_AMD64_IC_CFG, 3); 410 + msr_set_bit(MSR_AMD64_IC_CFG, 14); 411 + } 412 + 413 + /* Apply erratum 688 fix so machines without a BIOS fix work. */ 414 + static __init void fix_erratum_688(void) 415 + { 416 + struct pci_dev *F4; 417 + u32 val; 418 + 419 + if (boot_cpu_data.x86 != 0x14) 420 + return; 421 + 422 + if (!amd_northbridges.num) 423 + return; 424 + 425 + F4 = node_to_amd_nb(0)->link; 426 + if (!F4) 427 + return; 428 + 429 + if (pci_read_config_dword(F4, 0x164, &val)) 430 + return; 431 + 432 + if (val & BIT(2)) 433 + return; 434 + 435 + on_each_cpu(__fix_erratum_688, NULL, 0); 436 + 437 + pr_info("x86/cpu/AMD: CPU erratum 688 worked around\n"); 438 + } 439 + 409 440 static __init int init_amd_nbs(void) 410 441 { 411 442 amd_cache_northbridges(); 412 443 amd_cache_gart(); 444 + 445 + fix_erratum_688(); 413 446 414 447 return 0; 415 448 }
+15 -14
arch/x86/kernel/unwind_orc.c
··· 86 86 idx = (ip - LOOKUP_START_IP) / LOOKUP_BLOCK_SIZE; 87 87 88 88 if (unlikely((idx >= lookup_num_blocks-1))) { 89 - orc_warn("WARNING: bad lookup idx: idx=%u num=%u ip=%lx\n", 90 - idx, lookup_num_blocks, ip); 89 + orc_warn("WARNING: bad lookup idx: idx=%u num=%u ip=%pB\n", 90 + idx, lookup_num_blocks, (void *)ip); 91 91 return NULL; 92 92 } 93 93 ··· 96 96 97 97 if (unlikely((__start_orc_unwind + start >= __stop_orc_unwind) || 98 98 (__start_orc_unwind + stop > __stop_orc_unwind))) { 99 - orc_warn("WARNING: bad lookup value: idx=%u num=%u start=%u stop=%u ip=%lx\n", 100 - idx, lookup_num_blocks, start, stop, ip); 99 + orc_warn("WARNING: bad lookup value: idx=%u num=%u start=%u stop=%u ip=%pB\n", 100 + idx, lookup_num_blocks, start, stop, (void *)ip); 101 101 return NULL; 102 102 } 103 103 ··· 373 373 374 374 case ORC_REG_R10: 375 375 if (!state->regs || !state->full_regs) { 376 - orc_warn("missing regs for base reg R10 at ip %p\n", 376 + orc_warn("missing regs for base reg R10 at ip %pB\n", 377 377 (void *)state->ip); 378 378 goto done; 379 379 } ··· 382 382 383 383 case ORC_REG_R13: 384 384 if (!state->regs || !state->full_regs) { 385 - orc_warn("missing regs for base reg R13 at ip %p\n", 385 + orc_warn("missing regs for base reg R13 at ip %pB\n", 386 386 (void *)state->ip); 387 387 goto done; 388 388 } ··· 391 391 392 392 case ORC_REG_DI: 393 393 if (!state->regs || !state->full_regs) { 394 - orc_warn("missing regs for base reg DI at ip %p\n", 394 + orc_warn("missing regs for base reg DI at ip %pB\n", 395 395 (void *)state->ip); 396 396 goto done; 397 397 } ··· 400 400 401 401 case ORC_REG_DX: 402 402 if (!state->regs || !state->full_regs) { 403 - orc_warn("missing regs for base reg DX at ip %p\n", 403 + orc_warn("missing regs for base reg DX at ip %pB\n", 404 404 (void *)state->ip); 405 405 goto done; 406 406 } ··· 408 408 break; 409 409 410 410 default: 411 - orc_warn("unknown SP base reg %d for ip %p\n", 411 + orc_warn("unknown SP base reg %d for ip %pB\n", 412 412 orc->sp_reg, (void *)state->ip); 413 413 goto done; 414 414 } ··· 436 436 437 437 case ORC_TYPE_REGS: 438 438 if (!deref_stack_regs(state, sp, &state->ip, &state->sp, true)) { 439 - orc_warn("can't dereference registers at %p for ip %p\n", 439 + orc_warn("can't dereference registers at %p for ip %pB\n", 440 440 (void *)sp, (void *)orig_ip); 441 441 goto done; 442 442 } ··· 448 448 449 449 case ORC_TYPE_REGS_IRET: 450 450 if (!deref_stack_regs(state, sp, &state->ip, &state->sp, false)) { 451 - orc_warn("can't dereference iret registers at %p for ip %p\n", 451 + orc_warn("can't dereference iret registers at %p for ip %pB\n", 452 452 (void *)sp, (void *)orig_ip); 453 453 goto done; 454 454 } ··· 465 465 break; 466 466 467 467 default: 468 - orc_warn("unknown .orc_unwind entry type %d\n", orc->type); 468 + orc_warn("unknown .orc_unwind entry type %d for ip %pB\n", 469 + orc->type, (void *)orig_ip); 469 470 break; 470 471 } 471 472 ··· 488 487 break; 489 488 490 489 default: 491 - orc_warn("unknown BP base reg %d for ip %p\n", 490 + orc_warn("unknown BP base reg %d for ip %pB\n", 492 491 orc->bp_reg, (void *)orig_ip); 493 492 goto done; 494 493 } ··· 497 496 if (state->stack_info.type == prev_type && 498 497 on_stack(&state->stack_info, (void *)state->sp, sizeof(long)) && 499 498 state->sp <= prev_sp) { 500 - orc_warn("stack going in the wrong direction? ip=%p\n", 499 + orc_warn("stack going in the wrong direction? ip=%pB\n", 501 500 (void *)orig_ip); 502 501 goto done; 503 502 }
-12
arch/x86/mm/mmap.c
··· 174 174 return "[mpx]"; 175 175 return NULL; 176 176 } 177 - 178 - int valid_phys_addr_range(phys_addr_t addr, size_t count) 179 - { 180 - return addr + count <= __pa(high_memory); 181 - } 182 - 183 - int valid_mmap_phys_addr_range(unsigned long pfn, size_t count) 184 - { 185 - phys_addr_t addr = (phys_addr_t)pfn << PAGE_SHIFT; 186 - 187 - return valid_phys_addr_range(addr, count); 188 - }