diff options
author | Jan Beulich <jbeulich@suse.com> | 2012-03-28 16:59:02 +0200 |
---|---|---|
committer | Jan Beulich <jbeulich@suse.com> | 2012-03-28 16:59:02 +0200 |
commit | d5c1c62c19dbdaacaa680d7e72a10a37ef1444b6 (patch) | |
tree | 9a209be4a26e4a9867a9b5ecd40ca8dcf2aaa567 | |
parent | 7e5c676dd7a17d8290489ad305f12591920a6c01 (diff) | |
download | xen-d5c1c62c19dbdaacaa680d7e72a10a37ef1444b6.tar.gz xen-d5c1c62c19dbdaacaa680d7e72a10a37ef1444b6.tar.bz2 xen-d5c1c62c19dbdaacaa680d7e72a10a37ef1444b6.zip |
x86/hpet: warn about and clear reserved set config register bits
Signed-off-by: Jan Beulich <jbeulich@suse.com>
Acked-by: Keir Fraser <keir@xen.org>
-rw-r--r-- | xen/arch/x86/hpet.c | 14 | ||||
-rw-r--r-- | xen/arch/x86/hvm/hpet.c | 3 | ||||
-rw-r--r-- | xen/include/asm-x86/hpet.h | 1 |
3 files changed, 17 insertions, 1 deletions
diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c index 7394f7456f..1b9fd574e5 100644 --- a/xen/arch/x86/hpet.c +++ b/xen/arch/x86/hpet.c @@ -755,6 +755,13 @@ void hpet_resume(u32 *boot_cfg) if ( boot_cfg ) *boot_cfg = cfg; cfg &= ~(HPET_CFG_ENABLE | HPET_CFG_LEGACY); + if ( cfg ) + { + printk(XENLOG_WARNING + "HPET: reserved bits %#x set in global config register\n", + cfg); + cfg = 0; + } hpet_write32(cfg, HPET_CFG); hpet_id = hpet_read32(HPET_ID); @@ -765,6 +772,13 @@ void hpet_resume(u32 *boot_cfg) if ( boot_cfg ) boot_cfg[i + 1] = cfg; cfg &= ~HPET_TN_ENABLE; + if ( cfg & HPET_TN_RESERVED ) + { + printk(XENLOG_WARNING + "HPET: reserved bits %#x set in channel %u config register\n", + cfg & HPET_TN_RESERVED, i); + cfg &= ~HPET_TN_RESERVED; + } hpet_write32(cfg, HPET_Tn_CFG(i)); } diff --git a/xen/arch/x86/hvm/hpet.c b/xen/arch/x86/hvm/hpet.c index 15d76471a0..4b4b905095 100644 --- a/xen/arch/x86/hvm/hpet.c +++ b/xen/arch/x86/hvm/hpet.c @@ -42,7 +42,8 @@ (hvm_get_guest_time(vhpet_vcpu(hpet)) / STIME_PER_HPET_TICK) #define HPET_TN_INT_ROUTE_CAP_SHIFT 32 -#define HPET_TN_CFG_BITS_READONLY_OR_RESERVED 0xffff80b1U +#define HPET_TN_CFG_BITS_READONLY_OR_RESERVED (HPET_TN_RESERVED | \ + HPET_TN_PERIODIC_CAP | HPET_TN_64BIT_CAP | HPET_TN_FSB_CAP) /* can be routed to IOAPIC.redirect_table[23..20] */ #define HPET_TN_INT_ROUTE_CAP (0x00f00000ULL \ diff --git a/xen/include/asm-x86/hpet.h b/xen/include/asm-x86/hpet.h index a230c94e44..f6f3b5f08a 100644 --- a/xen/include/asm-x86/hpet.h +++ b/xen/include/asm-x86/hpet.h @@ -43,6 +43,7 @@ #define HPET_TN_ROUTE 0x3e00 #define HPET_TN_FSB 0x4000 #define HPET_TN_FSB_CAP 0x8000 +#define HPET_TN_RESERVED 0xffff0081 #define HPET_TN_ROUTE_SHIFT 9 |