kvm on 4.5.0+: trying to register non-static key.

From: Borislav Petkov
Date: Sun Mar 20 2016 - 06:21:30 EST


Hi guys,

I'm seeing this on latest Linus (top commit 1e75a9f34a5e ("Merge
git://www.linux-watchdog.org/linux-watchdog")):

...
[ 14.124256] IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
[ 284.440294] INFO: trying to register non-static key.
[ 284.445259] the code is fine but needs lockdep annotation.
[ 284.450736] turning off the locking correctness validator.
[ 284.456215] CPU: 5 PID: 3843 Comm: qemu-system-x86 Not tainted 4.5.0+ #1
[ 284.462913] Hardware name: To be filled by O.E.M. To be filled by O.E.M./M5A97 EVO R2.0, BIOS 1503 01/16/2013
[ 284.472809] 0000000000000000 ffff8804132a3cb0 ffffffff812f30f3 ffff880427f15f00
[ 284.480261] 0000000000000000 ffff8804132a3d70 ffffffff810adb5a ffff880427f15f00
[ 284.487715] ffffffff81713ca6 0000000000000246 ffff880400000000 ffff880400000000
[ 284.495178] Call Trace:
[ 284.497625] [<ffffffff812f30f3>] dump_stack+0x67/0x94
[ 284.502762] [<ffffffff810adb5a>] __lock_acquire+0x1b8a/0x2150
[ 284.508587] [<ffffffff81713ca6>] ? __mutex_unlock_slowpath+0x106/0x1b0
[ 284.515198] [<ffffffff810abbd2>] ? trace_hardirqs_on_caller+0xf2/0x210
[ 284.521802] [<ffffffff81713c8f>] ? __mutex_unlock_slowpath+0xef/0x1b0
[ 284.528318] [<ffffffff810aecc3>] lock_acquire+0xd3/0x240
[ 284.533733] [<ffffffffa0305aa0>] ? kvm_page_track_register_notifier+0x20/0x60 [kvm]
[ 284.541467] [<ffffffff81715581>] _raw_spin_lock+0x41/0x80
[ 284.546960] [<ffffffffa0305aa0>] ? kvm_page_track_register_notifier+0x20/0x60 [kvm]
[ 284.554707] [<ffffffffa0305aa0>] kvm_page_track_register_notifier+0x20/0x60 [kvm]
[ 284.562281] [<ffffffffa02ece70>] kvm_mmu_init_vm+0x20/0x30 [kvm]
[ 284.568381] [<ffffffffa02dbf7a>] kvm_arch_init_vm+0x1ea/0x200 [kvm]
[ 284.574740] [<ffffffffa02bff3f>] kvm_dev_ioctl+0xbf/0x4d0 [kvm]
[ 284.580743] [<ffffffff811b2dac>] do_vfs_ioctl+0x9c/0x680
[ 284.586132] [<ffffffff811bf109>] ? __fget_light+0x29/0x90
[ 284.591609] [<ffffffff811b33dc>] SyS_ioctl+0x4c/0x90
[ 284.596653] [<ffffffff817164a9>] entry_SYSCALL_64_fastpath+0x1c/0xac
[ 284.603085] [<ffffffff8171645a>] ? entry_SYSCALL_64_after_swapgs+0x17/0x4a
[ 284.610036] [<ffffffff813201f3>] ? __this_cpu_preempt_check+0x13/0x20
[ 285.126012] kvm: zapping shadow pages for mmio generation wraparound
[ 285.136787] kvm: zapping shadow pages for mmio generation wraparound
[ 321.479149] kvm: zapping shadow pages for mmio generation wraparound
[ 321.489990] kvm: zapping shadow pages for mmio generation wraparound
[ 393.824394] kvm: zapping shadow pages for mmio generation wraparound
[ 393.834995] kvm: zapping shadow pages for mmio generation wraparound

>From a quick look, that

spin_lock(&kvm->mmu_lock);

in kvm_page_track_register_notifier() is done on a dynamically allocated
struct kvm * by kvm_arch_alloc_vm()...

--
Regards/Gruss,
Boris.

ECO tip #101: Trim your mails when you reply.