summaryrefslogtreecommitdiff
path: root/include/linux/kvm_host.h
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2016-06-15 15:09:28 +0200
committerPaolo Bonzini <pbonzini@redhat.com>2016-06-28 14:15:25 +0200
commitebaac1736245e78109cd47d453a86a18dcfc94b8 (patch)
treea3c5e049e0ee9345316f538ccc1acc19b0edbfe1 /include/linux/kvm_host.h
parentfb6cec1492d6a693d33224487061e92d0275c6e2 (diff)
context_tracking: move rcu_virt_note_context_switch out of kvm_host.h
Make kvm_guest_{enter,exit} and __kvm_guest_{enter,exit} trivial wrappers around the code in context_tracking.h. Name the context_tracking.h functions consistently with what those for kernel<->user switch. Cc: Andy Lutomirski <luto@kernel.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: H. Peter Anvin <hpa@zytor.com> Cc: Ingo Molnar <mingo@kernel.org> Cc: Thomas Gleixner <tglx@linutronix.de> Reviewed-by: Rik van Riel <riel@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'include/linux/kvm_host.h')
-rw-r--r--include/linux/kvm_host.h25
1 files changed, 4 insertions, 21 deletions
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index 0640ee92b978..ffff40522688 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -878,40 +878,23 @@ static inline void kvm_iommu_unmap_pages(struct kvm *kvm,
/* must be called with irqs disabled */
static inline void __kvm_guest_enter(void)
{
- guest_enter();
- /* 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 userspace 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.
- */
- if (!context_tracking_cpu_is_enabled())
- rcu_virt_note_context_switch(smp_processor_id());
+ guest_enter_irqoff();
}
/* must be called with irqs disabled */
static inline void __kvm_guest_exit(void)
{
- guest_exit();
+ guest_exit_irqoff();
}
static inline void kvm_guest_enter(void)
{
- unsigned long flags;
-
- local_irq_save(flags);
- __kvm_guest_enter();
- local_irq_restore(flags);
+ guest_enter();
}
static inline void kvm_guest_exit(void)
{
- unsigned long flags;
-
- local_irq_save(flags);
- __kvm_guest_exit();
- local_irq_restore(flags);
+ guest_exit();
}
/*