WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-changelog

[Xen-changelog] [linux-2.6.18-xen] x86, xen: get_time_values_from_Xen()

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [linux-2.6.18-xen] x86, xen: get_time_values_from_Xen() is not IRQ-safe.
From: "Xen patchbot-linux-2.6.18-xen" <patchbot-linux-2.6.18-xen@xxxxxxxxxxxxxxxxxxx>
Date: Fri, 08 Aug 2008 07:30:33 -0700
Delivery-date: Fri, 08 Aug 2008 07:31:32 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1218195837 -3600
# Node ID 2807d531d025ae0c57d73e2ed60c13cd4bb4e21b
# Parent  ff6ba016eed24c997b0dbe4bc0552864cb3a590a
x86, xen: get_time_values_from_Xen() is not IRQ-safe.
Also the loop header should act on local variables for safety.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 arch/i386/kernel/time-xen.c |   11 +++++++++--
 1 files changed, 9 insertions(+), 2 deletions(-)

diff -r ff6ba016eed2 -r 2807d531d025 arch/i386/kernel/time-xen.c
--- a/arch/i386/kernel/time-xen.c       Fri Aug 08 10:57:41 2008 +0100
+++ b/arch/i386/kernel/time-xen.c       Fri Aug 08 12:43:57 2008 +0100
@@ -314,21 +314,28 @@ static void get_time_values_from_xen(uns
 {
        struct vcpu_time_info   *src;
        struct shadow_time_info *dst;
+       unsigned long flags;
+       u32 pre_version, post_version;
 
        src = &vcpu_info(cpu)->time;
        dst = &per_cpu(shadow_time, cpu);
 
+       local_irq_save(flags);
+
        do {
-               dst->version = src->version;
+               pre_version = dst->version = src->version;
                rmb();
                dst->tsc_timestamp     = src->tsc_timestamp;
                dst->system_timestamp  = src->system_time;
                dst->tsc_to_nsec_mul   = src->tsc_to_system_mul;
                dst->tsc_shift         = src->tsc_shift;
                rmb();
-       } while ((src->version & 1) | (dst->version ^ src->version));
+               post_version = src->version;
+       } while ((pre_version & 1) | (pre_version ^ post_version));
 
        dst->tsc_to_usec_mul = dst->tsc_to_nsec_mul / 1000;
+
+       local_irq_restore(flags);
 }
 
 static inline int time_values_up_to_date(unsigned int cpu)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [linux-2.6.18-xen] x86, xen: get_time_values_from_Xen() is not IRQ-safe., Xen patchbot-linux-2.6.18-xen <=