0c76f22ef1
- bnc#633573 - System fail to boot after running several warm reboot tests 22749-vtd-workarounds.patch - Upstream patches from Jan 22744-ept-pod-locking.patch 22777-vtd-ats-fixes.patch 22781-pod-hap-logdirty.patch 22782-x86-emul-smsw.patch 22789-i386-no-x2apic.patch 22790-svm-resume-migrate-pirqs.patch 22816-x86-pirq-drop-priv-check.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=94
37 lines
1.3 KiB
Diff
37 lines
1.3 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>
|
|
|
|
Index: xen-4.0.2-testing/xen/arch/x86/hvm/vlapic.c
|
|
===================================================================
|
|
--- xen-4.0.2-testing.orig/xen/arch/x86/hvm/vlapic.c
|
|
+++ xen-4.0.2-testing/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, "
|