# git rev-parse -q --verify 65ea11ec6a82b1d44aba62b59e9eb20247e57c6e^{commit} 65ea11ec6a82b1d44aba62b59e9eb20247e57c6e already have revision, skipping fetch # git checkout -q -f -B kisskb 65ea11ec6a82b1d44aba62b59e9eb20247e57c6e # git clean -qxdf # git log -1 commit 65ea11ec6a82b1d44aba62b59e9eb20247e57c6e Author: Ville Syrjälä Date: Mon Aug 8 20:35:29 2016 +0300 x86/hweight: Don't clobber %rdi The caller expects %rdi to remain intact, push+pop it make that happen. Fixes the following kind of explosions on my core2duo machine when trying to reboot or shut down: general protection fault: 0000 [#1] PREEMPT SMP Modules linked in: i915 i2c_algo_bit drm_kms_helper cfbfillrect syscopyarea cfbimgblt sysfillrect sysimgblt fb_sys_fops cfbcopyarea drm netconsole configfs binfmt_misc iTCO_wdt psmouse pcspkr snd_hda_codec_idt e100 coretemp hwmon snd_hda_codec_generic i2c_i801 mii i2c_smbus lpc_ich mfd_core snd_hda_intel uhci_hcd snd_hda_codec snd_hwdep snd_hda_core ehci_pci 8250 ehci_hcd snd_pcm 8250_base usbcore evdev serial_core usb_common parport_pc parport snd_timer snd soundcore CPU: 0 PID: 3070 Comm: reboot Not tainted 4.8.0-rc1-perf-dirty #69 Hardware name: /D946GZIS, BIOS TS94610J.86A.0087.2007.1107.1049 11/07/2007 task: ffff88012a0b4080 task.stack: ffff880123850000 RIP: 0010:[] [] x86_perf_event_update+0x52/0xc0 RSP: 0018:ffff880123853b60 EFLAGS: 00010087 RAX: 0000000000000001 RBX: ffff88012fc0a3c0 RCX: 000000000000001e RDX: 0000000000000000 RSI: 0000000040000000 RDI: ffff88012b014800 RBP: ffff880123853b88 R08: ffffffffffffffff R09: 0000000000000000 R10: ffffea0004a012c0 R11: ffffea0004acedc0 R12: ffffffff80000001 R13: ffff88012b0149c0 R14: ffff88012b014800 R15: 0000000000000018 FS: 00007f8b155cd700(0000) GS:ffff88012fc00000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 00007f8b155f5000 CR3: 000000012a2d7000 CR4: 00000000000006f0 Stack: ffff88012fc0a3c0 ffff88012b014800 0000000000000004 0000000000000001 ffff88012fc1b750 ffff880123853bb0 ffffffff81003d59 ffff88012b014800 ffff88012fc0a3c0 ffff88012b014800 ffff880123853bd8 ffffffff81003e13 Call Trace: [] x86_pmu_stop+0x59/0xd0 [] x86_pmu_del+0x43/0x140 [] event_sched_out.isra.105+0xbd/0x260 [] __perf_remove_from_context+0x2d/0xb0 [] __perf_event_exit_context+0x4d/0x70 [] generic_exec_single+0xb6/0x140 [] ? __perf_remove_from_context+0xb0/0xb0 [] ? __perf_remove_from_context+0xb0/0xb0 [] smp_call_function_single+0xdf/0x140 [] perf_event_exit_cpu_context+0x87/0xc0 [] perf_reboot+0x13/0x40 [] notifier_call_chain+0x4a/0x70 [] __blocking_notifier_call_chain+0x47/0x60 [] blocking_notifier_call_chain+0x16/0x20 [] kernel_restart_prepare+0x1d/0x40 [] kernel_restart+0x12/0x60 [] SYSC_reboot+0xf6/0x1b0 [] ? mntput_no_expire+0x2c/0x1b0 [] ? mntput+0x24/0x40 [] ? __fput+0x16c/0x1e0 [] ? ____fput+0xe/0x10 [] ? task_work_run+0x83/0xa0 [] ? exit_to_usermode_loop+0x53/0xc0 [] ? trace_hardirqs_on_thunk+0x1a/0x1c [] SyS_reboot+0xe/0x10 [] entry_SYSCALL_64_fastpath+0x18/0xa3 Code: 7c 4c 8d af c0 01 00 00 49 89 fe eb 10 48 09 c2 4c 89 e0 49 0f b1 55 00 4c 39 e0 74 35 4d 8b a6 c0 01 00 00 41 8b 8e 60 01 00 00 <0f> 33 8b 35 6e 02 8c 00 48 c1 e2 20 85 f6 7e d2 48 89 d3 89 cf RIP [] x86_perf_event_update+0x52/0xc0 RSP ---[ end trace 7ec95181faf211be ]--- note: reboot[3070] exited with preempt_count 2 Cc: Borislav Petkov Cc: H. Peter Anvin Cc: Andy Lutomirski Cc: Brian Gerst Cc: Denys Vlasenko Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: Ingo Molnar Fixes: f5967101e9de ("x86/hweight: Get rid of the special calling convention") Signed-off-by: Ville Syrjälä Signed-off-by: Linus Torvalds # < /opt/cross/kisskb/gcc-4.6.3-nolibc/x86_64-linux/bin/x86_64-linux-gcc --version # < git log --format=%s --max-count=1 65ea11ec6a82b1d44aba62b59e9eb20247e57c6e # < make -j 10 ARCH=x86_64 O=/home/kisskb/slave/build/linus_x86_64-randconfig_x86_64 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/x86_64-linux/bin/x86_64-linux- randconfig KCONFIG_SEED=0x423ADE4E # Added to kconfig CONFIG_STANDALONE=y # Added to kconfig CONFIG_PREVENT_FIRMWARE_BUILD=y # yes \n | make -j 10 ARCH=x86_64 O=/home/kisskb/slave/build/linus_x86_64-randconfig_x86_64 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/x86_64-linux/bin/x86_64-linux- oldconfig yes: standard output: Broken pipe yes: write error # make -j 10 ARCH=x86_64 O=/home/kisskb/slave/build/linus_x86_64-randconfig_x86_64 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/x86_64-linux/bin/x86_64-linux- make[1]: Entering directory '/home/kisskb/slave/build/linus_x86_64-randconfig_x86_64' GEN ./Makefile scripts/kconfig/conf --silentoldconfig Kconfig scripts/Makefile.gcc-plugins:17: warning: cannot use CONFIG_KCOV: -fsanitize-coverage=trace-pc is not supported by compiler ++ dirname /home/kisskb/slave/src/scripts/gcc-plugin.sh + srctree=/home/kisskb/slave/src/scripts ++ /opt/cross/kisskb/gcc-4.6.3-nolibc/x86_64-linux/bin/x86_64-linux-gcc -print-file-name=plugin + gccplugins_dir=/opt/cross/gcc-4.6.3-nolibc/x86_64-linux/lib/gcc/x86_64-linux/4.6.3/plugin ++ gcc -E -x c++ - -o /dev/null -I/home/kisskb/slave/src/scripts/gcc-plugins -I/opt/cross/gcc-4.6.3-nolibc/x86_64-linux/lib/gcc/x86_64-linux/4.6.3/plugin/include + plugincc='gcc: error trying to exec '\''cc1plus'\'': execvp: No such file or directory' + '[' 1 -ne 0 ']' + exit 1 scripts/Makefile.gcc-plugins:30: warning: your gcc installation does not support plugins, perhaps the necessary headers are missing? scripts/Makefile.kasan:19: Cannot use CONFIG_KASAN: -fsanitize=kernel-address is not supported by compiler SYSTBL arch/x86/entry/syscalls/../../include/generated/asm/syscalls_32.h SYSHDR arch/x86/entry/syscalls/../../include/generated/asm/unistd_64_x32.h SYSTBL arch/x86/entry/syscalls/../../include/generated/asm/syscalls_64.h SYSHDR arch/x86/entry/syscalls/../../include/generated/asm/unistd_32_ia32.h SYSHDR arch/x86/entry/syscalls/../../include/generated/uapi/asm/unistd_32.h SYSHDR arch/x86/entry/syscalls/../../include/generated/uapi/asm/unistd_64.h SYSHDR arch/x86/entry/syscalls/../../include/generated/uapi/asm/unistd_x32.h CHK include/config/kernel.release Cannot use CONFIG_CC_STACKPROTECTOR_STRONG: -fstack-protector-strong not supported by compiler /home/kisskb/slave/src/Makefile:1055: recipe for target 'prepare-compiler-check' failed make[1]: *** [prepare-compiler-check] Error 1 make[1]: *** Waiting for unfinished jobs.... UPD include/config/kernel.release make[1]: *** wait: No child processes. Stop. Makefile:150: recipe for target 'sub-make' failed make: *** [sub-make] Error 2 Command 'make -j 10 ARCH=x86_64 O=/home/kisskb/slave/build/linus_x86_64-randconfig_x86_64 CROSS_COMPILE=/opt/cross/kisskb/gcc-4.6.3-nolibc/x86_64-linux/bin/x86_64-linux- ' returned non-zero exit status 2 # rm -rf /home/kisskb/slave/build/linus_x86_64-randconfig_x86_64 # Build took: 0:00:08.826926