rpms/kernel-xen-2.6/devel linux-2.6-xen-backwards-time.patch, NONE, 1.1 kernel-xen.spec, 1.40, 1.41
Eduardo Habkost (ehabkost)
fedora-extras-commits at redhat.com
Thu Aug 9 17:15:30 UTC 2007
Author: ehabkost
Update of /cvs/pkgs/rpms/kernel-xen-2.6/devel
In directory cvs-int.fedora.redhat.com:/tmp/cvs-serv4018
Modified Files:
kernel-xen.spec
Added Files:
linux-2.6-xen-backwards-time.patch
Log Message:
Add linux-2.6-xen-backwards-time.patch from RHEL bug #245761
This may also fix bug #236307
linux-2.6-xen-backwards-time.patch:
--- NEW FILE linux-2.6-xen-backwards-time.patch ---
# HG changeset patch
# User kfraser at localhost.localdomain
# Date 1182263776 -3600
# Node ID 87bb8705768a66ceabb15a419c5f86580bffb6bf
# Parent a413dd61e7e5e1bba11bab447184cf5e6b43513a
x86 time: Ensure gettimeofday() is monotonically increasing.
Signed-off-by: Atsushi SAKAI <sakaia at jp.fujitsu.com>
Index: linux-2.6.21.i386/arch/i386/kernel/time-xen.c
===================================================================
--- linux-2.6.21.i386.orig/arch/i386/kernel/time-xen.c
+++ linux-2.6.21.i386/arch/i386/kernel/time-xen.c
@@ -107,6 +107,9 @@ static DEFINE_PER_CPU(struct shadow_time
static struct timespec shadow_tv;
static u32 shadow_tv_version;
+static struct timeval monotonic_tv;
+static spinlock_t monotonic_lock = SPIN_LOCK_UNLOCKED;
+
/* Keep track of last time we did processing/updating of jiffies and xtime. */
static u64 processed_system_time; /* System time (ns) at last processing. */
static DEFINE_PER_CPU(u64, processed_system_time);
@@ -322,6 +325,7 @@ void do_gettimeofday(struct timeval *tv)
unsigned long seq;
unsigned long usec, sec;
unsigned long max_ntp_tick;
+ unsigned long flags;
s64 nsec;
unsigned int cpu;
struct shadow_time_info *shadow;
@@ -374,6 +378,18 @@ void do_gettimeofday(struct timeval *tv)
sec++;
}
+ spin_lock_irqsave(&monotonic_lock, flags);
+ if ((sec > monotonic_tv.tv_sec) ||
+ ((sec == monotonic_tv.tv_sec) && (usec > monotonic_tv.tv_usec)))
+ {
+ monotonic_tv.tv_sec = sec;
+ monotonic_tv.tv_usec = usec;
+ } else {
+ sec = monotonic_tv.tv_sec;
+ usec = monotonic_tv.tv_usec;
+ }
+ spin_unlock_irqrestore(&monotonic_lock, flags);
+
tv->tv_sec = sec;
tv->tv_usec = usec;
}
@@ -423,6 +439,12 @@ int do_settimeofday(struct timespec *tv)
__update_wallclock(sec, nsec);
}
+ /* Reset monotonic gettimeofday() timeval. */
+ spin_lock(&monotonic_lock);
+ monotonic_tv.tv_sec = 0;
+ monotonic_tv.tv_usec = 0;
+ spin_unlock(&monotonic_lock);
+
write_sequnlock_irq(&xtime_lock);
put_cpu();
Index: kernel-xen.spec
===================================================================
RCS file: /cvs/pkgs/rpms/kernel-xen-2.6/devel/kernel-xen.spec,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -r1.40 -r1.41
--- kernel-xen.spec 7 Aug 2007 14:49:08 -0000 1.40
+++ kernel-xen.spec 9 Aug 2007 17:14:57 -0000 1.41
@@ -445,6 +445,7 @@
Patch950: linux-2.6.21.6-xen-3.1.0.patch
Patch952: linux-2.6-xen-x86_64-silence-up-apic-errors.patch
Patch960: linux-2.6-xen-blkfront-wait-add.patch
+Patch961: linux-2.6-xen-backwards-time.patch
#
# Patches 1000 to 5000 are reserved for bugfixes to drivers and filesystems
@@ -926,6 +927,7 @@
# Xen utrace
%patch960 -p1
+%patch961 -p1
%endif
@@ -2297,6 +2299,10 @@
# - tux.
%changelog
+* Thu Aug 09 2007 Eduardo Habkost <ehabkost at redhat.com>
+- Add linux-2.6-xen-backwards-time.patch from RHEL bug #245761. This
+ should also fix bug #236307
+
* Tue Aug 07 2007 Eduardo Habkost <ehabkost at redhat.com>
- Re-add linux-2.6-disable-netback-checksum.patch. The other checksum
patches are already included on linux-2.6-xen-3.1.0.patch.
More information about the fedora-extras-commits
mailing list