aboutsummaryrefslogtreecommitdiffstats
path: root/xen/arch/x86/hpet.c
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@suse.com>2012-03-27 15:23:43 +0200
committerJan Beulich <jbeulich@suse.com>2012-03-27 15:23:43 +0200
commitcb938f2c4ddfee6fad950289f6a2ed497c11ee03 (patch)
treed69aad8acc7daa0bd00abd09bf39041e1e08d174 /xen/arch/x86/hpet.c
parenteca1bfec46214a902f24bce2b44c96ae364f1219 (diff)
downloadxen-cb938f2c4ddfee6fad950289f6a2ed497c11ee03.tar.gz
xen-cb938f2c4ddfee6fad950289f6a2ed497c11ee03.tar.bz2
xen-cb938f2c4ddfee6fad950289f6a2ed497c11ee03.zip
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@suse.com> Acked-by: Keir Fraser <keir@xen.org>
Diffstat (limited to 'xen/arch/x86/hpet.c')
-rw-r--r--xen/arch/x86/hpet.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 71f0b815f4..7394f7456f 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -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));