From: "Jan Beulich" Subject: [PATCH] x86/hpet: warn about and clear reserved set config register bits Date: Wed, 28 Mar 2012 14:42:38 +0100 Message-ID: <4F73316E020000780007B799@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part1F312E5E.0__=" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part1F312E5E.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline Signed-off-by: Jan Beulich --- 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 =3D cfg; cfg &=3D ~(HPET_CFG_ENABLE | HPET_CFG_LEGACY); + if ( cfg ) + { + printk(XENLOG_WARNING + "HPET: reserved bits %#x set in global config register\n", + cfg); + cfg =3D 0; + } hpet_write32(cfg, HPET_CFG); =20 hpet_id =3D hpet_read32(HPET_ID); @@ -765,6 +772,13 @@ void hpet_resume(u32 *boot_cfg) if ( boot_cfg ) boot_cfg[i + 1] =3D cfg; cfg &=3D ~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 &=3D ~HPET_TN_RESERVED; + } hpet_write32(cfg, HPET_Tn_CFG(i)); } =20 --- 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) =20 #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) =20 /* can be routed to IOAPIC.redirect_table[23..20] */ #define HPET_TN_INT_ROUTE_CAP (0x00f00000ULL \ --- 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 =20 =20 --=__Part1F312E5E.0__= Content-Type: text/plain; name="x86-hpet-clear-reserved-bits.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-hpet-clear-reserved-bits.patch" x86/hpet: warn about and clear reserved set config register bits=0A=0ASigne= d-off-by: Jan Beulich =0A=0A--- a/xen/arch/x86/hpet.c=0A= +++ b/xen/arch/x86/hpet.c=0A@@ -755,6 +755,13 @@ void hpet_resume(u32 = *boot_cfg)=0A if ( boot_cfg )=0A *boot_cfg =3D cfg;=0A cfg = &=3D ~(HPET_CFG_ENABLE | HPET_CFG_LEGACY);=0A+ if ( cfg )=0A+ {=0A+ = printk(XENLOG_WARNING=0A+ "HPET: reserved bits %#x set = in global config register\n",=0A+ cfg);=0A+ cfg =3D = 0;=0A+ }=0A hpet_write32(cfg, HPET_CFG);=0A =0A hpet_id =3D = hpet_read32(HPET_ID);=0A@@ -765,6 +772,13 @@ void hpet_resume(u32 = *boot_cfg)=0A if ( boot_cfg )=0A boot_cfg[i + 1] =3D = cfg;=0A cfg &=3D ~HPET_TN_ENABLE;=0A+ if ( cfg & HPET_TN_RES= ERVED )=0A+ {=0A+ printk(XENLOG_WARNING=0A+ = "HPET: reserved bits %#x set in channel %u config register\n",=0A+ = cfg & HPET_TN_RESERVED, i);=0A+ cfg &=3D = ~HPET_TN_RESERVED;=0A+ }=0A hpet_write32(cfg, HPET_Tn_CFG(i)= );=0A }=0A =0A--- a/xen/arch/x86/hvm/hpet.c=0A+++ b/xen/arch/x86/hvm/hp= et.c=0A@@ -42,7 +42,8 @@=0A (hvm_get_guest_time(vhpet_vcpu(hpet)) / = STIME_PER_HPET_TICK)=0A =0A #define HPET_TN_INT_ROUTE_CAP_SHIFT 32=0A-#defi= ne HPET_TN_CFG_BITS_READONLY_OR_RESERVED 0xffff80b1U=0A+#define HPET_TN_CFG= _BITS_READONLY_OR_RESERVED (HPET_TN_RESERVED | \=0A+ HPET_TN_PERIODIC_CA= P | HPET_TN_64BIT_CAP | HPET_TN_FSB_CAP)=0A =0A /* can be routed to = IOAPIC.redirect_table[23..20] */=0A #define HPET_TN_INT_ROUTE_CAP = (0x00f00000ULL \=0A--- a/xen/include/asm-x86/hpet.h=0A+++ b/xen/include/asm= -x86/hpet.h=0A@@ -43,6 +43,7 @@=0A #define HPET_TN_ROUTE = 0x3e00=0A #define HPET_TN_FSB 0x4000=0A #define HPET_TN_FSB_CAP = 0x8000=0A+#define HPET_TN_RESERVED 0xffff0081=0A #define = HPET_TN_ROUTE_SHIFT 9=0A =0A =0A --=__Part1F312E5E.0__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__Part1F312E5E.0__=--