From: Andrew Cooper <andrew.cooper3@citrix.com>
To: Xen-devel <xen-devel@lists.xen.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Subject: [Patch 4/4] x86/hpet: Don't clear reserved bits in the General Configuration Register
Date: Mon, 7 Oct 2013 14:26:21 +0100 [thread overview]
Message-ID: <1381152381-19744-5-git-send-email-andrew.cooper3@citrix.com> (raw)
In-Reply-To: <1381152381-19744-1-git-send-email-andrew.cooper3@citrix.com>
It is a violation of the specification.
The reserved bits in the General Configuration Register, unlike all other
reserved bits I have found in the spec, are specified as 'must never be
changed by the OS'.
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
---
xen/arch/x86/hpet.c | 10 +++-------
xen/include/asm-x86/hpet.h | 2 ++
2 files changed, 5 insertions(+), 7 deletions(-)
diff --git a/xen/arch/x86/hpet.c b/xen/arch/x86/hpet.c
index 091e624..eb48f84 100644
--- a/xen/arch/x86/hpet.c
+++ b/xen/arch/x86/hpet.c
@@ -814,15 +814,11 @@ void hpet_resume(u32 *boot_cfg)
cfg = hpet_read32(HPET_CFG);
if ( boot_cfg )
*boot_cfg = cfg;
- cfg &= ~(HPET_CFG_ENABLE | HPET_CFG_LEGACY);
- if ( cfg )
- {
+
+ if ( cfg & HPET_CFG_RESERVED )
printk(XENLOG_WARNING
"HPET: reserved bits %#x set in global config register\n",
- cfg);
- cfg = 0;
- }
- hpet_write32(cfg, HPET_CFG);
+ cfg & HPET_CFG_RESERVED);
hpet_id = hpet_read32(HPET_ID);
last = (hpet_id & HPET_ID_NUMBER) >> HPET_ID_NUMBER_SHIFT;
diff --git a/xen/include/asm-x86/hpet.h b/xen/include/asm-x86/hpet.h
index 875f1de..22a11da 100644
--- a/xen/include/asm-x86/hpet.h
+++ b/xen/include/asm-x86/hpet.h
@@ -28,6 +28,8 @@
#define HPET_CFG_ENABLE 0x001
#define HPET_CFG_LEGACY 0x002
+#define HPET_CFG_RESERVED 0xfffffffc
+
#define HPET_LEGACY_8254 2
#define HPET_LEGACY_RTC 8
--
1.7.10.4
next prev parent reply other threads:[~2013-10-07 13:26 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-10-07 13:26 [Patch 0/4] HPET general fixes Andrew Cooper
2013-10-07 13:26 ` [Patch 1/4] x86/hpet: Basic cleanup Andrew Cooper
2013-10-07 13:26 ` [Patch 2/4] x86/hpet: Sanitise HPET ACPI table and warn about multiple tables Andrew Cooper
2013-10-07 13:45 ` Jan Beulich
2013-10-07 13:55 ` Andrew Cooper
2013-10-07 14:26 ` Jan Beulich
2013-10-07 13:26 ` [Patch 3/4] x86/hpet: Fix ambiguity in broadcast info message Andrew Cooper
2013-10-07 13:48 ` Jan Beulich
2013-10-07 13:26 ` Andrew Cooper [this message]
2013-10-07 13:55 ` [Patch 4/4] x86/hpet: Don't clear reserved bits in the General Configuration Register Jan Beulich
2013-10-07 14:02 ` Andrew Cooper
2013-10-07 14:28 ` Jan Beulich
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1381152381-19744-5-git-send-email-andrew.cooper3@citrix.com \
--to=andrew.cooper3@citrix.com \
--cc=xen-devel@lists.xen.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).