xen/22484-vlapic-tmcct-periodic.patch
Charles Arnold 9a05aa7fc4 - bnc#658704 - SLES11 SP1 Xen boot panic in x2apic mode
22707-x2apic-preenabled-check.patch
- bnc#641419 - L3: Xen: qemu-dm reports "xc_map_foreign_batch: mmap failed:
  Cannot allocate memory"
  7434-qemu-rlimit-as.patch
- Additional or upstream patches from Jan
  22693-fam10-mmio-conf-base-protect.patch
  22694-x86_64-no-weak.patch
  22708-xenctx-misc.patch
  21432-4.0-cpu-boot-failure.patch
  22645-amd-flush-filter.patch
  qemu-fix-7433.patch

- Maintain compatibility with the extid flag even though it is
  deprecated for both legacy and sxp config files.
  hv_extid_compatibility.patch 

- bnc#649209-improve suspend eventchn lock
  suspend_evtchn_lock.patch

- Removed the hyper-v shim patches in favor of using the upstream 
  version. 

- bnc#641419 - L3: Xen: qemu-dm reports "xc_map_foreign_batch: mmap
  failed: Cannot allocate memory" 
  qemu-rlimit-as.patch

- Upstream c/s 7433 to replace qemu_altgr_more.patch
  7433-qemu-altgr.patch

OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=90
2011-01-14 18:24:51 +00:00

35 lines
1.2 KiB
Diff

# HG changeset patch
# User Keir Fraser <keir@xen.org>
# Date 1291999745 0
# Node ID 3b3fce9050b9b14f3a11123f6943998413ea7e7e
# Parent 901c118b363e978566775f9d118b4f2f15598212
hvm vlapic: Fix tmcct read logic when in periodic mode.
Signed-off-by: Keir Fraser <keir@xen.org>
--- a/xen/arch/x86/hvm/vlapic.c
+++ b/xen/arch/x86/hvm/vlapic.c
@@ -428,12 +428,19 @@ int vlapic_ipi(
static uint32_t vlapic_get_tmcct(struct vlapic *vlapic)
{
struct vcpu *v = current;
- uint32_t tmcct, tmict = vlapic_get_reg(vlapic, APIC_TMICT);
+ uint32_t tmcct = 0, tmict = vlapic_get_reg(vlapic, APIC_TMICT);
uint64_t counter_passed;
counter_passed = ((hvm_get_guest_time(v) - vlapic->timer_last_update)
- / APIC_BUS_CYCLE_NS / vlapic->hw.timer_divisor);
- tmcct = tmict - counter_passed;
+ / (APIC_BUS_CYCLE_NS * vlapic->hw.timer_divisor));
+
+ if ( tmict != 0 )
+ {
+ if ( vlapic_lvtt_period(vlapic) )
+ counter_passed %= tmict;
+ if ( counter_passed < tmict )
+ tmcct = tmict - counter_passed;
+ }
HVM_DBG_LOG(DBG_LEVEL_VLAPIC_TIMER,
"timer initial count %d, timer current count %d, "