linux/arch/ia64/kvm
Lai Jiangshan 90d83dc3d4 KVM: use the correct RCU API for PROVE_RCU=y
The RCU/SRCU API have already changed for proving RCU usage.

I got the following dmesg when PROVE_RCU=y because we used incorrect API.
This patch coverts rcu_deference() to srcu_dereference() or family API.

===================================================
[ INFO: suspicious rcu_dereference_check() usage. ]
---------------------------------------------------
arch/x86/kvm/mmu.c:3020 invoked rcu_dereference_check() without protection!

other info that might help us debug this:

rcu_scheduler_active = 1, debug_locks = 0
2 locks held by qemu-system-x86/8550:
 #0:  (&kvm->slots_lock){+.+.+.}, at: [<ffffffffa011a6ac>] kvm_set_memory_region+0x29/0x50 [kvm]
 #1:  (&(&kvm->mmu_lock)->rlock){+.+...}, at: [<ffffffffa012262d>] kvm_arch_commit_memory_region+0xa6/0xe2 [kvm]

stack backtrace:
Pid: 8550, comm: qemu-system-x86 Not tainted 2.6.34-rc4-tip-01028-g939eab1 #27
Call Trace:
 [<ffffffff8106c59e>] lockdep_rcu_dereference+0xaa/0xb3
 [<ffffffffa012f6c1>] kvm_mmu_calculate_mmu_pages+0x44/0x7d [kvm]
 [<ffffffffa012263e>] kvm_arch_commit_memory_region+0xb7/0xe2 [kvm]
 [<ffffffffa011a5d7>] __kvm_set_memory_region+0x636/0x6e2 [kvm]
 [<ffffffffa011a6ba>] kvm_set_memory_region+0x37/0x50 [kvm]
 [<ffffffffa015e956>] vmx_set_tss_addr+0x46/0x5a [kvm_intel]
 [<ffffffffa0126592>] kvm_arch_vm_ioctl+0x17a/0xcf8 [kvm]
 [<ffffffff810a8692>] ? unlock_page+0x27/0x2c
 [<ffffffff810bf879>] ? __do_fault+0x3a9/0x3e1
 [<ffffffffa011b12f>] kvm_vm_ioctl+0x364/0x38d [kvm]
 [<ffffffff81060cfa>] ? up_read+0x23/0x3d
 [<ffffffff810f3587>] vfs_ioctl+0x32/0xa6
 [<ffffffff810f3b19>] do_vfs_ioctl+0x495/0x4db
 [<ffffffff810e6b2f>] ? fget_light+0xc2/0x241
 [<ffffffff810e416c>] ? do_sys_open+0x104/0x116
 [<ffffffff81382d6d>] ? retint_swapgs+0xe/0x13
 [<ffffffff810f3ba6>] sys_ioctl+0x47/0x6a
 [<ffffffff810021db>] system_call_fastpath+0x16/0x1b

Signed-off-by: Lai Jiangshan <laijs@cn.fujitsu.com>
Signed-off-by: Avi Kivity <avi@redhat.com>
2010-05-17 12:18:01 +03:00
..
asm-offsets.c drop explicit include of autoconf.h 2009-12-12 13:08:15 +01:00
irq.h KVM: ia64: Fix the build errors due to lack of macros related to MSI. 2009-03-24 11:03:13 +02:00
Kconfig Merge branch 'kvm-updates/2.6.34' of git://git.kernel.org/pub/scm/virt/kvm/kvm 2010-03-05 13:12:34 -08:00
kvm_fw.c KVM: ia64: remove redundant kvm_get_exit_data() NULL tests 2010-03-01 12:35:52 -03:00
kvm_lib.c KVM: ia64: fix ia64 build due to missing kallsyms_lookup() and double export 2009-06-28 14:10:30 +03:00
kvm_minstate.h KVM: ia64: Re-organize data sturure of guests' data area 2008-12-31 16:51:49 +02:00
kvm-ia64.c KVM: use the correct RCU API for PROVE_RCU=y 2010-05-17 12:18:01 +03:00
lapic.h KVM: APIC: get rid of deliver_bitmask 2009-06-10 11:48:27 +03:00
Makefile KVM: Move assigned device code to own file 2009-12-03 09:32:09 +02:00
memcpy.S KVM: ia64: fix GVMM module including position-dependent objects 2008-05-18 14:34:16 +03:00
memset.S KVM: ia64: fix GVMM module including position-dependent objects 2008-05-18 14:34:16 +03:00
misc.h KVM: ia64: Re-organize data sturure of guests' data area 2008-12-31 16:51:49 +02:00
mmio.c KVM: ia64: Fix string literal continuation lines 2010-03-01 12:36:07 -03:00
optvfault.S KVM: ia64: Drop in SN2 replacement of fast path ITC emulation fault handler 2009-06-10 11:48:29 +03:00
process.c [IA64] Remove unnecessary semicolons 2009-06-30 14:18:32 -07:00
trampoline.S KVM: ia64: Add trampoline for guest/host mode switch 2008-04-27 12:01:08 +03:00
vcpu.c KVM: ia64: Fix string literal continuation lines 2010-03-01 12:36:07 -03:00
vcpu.h KVM: ia64: fix build breakage due to host spinlock change 2009-12-27 13:36:33 -02:00
vmm_ivt.S KVM: ia64: enable external interrupt in vmm 2009-06-10 11:48:34 +03:00
vmm.c KVM: ia64: fix build breakage due to host spinlock change 2009-12-27 13:36:33 -02:00
vti.h KVM: ia64: Add header files for kvm/ia64 2008-04-27 12:01:03 +03:00
vtlb.c KVM: ia64: fix build breakage due to host spinlock change 2009-12-27 13:36:33 -02:00