Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 69142
b: refs/heads/master
c: d172fcd
h: refs/heads/master
v: v3
  • Loading branch information
Laurent Vivier authored and Ingo Molnar committed Oct 15, 2007
1 parent 72dd06c commit faea9a6
Show file tree
Hide file tree
Showing 3 changed files with 13 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: 94886b84b1bcdc95f34f70e7fce407efefe472e1
refs/heads/master: d172fcd3ae1ca7ac27ec8904242fd61e0e11d332
10 changes: 10 additions & 0 deletions trunk/drivers/kvm/kvm.h
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,16 @@ void kvm_mmu_unload(struct kvm_vcpu *vcpu);

int kvm_hypercall(struct kvm_vcpu *vcpu, struct kvm_run *run);

static inline void kvm_guest_enter(void)
{
current->flags |= PF_VCPU;
}

static inline void kvm_guest_exit(void)
{
current->flags &= ~PF_VCPU;
}

static inline int kvm_mmu_page_fault(struct kvm_vcpu *vcpu, gva_t gva,
u32 error_code)
{
Expand Down
2 changes: 2 additions & 0 deletions trunk/drivers/kvm/kvm_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -2046,13 +2046,15 @@ static int __vcpu_run(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run)
kvm_x86_ops->inject_pending_vectors(vcpu, kvm_run);

vcpu->guest_mode = 1;
kvm_guest_enter();

if (vcpu->requests)
if (test_and_clear_bit(KVM_TLB_FLUSH, &vcpu->requests))
kvm_x86_ops->tlb_flush(vcpu);

kvm_x86_ops->run(vcpu, kvm_run);

kvm_guest_exit();
vcpu->guest_mode = 0;
local_irq_enable();

Expand Down

0 comments on commit faea9a6

Please sign in to comment.