|
@@ -762,16 +762,10 @@ static inline void kvm_iommu_unmap_pages(struct kvm *kvm,
|
|
}
|
|
}
|
|
#endif
|
|
#endif
|
|
|
|
|
|
-static inline void kvm_guest_enter(void)
|
|
|
|
|
|
+/* must be called with irqs disabled */
|
|
|
|
+static inline void __kvm_guest_enter(void)
|
|
{
|
|
{
|
|
- unsigned long flags;
|
|
|
|
-
|
|
|
|
- BUG_ON(preemptible());
|
|
|
|
-
|
|
|
|
- local_irq_save(flags);
|
|
|
|
guest_enter();
|
|
guest_enter();
|
|
- local_irq_restore(flags);
|
|
|
|
-
|
|
|
|
/* KVM does not hold any references to rcu protected data when it
|
|
/* 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
|
|
* 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
|
|
* is very similar to exiting to userspace from rcu point of view. In
|
|
@@ -783,12 +777,27 @@ static inline void kvm_guest_enter(void)
|
|
rcu_virt_note_context_switch(smp_processor_id());
|
|
rcu_virt_note_context_switch(smp_processor_id());
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/* must be called with irqs disabled */
|
|
|
|
+static inline void __kvm_guest_exit(void)
|
|
|
|
+{
|
|
|
|
+ guest_exit();
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+static inline void kvm_guest_enter(void)
|
|
|
|
+{
|
|
|
|
+ unsigned long flags;
|
|
|
|
+
|
|
|
|
+ local_irq_save(flags);
|
|
|
|
+ __kvm_guest_enter();
|
|
|
|
+ local_irq_restore(flags);
|
|
|
|
+}
|
|
|
|
+
|
|
static inline void kvm_guest_exit(void)
|
|
static inline void kvm_guest_exit(void)
|
|
{
|
|
{
|
|
unsigned long flags;
|
|
unsigned long flags;
|
|
|
|
|
|
local_irq_save(flags);
|
|
local_irq_save(flags);
|
|
- guest_exit();
|
|
|
|
|
|
+ __kvm_guest_exit();
|
|
local_irq_restore(flags);
|
|
local_irq_restore(flags);
|
|
}
|
|
}
|
|
|
|
|