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] [xen-4.1-testing] x86/HPET: fix initialization order

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-4.1-testing] x86/HPET: fix initialization order
From: Xen patchbot-4.1-testing <patchbot@xxxxxxx>
Date: Mon, 14 Mar 2011 13:25:10 +0000
Delivery-date: Mon, 14 Mar 2011 06:25:37 -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 Jan Beulich <jbeulich@xxxxxxxxxx>
# Date 1299936344 0
# Node ID d4352abf34504d5d87e0e18ff8876098724b6bf1
# Parent  4f5534517e080fcdcf24049fbf2ef33210bacb7d
x86/HPET: fix initialization order

At least the legacy path can enter its interrupt handler callout while
initialization is still in progress - that handler checks whether
->event_handler is non-NULL, and hence all other initialization must
happen before setting this field.

Do the same to the MSI initialization just in case (and to keep the
code in sync).

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>
Acked-by: Wei Gang <gang.wei@xxxxxxxxx>
xen-unstable changeset:   23030:87aa1277eae0
xen-unstable date:        Sat Mar 12 13:19:02 2011 +0000
---


diff -r 4f5534517e08 -r d4352abf3450 xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c       Fri Mar 11 18:35:15 2011 +0000
+++ b/xen/arch/x86/hpet.c       Sat Mar 12 13:25:44 2011 +0000
@@ -597,9 +597,10 @@
                                          1000000000ul, 32);
             hpet_events[i].shift = 32;
             hpet_events[i].next_event = STIME_MAX;
-            hpet_events[i].event_handler = handle_hpet_broadcast;
             spin_lock_init(&hpet_events[i].lock);
             rwlock_init(&hpet_events[i].cpumask_lock);
+            wmb();
+            hpet_events[i].event_handler = handle_hpet_broadcast;
         }
 
         return;
@@ -630,11 +631,12 @@
     legacy_hpet_event.mult = div_sc((unsigned long)hpet_rate, 1000000000ul, 
32);
     legacy_hpet_event.shift = 32;
     legacy_hpet_event.next_event = STIME_MAX;
-    legacy_hpet_event.event_handler = handle_hpet_broadcast;
     legacy_hpet_event.idx = 0;
     legacy_hpet_event.flags = 0;
     spin_lock_init(&legacy_hpet_event.lock);
     rwlock_init(&legacy_hpet_event.cpumask_lock);
+    wmb();
+    legacy_hpet_event.event_handler = handle_hpet_broadcast;
 
     if ( !force_hpet_broadcast )
         pv_rtc_handler = handle_rtc_once;

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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-4.1-testing] x86/HPET: fix initialization order, Xen patchbot-4 . 1-testing <=