11035112e8
51d277a3-x86-don-t-pass-negative-time-to-gtime_to_gtsc-try-2.patch 51d27807-iommu-amd-Fix-logic-for-clearing-the-IOMMU-interrupt-bits.patch 51d27841-iommu-amd-Workaround-for-erratum-787.patch 51daa074-Revert-hvmloader-always-include-HPET-table.patch - Dropped deprecated or unnecessary patches pvdrv-import-shared-info.patch minios-fixups.patch OBS-URL: https://build.opensuse.org/package/show/Virtualization/xen?expand=0&rev=258
45 lines
1.7 KiB
Diff
45 lines
1.7 KiB
Diff
# Commit 5ad914bc867c5a6a4957869c89918f4e1f9dd9c4
|
|
# Date 2013-07-02 08:48:03 +0200
|
|
# Author Jan Beulich <jbeulich@suse.com>
|
|
# Committer Jan Beulich <jbeulich@suse.com>
|
|
x86: don't pass negative time to gtime_to_gtsc() (try 2)
|
|
|
|
This mostly reverts commit eb60be3d ("x86: don't pass negative time to
|
|
gtime_to_gtsc()") and instead corrects __update_vcpu_system_time()'s
|
|
handling of this_cpu(cpu_time).stime_local_stamp dating back before the
|
|
start of a HVM guest (which would otherwise lead to a negative value
|
|
getting passed to gtime_to_gtsc(), causing scale_delta() to produce
|
|
meaningless output).
|
|
|
|
Flushing the value to zero was wrong, and printing a message for
|
|
something that can validly happen wasn't very useful either.
|
|
|
|
Signed-off-by: Jan Beulich <jbeulich@suse.com>
|
|
Acked-by: Keir Fraser <keir@xen.org>
|
|
|
|
--- a/xen/arch/x86/time.c
|
|
+++ b/xen/arch/x86/time.c
|
|
@@ -823,16 +823,13 @@ static void __update_vcpu_system_time(st
|
|
struct pl_time *pl = &v->domain->arch.hvm_domain.pl_time;
|
|
|
|
stime += pl->stime_offset + v->arch.hvm_vcpu.stime_offset;
|
|
- if ( (s64)stime < 0 )
|
|
- {
|
|
- printk(XENLOG_G_WARNING "d%dv%d: bogus time %" PRId64
|
|
- " (offsets %" PRId64 "/%" PRId64 ")\n",
|
|
- d->domain_id, v->vcpu_id, stime,
|
|
- pl->stime_offset, v->arch.hvm_vcpu.stime_offset);
|
|
- stime = 0;
|
|
- }
|
|
+ if ( stime >= 0 )
|
|
+ tsc_stamp = gtime_to_gtsc(d, stime);
|
|
+ else
|
|
+ tsc_stamp = -gtime_to_gtsc(d, -stime);
|
|
}
|
|
- tsc_stamp = gtime_to_gtsc(d, stime);
|
|
+ else
|
|
+ tsc_stamp = gtime_to_gtsc(d, stime);
|
|
}
|
|
else
|
|
{
|