]> xenbits.xensource.com Git - people/vhanquez/xen.git/commitdiff
hvm: Do not crash guest if it does an unaligned access to an HPET
authorKeir Fraser <keir.fraser@citrix.com>
Thu, 6 Dec 2007 16:50:45 +0000 (16:50 +0000)
committerKeir Fraser <keir.fraser@citrix.com>
Thu, 6 Dec 2007 16:50:45 +0000 (16:50 +0000)
register. Some CrashMe test apaprently does this and we don't want
that to crash the domain it runs in.
From: Dexuan Cui <dexuan.cui@intel.com>
Signed-off-by: Keir Fraser <keir.fraser@eu.citrix.com>
xen-unstable changeset:   16404:ae6f4c7f15cbc2a7192c91e513682e3d13de9f4f
xen-unstable date:        Wed Nov 21 09:49:09 2007 +0000

xen/arch/x86/hvm/hpet.c

index 2b8935b47fda07ae201545e4cccfd296e09b705b..cf2737e994479b9b16b4afa1027411c93c506fdb 100644 (file)
@@ -102,9 +102,13 @@ static inline int hpet_check_access_length(
 {
     if ( (addr & (len - 1)) || (len > 8) )
     {
-        gdprintk(XENLOG_ERR, "HPET: access across register boundary: "
+        /*
+         * According to ICH9 specification, unaligned accesses may result
+         * in unexpected behaviour or master abort, but should not crash/hang.
+         * Hence we read all-ones, drop writes, and log a warning.
+         */
+        gdprintk(XENLOG_WARNING, "HPET: access across register boundary: "
                  "%lx %lx\n", addr, len);
-        domain_crash(current->domain);
         return -EINVAL;
     }