From 75080957abf08778ec03a9ee5a3251eca7b89859 Mon Sep 17 00:00:00 2001 From: Gleb Natapov Date: Wed, 4 May 2011 16:31:04 +0300 Subject: [PATCH] --- yaml --- r: 248108 b: refs/heads/master c: 8fa2206821953a50a3a02ea33fcfb3ced2fd9997 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/kvm_host.h | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index bb25cfac9a76..b4aa8eade4aa 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: e3aa52d665ec1a962d1cf025a2e5ee84b3b33406 +refs/heads/master: 8fa2206821953a50a3a02ea33fcfb3ced2fd9997 diff --git a/trunk/include/linux/kvm_host.h b/trunk/include/linux/kvm_host.h index 0bc3d372e3cb..b9c3299c6a55 100644 --- a/trunk/include/linux/kvm_host.h +++ b/trunk/include/linux/kvm_host.h @@ -591,8 +591,17 @@ static inline int kvm_deassign_device(struct kvm *kvm, static inline void kvm_guest_enter(void) { + BUG_ON(preemptible()); account_system_vtime(current); current->flags |= PF_VCPU; + /* KVM does not hold any references to rcu protected data when it + * switches CPU into a guest mode. In fact switching to a guest mode + * is very similar to exiting to userspase from rcu point of view. In + * addition CPU may stay in a guest mode for quite a long time (up to + * one time slice). Lets treat guest mode as quiescent state, just like + * we do with user-mode execution. + */ + rcu_virt_note_context_switch(smp_processor_id()); } static inline void kvm_guest_exit(void)