19d8f590f0
xen.spec - bsc#945167 - Running command ’ xl pci-assignable-add 03:10.1’ secondly show errors 55f7f9d2-libxl-slightly-refine-pci-assignable-add-remove-handling.patch - Upstream patches from Jan 55f2e438-x86-hvm-fix-saved-pmtimer-and-hpet-values.patch 55f9345b-x86-MSI-fail-if-no-hardware-support.patch 5604f239-x86-PV-properly-populate-descriptor-tables.patch 5604f2e6-vt-d-fix-IM-bit-mask-and-unmask-of-FECTL_REG.patch 560a4af9-x86-EPT-tighten-conditions-of-IOMMU-mapping-updates.patch 560a7c36-x86-p2m-pt-delay-freeing-of-intermediate-page-tables.patch 560a7c53-x86-p2m-pt-ignore-pt-share-flag-for-shadow-mode-guests.patch 560bd926-credit1-fix-tickling-when-it-happens-from-a-remote-pCPU.patch 560e6d34-x86-p2m-pt-tighten-conditions-of-IOMMU-mapping-updates.patch - bsc#941074 - VmError: Device 51728 (vbd) could not be connected. Hotplug scripts not working. hotplug-Linux-block-performance-fix.patch - bsc#947165 - VUL-0: CVE-2015-7311: xen: libxl fails to honour readonly flag on disks with qemu-xen (xsa-142) CVE-2015-7311-xsa142.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=378
69 lines
2.6 KiB
Diff
69 lines
2.6 KiB
Diff
# Commit 244582a01dcb49fa30083725964a066937cc94f2
|
|
# Date 2015-09-11 16:24:56 +0200
|
|
# Author Kouya Shimura <kouya@jp.fujitsu.com>
|
|
# Committer Jan Beulich <jbeulich@suse.com>
|
|
x86/hvm: fix saved pmtimer and hpet values
|
|
|
|
The ACPI PM timer is sometimes broken on live migration.
|
|
Since vcpu->arch.hvm_vcpu.guest_time is always zero in other than
|
|
"delay for missed ticks mode". Even in "delay for missed ticks mode",
|
|
vcpu's guest_time field is not valid (i.e. zero) when
|
|
the state of vcpu is "blocked". (see pt_save_timer function)
|
|
|
|
The original author (Tim Deegan) of pmtimer_save() must have intended
|
|
that it saves the last scheduled time of the vcpu. Unfortunately it was
|
|
already implied this bug. FYI, there is no other timer mode than
|
|
"delay for missed ticks mode" then.
|
|
|
|
For consistency with HPET, pmtimer_save() should refer hvm_get_guest_time()
|
|
to update the counter as well as hpet_save() does.
|
|
|
|
Without this patch, the clock of windows server 2012R2 without HPET
|
|
might leap forward several minutes on live migration.
|
|
|
|
Signed-off-by: Kouya Shimura <kouya@jp.fujitsu.com>
|
|
|
|
Retain use of ->arch.hvm_vcpu.guest_time when non-zero. Do the inverse
|
|
adjustment for vHPET.
|
|
|
|
Signed-off-by: Jan Beulich <jbeulich@suse.com>
|
|
Reviewed-by: Tim Deegan <tim@xen.org>
|
|
Reviewed-by: Kouya Shimura <kouya@jp.fujitsu.com>
|
|
|
|
--- a/xen/arch/x86/hvm/hpet.c
|
|
+++ b/xen/arch/x86/hvm/hpet.c
|
|
@@ -506,11 +506,13 @@ const struct hvm_mmio_handler hpet_mmio_
|
|
static int hpet_save(struct domain *d, hvm_domain_context_t *h)
|
|
{
|
|
HPETState *hp = domain_vhpet(d);
|
|
+ struct vcpu *v = pt_global_vcpu_target(d);
|
|
int rc;
|
|
uint64_t guest_time;
|
|
|
|
write_lock(&hp->lock);
|
|
- guest_time = guest_time_hpet(hp);
|
|
+ guest_time = (v->arch.hvm_vcpu.guest_time ?: hvm_get_guest_time(v)) /
|
|
+ STIME_PER_HPET_TICK;
|
|
|
|
/* Write the proper value into the main counter */
|
|
if ( hpet_enabled(hp) )
|
|
--- a/xen/arch/x86/hvm/pmtimer.c
|
|
+++ b/xen/arch/x86/hvm/pmtimer.c
|
|
@@ -250,10 +250,12 @@ static int pmtimer_save(struct domain *d
|
|
|
|
spin_lock(&s->lock);
|
|
|
|
- /* Update the counter to the guest's current time. We always save
|
|
- * with the domain paused, so the saved time should be after the
|
|
- * last_gtime, but just in case, make sure we only go forwards */
|
|
- x = ((s->vcpu->arch.hvm_vcpu.guest_time - s->last_gtime) * s->scale) >> 32;
|
|
+ /*
|
|
+ * Update the counter to the guest's current time. Make sure it only
|
|
+ * goes forwards.
|
|
+ */
|
|
+ x = (((s->vcpu->arch.hvm_vcpu.guest_time ?: hvm_get_guest_time(s->vcpu)) -
|
|
+ s->last_gtime) * s->scale) >> 32;
|
|
if ( x < 1UL<<31 )
|
|
s->pm.tmr_val += x;
|
|
if ( (s->pm.tmr_val & TMR_VAL_MSB) != msb )
|