aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/context_tracking.h6
-rw-r--r--include/linux/context_tracking_state.h1
-rw-r--r--include/linux/kvm_host.h3
3 files changed, 9 insertions, 1 deletions
diff --git a/include/linux/context_tracking.h b/include/linux/context_tracking.h
index 7f1810a3b5a4..2821838256b4 100644
--- a/include/linux/context_tracking.h
+++ b/include/linux/context_tracking.h
@@ -81,10 +81,16 @@ static inline void guest_enter(void)
81 vtime_guest_enter(current); 81 vtime_guest_enter(current);
82 else 82 else
83 current->flags |= PF_VCPU; 83 current->flags |= PF_VCPU;
84
85 if (context_tracking_is_enabled())
86 context_tracking_enter(CONTEXT_GUEST);
84} 87}
85 88
86static inline void guest_exit(void) 89static inline void guest_exit(void)
87{ 90{
91 if (context_tracking_is_enabled())
92 context_tracking_exit(CONTEXT_GUEST);
93
88 if (vtime_accounting_enabled()) 94 if (vtime_accounting_enabled())
89 vtime_guest_exit(current); 95 vtime_guest_exit(current);
90 else 96 else
diff --git a/include/linux/context_tracking_state.h b/include/linux/context_tracking_state.h
index ad4458588b47..6b7b96a32b75 100644
--- a/include/linux/context_tracking_state.h
+++ b/include/linux/context_tracking_state.h
@@ -15,6 +15,7 @@ struct context_tracking {
15 enum ctx_state { 15 enum ctx_state {
16 CONTEXT_KERNEL = 0, 16 CONTEXT_KERNEL = 0,
17 CONTEXT_USER, 17 CONTEXT_USER,
18 CONTEXT_GUEST,
18 } state; 19 } state;
19}; 20};
20 21
diff --git a/include/linux/kvm_host.h b/include/linux/kvm_host.h
index d12b2104d19b..cc8c61c5459c 100644
--- a/include/linux/kvm_host.h
+++ b/include/linux/kvm_host.h
@@ -766,7 +766,8 @@ static inline void kvm_guest_enter(void)
766 * one time slice). Lets treat guest mode as quiescent state, just like 766 * one time slice). Lets treat guest mode as quiescent state, just like
767 * we do with user-mode execution. 767 * we do with user-mode execution.
768 */ 768 */
769 rcu_virt_note_context_switch(smp_processor_id()); 769 if (!context_tracking_cpu_is_enabled())
770 rcu_virt_note_context_switch(smp_processor_id());
770} 771}
771 772
772static inline void kvm_guest_exit(void) 773static inline void kvm_guest_exit(void)