On 14/06/2018 01:31, Junaid Shahid wrote: > On 06/13/2018 04:28 AM, Paolo Bonzini wrote: >> >> What needs kvm->srcu here? >> > > That is needed because of the call to kvm_arch_vcpu_runnable(). That > function may call vmx_check_nested_events(), which can call > nested_vmx_vmexit(). That in turn would eventually call > fast_cr3_switch(), which needs the kvm->srcu in order to verify (via > mmu_check_root) that the new CR3 belongs to a valid memslot. > Hmm that's not very intuitive, and it should already need SRCU for nested_mark_vmcs12_pages_dirty (called by vmx_complete_nested_posted_interrupt) actually. vmx_check_nested_events() is called via kvm_vcpu_running, but really all the conditions that are checked by vmx_check_nested_events would also be checked by kvm_vcpu_has_events (well, except for vmx->nested.preemption_timer_expired), so perhaps we can spare it. I'll take a look. Paolo