Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 372984
b: refs/heads/master
c: 3a08a8f
h: refs/heads/master
v: v3
  • Loading branch information
Raghavendra K T authored and Gleb Natapov committed Mar 11, 2013
1 parent 96852f8 commit ee1dc1b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 5da596078f915a62e39a20e582308eab91b88c9a
refs/heads/master: 3a08a8f9f0936e182d387afd85fdc5d303381521
1 change: 1 addition & 0 deletions trunk/include/linux/kvm_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -253,6 +253,7 @@ struct kvm_vcpu {
bool dy_eligible;
} spin_loop;
#endif
bool preempted;
struct kvm_vcpu_arch arch;
};

Expand Down
5 changes: 5 additions & 0 deletions trunk/virt/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,6 +244,7 @@ int kvm_vcpu_init(struct kvm_vcpu *vcpu, struct kvm *kvm, unsigned id)

kvm_vcpu_set_in_spin_loop(vcpu, false);
kvm_vcpu_set_dy_eligible(vcpu, false);
vcpu->preempted = false;

r = kvm_arch_vcpu_init(vcpu);
if (r < 0)
Expand Down Expand Up @@ -2880,6 +2881,8 @@ struct kvm_vcpu *preempt_notifier_to_vcpu(struct preempt_notifier *pn)
static void kvm_sched_in(struct preempt_notifier *pn, int cpu)
{
struct kvm_vcpu *vcpu = preempt_notifier_to_vcpu(pn);
if (vcpu->preempted)
vcpu->preempted = false;

kvm_arch_vcpu_load(vcpu, cpu);
}
Expand All @@ -2889,6 +2892,8 @@ static void kvm_sched_out(struct preempt_notifier *pn,
{
struct kvm_vcpu *vcpu = preempt_notifier_to_vcpu(pn);

if (current->state == TASK_RUNNING)
vcpu->preempted = true;
kvm_arch_vcpu_put(vcpu);
}

Expand Down

0 comments on commit ee1dc1b

Please sign in to comment.