From mboxrd@z Thu Jan 1 00:00:00 1970 From: Marcelo Tosatti Subject: Re: [PATCH v2] KVM: Fix IOMMU RCU related warning Date: Thu, 1 Jul 2010 13:16:22 -0300 Message-ID: <20100701161622.GE23469@amt.cnet> References: <1277967650-16299-1-git-send-email-sheng@linux.intel.com> <1278000713-18752-1-git-send-email-sheng@linux.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Avi Kivity , kvm@vger.kernel.org To: Sheng Yang Return-path: Received: from mx1.redhat.com ([209.132.183.28]:40492 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752567Ab0GAQRi (ORCPT ); Thu, 1 Jul 2010 12:17:38 -0400 Content-Disposition: inline In-Reply-To: <1278000713-18752-1-git-send-email-sheng@linux.intel.com> Sender: kvm-owner@vger.kernel.org List-ID: On Fri, Jul 02, 2010 at 12:11:53AM +0800, Sheng Yang wrote: > This patch fixes the following warning. > > =================================================== > [ INFO: suspicious rcu_dereference_check() usage. ] > --------------------------------------------------- > include/linux/kvm_host.h:259 invoked rcu_dereference_check() without > protection! > > other info that might help us debug this: > > rcu_scheduler_active = 1, debug_locks = 0 > no locks held by qemu-system-x86/29679. > > stack backtrace: > Pid: 29679, comm: qemu-system-x86 Not tainted 2.6.35-rc3+ #200 > Call Trace: > [] lockdep_rcu_dereference+0xa8/0xb1 > [] kvm_iommu_unmap_memslots+0xc9/0xde [kvm] > [] kvm_iommu_unmap_guest+0x40/0x4e [kvm] > [] kvm_arch_destroy_vm+0x1a/0x186 [kvm] > [] kvm_put_kvm+0x110/0x167 [kvm] > [] kvm_vcpu_release+0x18/0x1c [kvm] > [] fput+0x22a/0x3a0 > [] filp_close+0xb4/0xcd > [] put_files_struct+0x1b7/0x36b > [] ? put_files_struct+0x48/0x36b > [] ? do_raw_spin_unlock+0x118/0x160 > [] exit_files+0x6d/0x75 > [] do_exit+0x47d/0xc60 > [] ? _raw_spin_unlock_irq+0x30/0x36 > [] do_group_exit+0xcf/0x134 > [] get_signal_to_deliver+0x732/0x81d > [] ? cpu_clock+0x4e/0x60 > [] do_notify_resume+0x117/0xc43 > [] ? trace_hardirqs_on+0xd/0xf > [] ? sys_rt_sigtimedwait+0x2b5/0x3bf > [] ? trace_hardirqs_off_thunk+0x3a/0x3c > [] ? sysret_signal+0x5/0x3d > [] int_signal+0x12/0x17 > > Signed-off-by: Sheng Yang > --- > I just realized the first version of patch unnecessarily covered > kvm_iommu_map_memslots(), because that part had already been > covered by kvm_vm_ioctl_assign_device() definitely(though unpaired > callings seems a little strange...). Since nesting srcu_read_lock is OK, its fine to have it in kvm_iommu_map_memslots, even if unnecessary.