From mboxrd@z Thu Jan 1 00:00:00 1970 From: Radim =?utf-8?B?S3LEjW3DocWZ?= Subject: Re: [PATCH] KVM: fix rcu warning on VM_CREATE errors Date: Wed, 13 Sep 2017 17:40:06 +0200 Message-ID: <20170913154005.GG2673@flask> References: <20170913121722.108625-1-borntraeger@de.ibm.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Paolo Bonzini , KVM , Stefan Haberland To: Christian Borntraeger Return-path: Received: from mx1.redhat.com ([209.132.183.28]:37756 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751062AbdIMPkL (ORCPT ); Wed, 13 Sep 2017 11:40:11 -0400 Content-Disposition: inline In-Reply-To: <20170913121722.108625-1-borntraeger@de.ibm.com> Sender: kvm-owner@vger.kernel.org List-ID: 2017-09-13 14:17+0200, Christian Borntraeger: > commit 3898da947bba ("KVM: avoid using rcu_dereference_protected") can > trigger the following lockdep/rcu splat if the VM_CREATE ioctl fails, > for example if kvm_arch_init_vm fails: > > WARNING: suspicious RCU usage > 4.13.0+ #105 Not tainted > ----------------------------- > ./include/linux/kvm_host.h:481 suspicious rcu_dereference_check() usage! > > other info that might help us debug this: > > rcu_scheduler_active = 2, debug_locks = 1 > no locks held by qemu-system-s39/79. > stack backtrace: > CPU: 0 PID: 79 Comm: qemu-system-s39 Not tainted 4.13.0+ #105 > Hardware name: IBM 2964 NC9 704 (KVM/Linux) > Call Trace: > ([<00000000001140b2>] show_stack+0xea/0xf0) > [<00000000008a68a4>] dump_stack+0x94/0xd8 > [<0000000000134c12>] kvm_dev_ioctl+0x372/0x7a0 > [<000000000038f940>] do_vfs_ioctl+0xa8/0x6c8 > [<0000000000390004>] SyS_ioctl+0xa4/0xb8 > [<00000000008c7a8c>] system_call+0xc4/0x27c > no locks held by qemu-system-s39/79. > > We have to reset the just created users_count back to 0 to > tell the check to not trigger. > > Reported-by: Stefan Haberland > Signed-off-by: Christian Borntraeger > Fixes: 3898da947bba ("KVM: avoid using rcu_dereference_protected") > Cc: Paolo Bonzini > --- Applied, thanks.