FYI, we noticed the following commit (built with gcc-7):
commit: 0e2bc33d204ba5407465d09f8622077ad5739839 ("x86/alternatives: Teach
text_poke_bp() to emulate instructions")
https://git.kernel.org/cgit/linux/kernel/git/peterz/queue.git x86/static_call
in testcase: boot
on test machine: qemu-system-x86_64 -enable-kvm -cpu SandyBridge -smp 2 -m 2G
caused below changes (please refer to attached dmesg/kmsg for entire log/backtrace):
+-------------------------------------------------------+------------+------------+
| | 68b46ce8b9 | 0e2bc33d20 |
+-------------------------------------------------------+------------+------------+
| boot_successes | 91 | 64 |
| boot_failures | 21 | 42 |
| BUG:kernel_reboot-without-warning_in_test_stage | 21 | 11 |
| BUG:kernel_NULL_pointer_dereference,address | 0 | 24 |
| Oops:#[##] | 0 | 31 |
| RIP:native_write_msr | 0 | 3 |
| Kernel_panic-not_syncing:Fatal_exception_in_interrupt | 0 | 29 |
| RIP:native_safe_halt | 0 | 22 |
| RIP:smp_call_function_single | 0 | 17 |
| RIP:on_each_cpu | 0 | 1 |
| BUG:unable_to_handle_page_fault_for_address | 0 | 7 |
| RIP:__text_poke | 0 | 1 |
| Kernel_panic-not_syncing:Fatal_exception | 0 | 2 |
+-------------------------------------------------------+------------+------------+
If you fix the issue, kindly add following tag
Reported-by: kernel test robot <lkp(a)intel.com>
[ 2.869246] BUG: kernel NULL pointer dereference, address: 0000000000000000
[ 2.869246] #PF: supervisor instruction fetch in kernel mode
[ 2.869246] #PF: error_code(0x0010) - not-present page
[ 2.869246] PGD 0 P4D 0
[ 2.869246] Oops: 0010 [#1] SMP PTI
[ 2.869246] CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.2.0-rc4-00079-g0e2bc33 #1
[ 2.869246] Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS 1.10.2-1
04/01/2014
[ 2.869246] RIP: 0010:0x0
[ 2.869246] Code: Bad RIP value.
[ 2.869246] RSP: 0000:ffffbcc1c0003f98 EFLAGS: 00010087
[ 2.869246] RAX: 0000000000005ba8 RBX: ffffffffb6114f5f RCX: ffff9eb8f00177f0
[ 2.869246] RDX: 0000000000000000 RSI: 00000000000f4240 RDI: 0000000000d8abf8
[ 2.869246] RBP: ffff9eb8ef4b3c00 R08: 0000000000000000 R09: 0000000000000000
[ 2.869246] R10: 0000000000000000 R11: 0000003b9aca0000 R12: 0000000000000000
[ 2.869246] R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
[ 2.869246] FS: 0000000000000000(0000) GS:ffff9eb8f0000000(0000)
knlGS:0000000000000000
[ 2.869246] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 2.869246] CR2: ffffffffffffffd6 CR3: 000000006660a000 CR4: 00000000000406f0
[ 2.869246] Call Trace:
[ 2.869246] <IRQ>
[ 2.869246] update_process_times+0x1c/0x50
[ 2.869246] tick_periodic+0x27/0x80
[ 2.869246] tick_handle_periodic+0x20/0x60
[ 2.869246] smp_apic_timer_interrupt+0x6a/0x150
[ 2.869246] apic_timer_interrupt+0xf/0x20
[ 2.869246] </IRQ>
[ 2.869246] RIP: 0010:smp_call_function_single+0xea/0x110
[ 2.869246] Code: 00 00 00 75 44 48 83 c4 48 41 5a 5d 49 8d 62 f8 c3 48 89 d1 48 89 f2
48 8d 75 b0 e8 60 fe ff ff 8b 55 c8 83 e2 01 74 0a f3 90 <8b> 55 c8 83 e2 01 75 f6
eb bb 8b 05 86 57 c7 01 85 c0 0f 85 76 ff
[ 2.869246] RSP: 0000:ffffbcc1c0327d60 EFLAGS: 00000202 ORIG_RAX: ffffffffffffff13
[ 2.869246] RAX: 0000000000000000 RBX: ffffffffb7dcc8d2 RCX: 0000000000000830
[ 2.869246] RDX: 0000000000000001 RSI: 00000000000000fb RDI: 0000000000000830
[ 2.869246] RBP: ffffbcc1c0327db0 R08: 0000000000000001 R09: 0000000000000001
[ 2.869246] R10: ffffbcc1c0327dd8 R11: 00000000000001a9 R12: 0000000000000000
[ 2.869246] R13: ffffffffb7dcc932 R14: 0000000000000000 R15: 0000000000000000
[ 2.869246] ? poke_int3_handler+0xe0/0xe0
[ 2.869246] ? cpumask_next_and+0x19/0x20
[ 2.869246] ? smp_call_function_many+0xa8/0x230
[ 2.869246] ? poke_int3_handler+0xe0/0xe0
[ 2.869246] ? on_each_cpu+0x36/0x70
[ 2.869246] on_each_cpu+0x36/0x70
[ 2.869246] text_poke_bp_batch+0x8b/0x150
[ 2.869246] ? kvm_init_platform+0x16/0x16
[ 2.869246] ? set_debug_rodata+0x11/0x11
[ 2.869246] arch_jump_label_transform_apply+0x2f/0x50
[ 2.869246] static_key_slow_inc_cpuslocked+0x8d/0xa0
[ 2.869246] static_key_slow_inc+0x16/0x20
[ 2.869246] activate_jump_labels+0x1a/0x32
[ 2.869246] do_one_initcall+0x46/0x214
[ 2.869246] kernel_init_freeable+0x1bb/0x278
[ 2.869246] ? rest_init+0xd0/0xd0
[ 2.869246] kernel_init+0xa/0x110
[ 2.869246] ret_from_fork+0x35/0x40
[ 2.869246] Modules linked in:
[ 2.869246] CR2: 0000000000000000
[ 2.870246] BUG: kernel NULL pointer dereference, address: 0000000000000000
[ 2.869246] ---[ end trace 0d81c5e5ac5901cf ]---
To reproduce:
# build kernel
cd linux
cp config-5.2.0-rc4-00079-g0e2bc33 .config
make HOSTCC=gcc-7 CC=gcc-7 ARCH=x86_64 olddefconfig
make HOSTCC=gcc-7 CC=gcc-7 ARCH=x86_64 prepare
make HOSTCC=gcc-7 CC=gcc-7 ARCH=x86_64 modules_prepare
make HOSTCC=gcc-7 CC=gcc-7 ARCH=x86_64 SHELL=/bin/bash
make HOSTCC=gcc-7 CC=gcc-7 ARCH=x86_64 bzImage
git clone
https://github.com/intel/lkp-tests.git
cd lkp-tests
bin/lkp qemu -k <bzImage> job-script # job-script is attached in this email
Thanks,
lkp