[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] x86/hpet: clear unwanted bits



# HG changeset patch
# User Jan Beulich <jbeulich@xxxxxxxx>
# Date 1332854623 -7200
# Node ID 0b0e42dc4f0a40a4ad76db1021ec6d17dee5d21b
# Parent  790cfd7a4a8176e37bbe5a80aa1d30f1b8eb6d0b
x86/hpet: clear unwanted bits

Leaving certain bits set when being started from an environment where
the HPET was already in use can affect functionality. Clear those bits
to be on the safe side.

We should also consider ignoring the HPET altogether if any reserved
bits are found to be set.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
Acked-by: Keir Fraser <keir@xxxxxxx>
---


diff -r 790cfd7a4a81 -r 0b0e42dc4f0a xen/arch/x86/hpet.c
--- a/xen/arch/x86/hpet.c       Tue Mar 27 15:22:54 2012 +0200
+++ b/xen/arch/x86/hpet.c       Tue Mar 27 15:23:43 2012 +0200
@@ -533,7 +533,7 @@ void __init hpet_broadcast_init(void)
     {
         /* set HPET Tn as oneshot */
         cfg = hpet_read32(HPET_Tn_CFG(hpet_events[i].idx));
-        cfg &= ~HPET_TN_PERIODIC;
+        cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC | HPET_TN_FSB);
         cfg |= HPET_TN_ENABLE | HPET_TN_32BIT;
         hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx));
 
@@ -590,7 +590,7 @@ void hpet_broadcast_resume(void)
 
         /* set HPET Tn as oneshot */
         cfg = hpet_read32(HPET_Tn_CFG(hpet_events[i].idx));
-        cfg &= ~HPET_TN_PERIODIC;
+        cfg &= ~(HPET_TN_LEVEL | HPET_TN_PERIODIC | HPET_TN_FSB);
         cfg |= HPET_TN_ENABLE | HPET_TN_32BIT;
         hpet_write32(cfg, HPET_Tn_CFG(hpet_events[i].idx));
 
diff -r 790cfd7a4a81 -r 0b0e42dc4f0a xen/include/asm-x86/hpet.h
--- a/xen/include/asm-x86/hpet.h        Tue Mar 27 15:22:54 2012 +0200
+++ b/xen/include/asm-x86/hpet.h        Tue Mar 27 15:23:43 2012 +0200
@@ -32,9 +32,11 @@
 #define        HPET_LEGACY_8254        2
 #define        HPET_LEGACY_RTC         8
 
+#define HPET_TN_LEVEL          0x002
 #define HPET_TN_ENABLE         0x004
 #define HPET_TN_PERIODIC       0x008
 #define HPET_TN_PERIODIC_CAP   0x010
+#define HPET_TN_64BIT_CAP      0x020
 #define HPET_TN_SETVAL         0x040
 #define HPET_TN_32BIT          0x100
 #define HPET_TN_ROUTE          0x3e00

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


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.