diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2018-11-30 14:34:25 -0500 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2018-11-30 14:34:25 -0500 |
| commit | 1ec63573b2db363848abb313cc75eb29e9abc1b3 (patch) | |
| tree | 3efb06fe490831e48f8708c4ac21f14f486bab58 /arch/x86/kernel | |
| parent | a1b3cf6d943800059adc262c4d839524c529db2d (diff) | |
| parent | 60c8144afc287ef09ce8c1230c6aa972659ba1bb (diff) | |
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:
- MCE related boot crash fix on certain AMD systems
- FPU exception handling fix
- FPU handling race fix
- revert+rewrite of the RSDP boot protocol extension, use boot_params
instead
- documentation fix"
* 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
x86/MCE/AMD: Fix the thresholding machinery initialization order
x86/fpu: Use the correct exception table macro in the XSTATE_OP wrapper
x86/fpu: Disable bottom halves while loading FPU registers
x86/acpi, x86/boot: Take RSDP address from boot params if available
x86/boot: Mostly revert commit ae7e1238e68f2a ("Add ACPI RSDP address to setup_header")
x86/ptrace: Fix documentation for tracehook_report_syscall_entry()
Diffstat (limited to 'arch/x86/kernel')
| -rw-r--r-- | arch/x86/kernel/acpi/boot.c | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/cpu/mcheck/mce_amd.c | 19 | ||||
| -rw-r--r-- | arch/x86/kernel/fpu/signal.c | 4 | ||||
| -rw-r--r-- | arch/x86/kernel/head32.c | 1 | ||||
| -rw-r--r-- | arch/x86/kernel/head64.c | 2 | ||||
| -rw-r--r-- | arch/x86/kernel/setup.c | 17 |
6 files changed, 9 insertions, 36 deletions
diff --git a/arch/x86/kernel/acpi/boot.c b/arch/x86/kernel/acpi/boot.c index 92c76bf97ad8..06635fbca81c 100644 --- a/arch/x86/kernel/acpi/boot.c +++ b/arch/x86/kernel/acpi/boot.c | |||
| @@ -1776,5 +1776,5 @@ void __init arch_reserve_mem_area(acpi_physical_address addr, size_t size) | |||
| 1776 | 1776 | ||
| 1777 | u64 x86_default_get_root_pointer(void) | 1777 | u64 x86_default_get_root_pointer(void) |
| 1778 | { | 1778 | { |
| 1779 | return boot_params.hdr.acpi_rsdp_addr; | 1779 | return boot_params.acpi_rsdp_addr; |
| 1780 | } | 1780 | } |
diff --git a/arch/x86/kernel/cpu/mcheck/mce_amd.c b/arch/x86/kernel/cpu/mcheck/mce_amd.c index dd33c357548f..e12454e21b8a 100644 --- a/arch/x86/kernel/cpu/mcheck/mce_amd.c +++ b/arch/x86/kernel/cpu/mcheck/mce_amd.c | |||
| @@ -56,7 +56,7 @@ | |||
| 56 | /* Threshold LVT offset is at MSR0xC0000410[15:12] */ | 56 | /* Threshold LVT offset is at MSR0xC0000410[15:12] */ |
| 57 | #define SMCA_THR_LVT_OFF 0xF000 | 57 | #define SMCA_THR_LVT_OFF 0xF000 |
| 58 | 58 | ||
| 59 | static bool thresholding_en; | 59 | static bool thresholding_irq_en; |
| 60 | 60 | ||
| 61 | static const char * const th_names[] = { | 61 | static const char * const th_names[] = { |
| 62 | "load_store", | 62 | "load_store", |
| @@ -534,9 +534,8 @@ prepare_threshold_block(unsigned int bank, unsigned int block, u32 addr, | |||
| 534 | 534 | ||
| 535 | set_offset: | 535 | set_offset: |
| 536 | offset = setup_APIC_mce_threshold(offset, new); | 536 | offset = setup_APIC_mce_threshold(offset, new); |
| 537 | 537 | if (offset == new) | |
| 538 | if ((offset == new) && (mce_threshold_vector != amd_threshold_interrupt)) | 538 | thresholding_irq_en = true; |
| 539 | mce_threshold_vector = amd_threshold_interrupt; | ||
| 540 | 539 | ||
| 541 | done: | 540 | done: |
| 542 | mce_threshold_block_init(&b, offset); | 541 | mce_threshold_block_init(&b, offset); |
| @@ -1357,9 +1356,6 @@ int mce_threshold_remove_device(unsigned int cpu) | |||
| 1357 | { | 1356 | { |
| 1358 | unsigned int bank; | 1357 | unsigned int bank; |
| 1359 | 1358 | ||
| 1360 | if (!thresholding_en) | ||
| 1361 | return 0; | ||
| 1362 | |||
| 1363 | for (bank = 0; bank < mca_cfg.banks; ++bank) { | 1359 | for (bank = 0; bank < mca_cfg.banks; ++bank) { |
| 1364 | if (!(per_cpu(bank_map, cpu) & (1 << bank))) | 1360 | if (!(per_cpu(bank_map, cpu) & (1 << bank))) |
| 1365 | continue; | 1361 | continue; |
| @@ -1377,9 +1373,6 @@ int mce_threshold_create_device(unsigned int cpu) | |||
| 1377 | struct threshold_bank **bp; | 1373 | struct threshold_bank **bp; |
| 1378 | int err = 0; | 1374 | int err = 0; |
| 1379 | 1375 | ||
| 1380 | if (!thresholding_en) | ||
| 1381 | return 0; | ||
| 1382 | |||
| 1383 | bp = per_cpu(threshold_banks, cpu); | 1376 | bp = per_cpu(threshold_banks, cpu); |
| 1384 | if (bp) | 1377 | if (bp) |
| 1385 | return 0; | 1378 | return 0; |
| @@ -1408,9 +1401,6 @@ static __init int threshold_init_device(void) | |||
| 1408 | { | 1401 | { |
| 1409 | unsigned lcpu = 0; | 1402 | unsigned lcpu = 0; |
| 1410 | 1403 | ||
| 1411 | if (mce_threshold_vector == amd_threshold_interrupt) | ||
| 1412 | thresholding_en = true; | ||
| 1413 | |||
| 1414 | /* to hit CPUs online before the notifier is up */ | 1404 | /* to hit CPUs online before the notifier is up */ |
| 1415 | for_each_online_cpu(lcpu) { | 1405 | for_each_online_cpu(lcpu) { |
| 1416 | int err = mce_threshold_create_device(lcpu); | 1406 | int err = mce_threshold_create_device(lcpu); |
| @@ -1419,6 +1409,9 @@ static __init int threshold_init_device(void) | |||
| 1419 | return err; | 1409 | return err; |
| 1420 | } | 1410 | } |
| 1421 | 1411 | ||
| 1412 | if (thresholding_irq_en) | ||
| 1413 | mce_threshold_vector = amd_threshold_interrupt; | ||
| 1414 | |||
| 1422 | return 0; | 1415 | return 0; |
| 1423 | } | 1416 | } |
| 1424 | /* | 1417 | /* |
diff --git a/arch/x86/kernel/fpu/signal.c b/arch/x86/kernel/fpu/signal.c index 61a949d84dfa..d99a8ee9e185 100644 --- a/arch/x86/kernel/fpu/signal.c +++ b/arch/x86/kernel/fpu/signal.c | |||
| @@ -344,10 +344,10 @@ static int __fpu__restore_sig(void __user *buf, void __user *buf_fx, int size) | |||
| 344 | sanitize_restored_xstate(tsk, &env, xfeatures, fx_only); | 344 | sanitize_restored_xstate(tsk, &env, xfeatures, fx_only); |
| 345 | } | 345 | } |
| 346 | 346 | ||
| 347 | local_bh_disable(); | ||
| 347 | fpu->initialized = 1; | 348 | fpu->initialized = 1; |
| 348 | preempt_disable(); | ||
| 349 | fpu__restore(fpu); | 349 | fpu__restore(fpu); |
| 350 | preempt_enable(); | 350 | local_bh_enable(); |
| 351 | 351 | ||
| 352 | return err; | 352 | return err; |
| 353 | } else { | 353 | } else { |
diff --git a/arch/x86/kernel/head32.c b/arch/x86/kernel/head32.c index 76fa3b836598..ec6fefbfd3c0 100644 --- a/arch/x86/kernel/head32.c +++ b/arch/x86/kernel/head32.c | |||
| @@ -37,7 +37,6 @@ asmlinkage __visible void __init i386_start_kernel(void) | |||
| 37 | cr4_init_shadow(); | 37 | cr4_init_shadow(); |
| 38 | 38 | ||
| 39 | sanitize_boot_params(&boot_params); | 39 | sanitize_boot_params(&boot_params); |
| 40 | x86_verify_bootdata_version(); | ||
| 41 | 40 | ||
| 42 | x86_early_init_platform_quirks(); | 41 | x86_early_init_platform_quirks(); |
| 43 | 42 | ||
diff --git a/arch/x86/kernel/head64.c b/arch/x86/kernel/head64.c index 7663a8eb602b..16b1cbd3a61e 100644 --- a/arch/x86/kernel/head64.c +++ b/arch/x86/kernel/head64.c | |||
| @@ -457,8 +457,6 @@ void __init x86_64_start_reservations(char *real_mode_data) | |||
| 457 | if (!boot_params.hdr.version) | 457 | if (!boot_params.hdr.version) |
| 458 | copy_bootdata(__va(real_mode_data)); | 458 | copy_bootdata(__va(real_mode_data)); |
| 459 | 459 | ||
| 460 | x86_verify_bootdata_version(); | ||
| 461 | |||
| 462 | x86_early_init_platform_quirks(); | 460 | x86_early_init_platform_quirks(); |
| 463 | 461 | ||
| 464 | switch (boot_params.hdr.hardware_subarch) { | 462 | switch (boot_params.hdr.hardware_subarch) { |
diff --git a/arch/x86/kernel/setup.c b/arch/x86/kernel/setup.c index b74e7bfed6ab..d494b9bfe618 100644 --- a/arch/x86/kernel/setup.c +++ b/arch/x86/kernel/setup.c | |||
| @@ -1280,23 +1280,6 @@ void __init setup_arch(char **cmdline_p) | |||
| 1280 | unwind_init(); | 1280 | unwind_init(); |
| 1281 | } | 1281 | } |
| 1282 | 1282 | ||
| 1283 | /* | ||
| 1284 | * From boot protocol 2.14 onwards we expect the bootloader to set the | ||
| 1285 | * version to "0x8000 | <used version>". In case we find a version >= 2.14 | ||
| 1286 | * without the 0x8000 we assume the boot loader supports 2.13 only and | ||
| 1287 | * reset the version accordingly. The 0x8000 flag is removed in any case. | ||
| 1288 | */ | ||
| 1289 | void __init x86_verify_bootdata_version(void) | ||
| 1290 | { | ||
| 1291 | if (boot_params.hdr.version & VERSION_WRITTEN) | ||
| 1292 | boot_params.hdr.version &= ~VERSION_WRITTEN; | ||
| 1293 | else if (boot_params.hdr.version >= 0x020e) | ||
| 1294 | boot_params.hdr.version = 0x020d; | ||
| 1295 | |||
| 1296 | if (boot_params.hdr.version < 0x020e) | ||
| 1297 | boot_params.hdr.acpi_rsdp_addr = 0; | ||
| 1298 | } | ||
| 1299 | |||
| 1300 | #ifdef CONFIG_X86_32 | 1283 | #ifdef CONFIG_X86_32 |
| 1301 | 1284 | ||
| 1302 | static struct resource video_ram_resource = { | 1285 | static struct resource video_ram_resource = { |
