Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 93825
b: refs/heads/master
c: 9f81128
h: refs/heads/master
i:
  93823: b18bb34
v: v3
  • Loading branch information
Avi Kivity committed Apr 27, 2008
1 parent 8b4d735 commit 50aaa86
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0cf1bfd2737f41e59f974a61eab11af206d2042a
refs/heads/master: 9f81128591ca1e9907f2e7a7b195e33232167d60
21 changes: 14 additions & 7 deletions trunk/arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -1840,22 +1840,29 @@ static int emulator_read_emulated(unsigned long addr,
return X86EMUL_UNHANDLEABLE;
}

static int emulator_write_phys(struct kvm_vcpu *vcpu, gpa_t gpa,
const void *val, int bytes)
int __emulator_write_phys(struct kvm_vcpu *vcpu, gpa_t gpa,
const void *val, int bytes)
{
int ret;

down_read(&vcpu->kvm->slots_lock);
ret = kvm_write_guest(vcpu->kvm, gpa, val, bytes);
if (ret < 0) {
up_read(&vcpu->kvm->slots_lock);
if (ret < 0)
return 0;
}
kvm_mmu_pte_write(vcpu, gpa, val, bytes);
up_read(&vcpu->kvm->slots_lock);
return 1;
}

static int emulator_write_phys(struct kvm_vcpu *vcpu, gpa_t gpa,
const void *val, int bytes)
{
int ret;

down_read(&vcpu->kvm->slots_lock);
ret =__emulator_write_phys(vcpu, gpa, val, bytes);
up_read(&vcpu->kvm->slots_lock);
return ret;
}

static int emulator_write_emulated_onepage(unsigned long addr,
const void *val,
unsigned int bytes,
Expand Down
3 changes: 3 additions & 0 deletions trunk/include/asm-x86/kvm_host.h
Original file line number Diff line number Diff line change
Expand Up @@ -432,6 +432,9 @@ void kvm_mmu_change_mmu_pages(struct kvm *kvm, unsigned int kvm_nr_mmu_pages);

int load_pdptrs(struct kvm_vcpu *vcpu, unsigned long cr3);

int __emulator_write_phys(struct kvm_vcpu *vcpu, gpa_t gpa,
const void *val, int bytes);

enum emulation_result {
EMULATE_DONE, /* no further processing */
EMULATE_DO_MMIO, /* kvm_run filled with mmio request */
Expand Down

0 comments on commit 50aaa86

Please sign in to comment.