From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754991AbbLJSP1 (ORCPT ); Thu, 10 Dec 2015 13:15:27 -0500 Received: from mx1.redhat.com ([209.132.183.28]:57029 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752432AbbLJSP0 (ORCPT ); Thu, 10 Dec 2015 13:15:26 -0500 Subject: Re: [PATCH] kvm: x86: move tracepoints outside extended quiescent state To: Borislav Petkov References: <1449769137-8668-1-git-send-email-pbonzini@redhat.com> <20151210180945.GB3831@pd.tnic> Cc: linux-kernel@vger.kernel.org, kvm@vger.kernel.org, stable@vger.kernel.org From: Paolo Bonzini Message-ID: <5669C137.7080601@redhat.com> Date: Thu, 10 Dec 2015 19:15:19 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.3.0 MIME-Version: 1.0 In-Reply-To: <20151210180945.GB3831@pd.tnic> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 10/12/2015 19:09, Borislav Petkov wrote: > On Thu, Dec 10, 2015 at 06:38:57PM +0100, Paolo Bonzini wrote: >> Invoking tracepoints within kvm_guest_enter/kvm_guest_exit causes a >> lockdep splat. >> >> Cc: stable@vger.kernel.org >> Reported-by: Borislav Petkov >> Signed-off-by: Paolo Bonzini >> --- >> arch/x86/kvm/svm.c | 4 ++-- >> arch/x86/kvm/vmx.c | 3 ++- >> arch/x86/kvm/x86.c | 2 +- >> 3 files changed, 5 insertions(+), 4 deletions(-) > > Looks like you missed some... Yeah, wait_lapic_expire also have to be moved before __kvm_guest_enter. Paolo > [ 144.296364] kvm: zapping shadow pages for mmio generation wraparound > [ 164.699053] kvm: zapping shadow pages for mmio generation wraparound > [ 312.115767] kvm: zapping shadow pages for mmio generation wraparound > [ 432.277585] kvm: zapping shadow pages for mmio generation wraparound > > [ 434.547820] =============================== > [ 434.552020] [ INFO: suspicious RCU usage. ] > [ 434.556223] 4.4.0-rc4+ #1 Not tainted > [ 434.559886] ------------------------------- > [ 434.564072] arch/x86/kvm/trace.h:971 suspicious rcu_dereference_check() usage! > [ 434.571303] > other info that might help us debug this: > > [ 434.579324] > RCU used illegally from idle CPU! > rcu_scheduler_active = 1, debug_locks = 0 > [ 434.590209] RCU used illegally from extended quiescent state! > [ 434.595971] 1 lock held by qemu-system-x86/2402: > [ 434.600596] #0: (&vcpu->mutex){+.+.+.}, at: [] vcpu_load+0x1c/0x80 [kvm] > [ 434.609146] > stack backtrace: > [ 434.613526] CPU: 4 PID: 2402 Comm: qemu-system-x86 Not tainted 4.4.0-rc4+ #1 > [ 434.620583] Hardware name: Dell Inc. Precision T3600/0PTTT9, BIOS A13 05/11/2014 > [ 434.627987] 0000000000000001 ffff88042f79fcf0 ffffffff813c2cfc ffff880435aa0000 > [ 434.635443] ffff88042f79fd20 ffffffff810c5157 ffff88042fd48000 0000000295a85563 > [ 434.642886] 0000000295de483f 0000000000000000 ffff88042f79fd58 ffffffffa023ec6e > [ 434.650334] Call Trace: > [ 434.652804] [] dump_stack+0x4e/0x82 > [ 434.657950] [] lockdep_rcu_suspicious+0xe7/0x120 > [ 434.664239] [] wait_lapic_expire+0xfe/0x1e0 [kvm] > [ 434.670606] [] kvm_arch_vcpu_ioctl_run+0x76e/0x19c0 [kvm] > [ 434.677674] [] ? kvm_arch_vcpu_ioctl_run+0x8b2/0x19c0 [kvm] > [ 434.684905] [] ? mutex_lock_killable_nested+0x29c/0x4c0 > [ 434.691792] [] kvm_vcpu_ioctl+0x342/0x700 [kvm] > [ 434.697984] [] ? __lock_is_held+0x4d/0x70 > [ 434.703655] [] ? __fget+0xfe/0x200 > [ 434.708719] [] do_vfs_ioctl+0x301/0x550 > [ 434.714208] [] ? __fget_light+0x2a/0x90 > [ 434.719700] [] SyS_ioctl+0x41/0x70 > [ 434.724754] [] entry_SYSCALL_64_fastpath+0x16/0x7a > [ 437.411818] kvm [2400]: vcpu0 unhandled rdmsr: 0x606 > [ 437.416898] kvm [2400]: vcpu0 unhandled rdmsr: 0x34 > >