diff options
author | Bryan Cantrill <bryan@joyent.com> | 2011-05-05 17:44:49 -0700 |
---|---|---|
committer | Bryan Cantrill <bryan@joyent.com> | 2011-05-05 17:44:49 -0700 |
commit | 7b892c19bc544af610d126d1d25b218220ac396e (patch) | |
tree | 1ad740ba132fcfd9ba03205707f620ff6b0cf778 /kvm_x86.c | |
parent | d02410213c9a8a8f5e8d6dbad72aacffbe70dad7 (diff) | |
download | illumos-kvm-7b892c19bc544af610d126d1d25b218220ac396e.tar.gz |
HVM-164 apic_get_tmcct() confuses remaining with elapsed
Diffstat (limited to 'kvm_x86.c')
-rw-r--r-- | kvm_x86.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -641,7 +641,7 @@ apic_x2apic_mode(struct kvm_lapic *apic) static uint32_t apic_get_tmcct(struct kvm_lapic *apic) { - hrtime_t now, remaining; + hrtime_t now, remaining, elapsed; uint32_t tmcct; VERIFY(apic != NULL); @@ -651,8 +651,9 @@ apic_get_tmcct(struct kvm_lapic *apic) return (0); now = gethrtime(); - remaining = now - apic->lapic_timer.start - + elapsed = now - apic->lapic_timer.start - apic->lapic_timer.period * apic->lapic_timer.intervals; + remaining = apic->lapic_timer.period - elapsed; if (remaining < 0) remaining = 0; |