Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 343530
b: refs/heads/master
c: 78c0337
h: refs/heads/master
v: v3
  • Loading branch information
Marcelo Tosatti committed Nov 28, 2012
1 parent a893c84 commit 8763ea3
Show file tree
Hide file tree
Showing 2 changed files with 14 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: 807f12e57c9783458b8c07f63eff3c3e1df8ab5d
refs/heads/master: 78c0337a38450f809113dd46fe038874b93909f1
20 changes: 13 additions & 7 deletions trunk/arch/x86/kvm/x86.c
Original file line number Diff line number Diff line change
Expand Up @@ -1145,6 +1145,7 @@ static int kvm_guest_time_update(struct kvm_vcpu *v)
unsigned long this_tsc_khz;
s64 kernel_ns, max_kernel_ns;
u64 tsc_timestamp;
struct pvclock_vcpu_time_info *guest_hv_clock;
u8 pvclock_flags;

/* Keep irq disabled to prevent changes to the clock */
Expand Down Expand Up @@ -1228,13 +1229,6 @@ static int kvm_guest_time_update(struct kvm_vcpu *v)
vcpu->last_kernel_ns = kernel_ns;
vcpu->last_guest_tsc = tsc_timestamp;

pvclock_flags = 0;
if (vcpu->pvclock_set_guest_stopped_request) {
pvclock_flags |= PVCLOCK_GUEST_STOPPED;
vcpu->pvclock_set_guest_stopped_request = false;
}

vcpu->hv_clock.flags = pvclock_flags;

/*
* The interface expects us to write an even number signaling that the
Expand All @@ -1245,6 +1239,18 @@ static int kvm_guest_time_update(struct kvm_vcpu *v)

shared_kaddr = kmap_atomic(vcpu->time_page);

guest_hv_clock = shared_kaddr + vcpu->time_offset;

/* retain PVCLOCK_GUEST_STOPPED if set in guest copy */
pvclock_flags = (guest_hv_clock->flags & PVCLOCK_GUEST_STOPPED);

if (vcpu->pvclock_set_guest_stopped_request) {
pvclock_flags |= PVCLOCK_GUEST_STOPPED;
vcpu->pvclock_set_guest_stopped_request = false;
}

vcpu->hv_clock.flags = pvclock_flags;

memcpy(shared_kaddr + vcpu->time_offset, &vcpu->hv_clock,
sizeof(vcpu->hv_clock));

Expand Down

0 comments on commit 8763ea3

Please sign in to comment.