xen/22174-x86-pmtimer-accuracy.patch
Charles Arnold 08a77ed8c4 - fate#310510 - fix xenpaging
xenpaging.tools_xenpaging_cleanup.patch

- fate#310510 - fix xenpaging
  xenpaging.mem_event_check_ring-free_requests.patch

- install /etc/xen/examples/xentrace_formats.txt to get human readable
  tracedata if xenalyze is not used

- fate#310510 - fix xenpaging
  xenpaging.autostart_delay.patch
  xenpaging.blacklist.patch
  xenpaging.MRU_SIZE.patch
  remove xenpaging.hacks.patch, realmode works

- Upstream patches from Jan including fixes for the following bugs
  bnc#583568 - Xen kernel is not booting
  bnc#615206 - Xen kernel fails to boot with IO-APIC problem
  bnc#640773 - Xen kernel crashing right after grub
  bnc#643477 - issues with PCI hotplug/hotunplug to Xen driver domain
  22223-vtd-igd-workaround.patch
  22222-x86-timer-extint.patch
  22214-x86-msr-misc-enable.patch
  22213-x86-xsave-cpuid-check.patch
  22194-tmem-check-pv-mfn.patch
  22177-i386-irq-safe-map_domain_page.patch
  22175-x86-irq-enter-exit.patch
  22174-x86-pmtimer-accuracy.patch
  22160-Intel-C6-EOI.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=76
2010-10-20 21:00:35 +00:00

69 lines
2.6 KiB
Diff

# HG changeset patch
# User Keir Fraser <keir.fraser@citrix.com>
# Date 1284739161 -3600
# Node ID 632c02167f97bb2bd25571b2780425b9b75949b4
# Parent 1b05090854ba83576aa8399fa70e481f5b602417
hvm pmtimer: correct pmtimer accuracy
Several seconds of backward time drift per minute can be seen on a
RHEL6 HVM guest by switching the clocksource to 'acpi_pm' and then
running gettimeofday() in a loop. This is due to the accumulation
of small inaccuracies that are caused by shifting out the lower 32
bits when pmt_update_time() computes 'tmr_val'.
The patch makes sure that the lower 32 bits of the computed value
are not lost. They are saved in a new field 'not_accounted' in the
PMTState structure and are accounted the next time pmt_update_time()
is called.
From: Ulrich Obergfell <uobergfe@redhat.com>
Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
--- a/xen/arch/x86/hvm/pmtimer.c
+++ b/xen/arch/x86/hvm/pmtimer.c
@@ -83,14 +83,16 @@ void hvm_acpi_sleep_button(struct domain
* since the last time we did that. */
static void pmt_update_time(PMTState *s)
{
- uint64_t curr_gtime;
+ uint64_t curr_gtime, tmp;
uint32_t msb = s->pm.tmr_val & TMR_VAL_MSB;
ASSERT(spin_is_locked(&s->lock));
/* Update the timer */
curr_gtime = hvm_get_guest_time(s->vcpu);
- s->pm.tmr_val += ((curr_gtime - s->last_gtime) * s->scale) >> 32;
+ tmp = ((curr_gtime - s->last_gtime) * s->scale) + s->not_accounted;
+ s->not_accounted = (uint32_t)tmp;
+ s->pm.tmr_val += tmp >> 32;
s->pm.tmr_val &= TMR_VAL_MASK;
s->last_gtime = curr_gtime;
@@ -257,6 +259,7 @@ static int pmtimer_load(struct domain *d
/* Calculate future counter values from now. */
s->last_gtime = hvm_get_guest_time(s->vcpu);
+ s->not_accounted = 0;
/* Set the SCI state from the registers */
pmt_update_sci(s);
@@ -276,6 +279,7 @@ void pmtimer_init(struct vcpu *v)
spin_lock_init(&s->lock);
s->scale = ((uint64_t)FREQUENCE_PMTIMER << 32) / SYSTEM_TIME_HZ;
+ s->not_accounted = 0;
s->vcpu = v;
/* Intercept port I/O (need two handlers because PM1a_CNT is between
--- a/xen/include/asm-x86/hvm/vpt.h
+++ b/xen/include/asm-x86/hvm/vpt.h
@@ -117,6 +117,7 @@ typedef struct PMTState {
struct hvm_hw_pmtimer pm; /* 32bit timer value */
struct vcpu *vcpu; /* Keeps sync with this vcpu's guest-time */
uint64_t last_gtime; /* Last (guest) time we updated the timer */
+ uint32_t not_accounted; /* time not accounted at last update */
uint64_t scale; /* Multiplier to get from tsc to timer ticks */
struct timer timer; /* To make sure we send SCIs */
spinlock_t lock;