|
@@ -737,7 +737,11 @@ static inline int kvm_deassign_device(struct kvm *kvm,
|
|
|
static inline void kvm_guest_enter(void)
|
|
|
{
|
|
|
BUG_ON(preemptible());
|
|
|
- vtime_account(current);
|
|
|
+ /*
|
|
|
+ * This is running in ioctl context so we can avoid
|
|
|
+ * the call to vtime_account() with its unnecessary idle check.
|
|
|
+ */
|
|
|
+ vtime_account_system(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
|
|
@@ -751,7 +755,11 @@ static inline void kvm_guest_enter(void)
|
|
|
|
|
|
static inline void kvm_guest_exit(void)
|
|
|
{
|
|
|
- vtime_account(current);
|
|
|
+ /*
|
|
|
+ * This is running in ioctl context so we can avoid
|
|
|
+ * the call to vtime_account() with its unnecessary idle check.
|
|
|
+ */
|
|
|
+ vtime_account_system(current);
|
|
|
current->flags &= ~PF_VCPU;
|
|
|
}
|
|
|
|