WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] Don't crash guest when HVM guest attempts to access

To: "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx>, "xen-devel" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] Don't crash guest when HVM guest attempts to access HPET registers across boundaries.
From: "Cui, Dexuan" <dexuan.cui@xxxxxxxxx>
Date: Wed, 21 Nov 2007 12:51:23 +0800
Delivery-date: Tue, 20 Nov 2007 20:53:49 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acgr+iTviwmz0bdeS4u4Ch5Atp+c0g==
Thread-topic: [PATCH] Don't crash guest when HVM guest attempts to access HPET registers across boundaries.
HPET sepc says
"Software must not attempt to read or write across register boundaries.
For example, a 32-bit access
must be to offset 00h, 04h, 08h, or 0Ch. 32-bit accesses must not be to
01h, 02h, 03h, 05h, 06h, 07h,
09h, 0Ah, 0Bh, 0Dh, 0Eh, or 0Fh. 64-bit accesses can only be to 00h or
08h and must not cross 64-bit
boundaries."

ICH9 spec says
"Software must not attempt to read or write across register boundaries.
For example, a 32-bit
access should be to offset x0h, x4h, x8h, or xCh. 32-bit accesses should
not be to 01h, 02h,
03h, 05h, 06h, 07h, 09h, 0Ah, 0Bh, 0Dh, 0Eh, or 0Fh. Any accesses to
these offsets will result
in an unexpected behavior, and may result in a master abort. However,
these accesses should
not result in system hangs. 64-bit accesses can only be to x0h and must
not cross 64-bit
boundaries"

Normally no OS would break the Specs.
However, the "CrashMe" test attempts a 32-bit access to an
non-32-bit-aligned address.
To pass the test, let us apply the following patch (it just ignores the
non-aligned write, and returns ~0UL for unaligned read).

diff -r ba69fe2dce91 xen/arch/x86/hvm/hpet.c
--- a/xen/arch/x86/hvm/hpet.c   Tue Nov 13 20:13:50 2007 +0000
+++ b/xen/arch/x86/hvm/hpet.c   Wed Nov 21 11:53:43 2007 +0800
@@ -129,7 +129,6 @@ static inline int hpet_check_access_leng
     {
         gdprintk(XENLOG_ERR, "HPET: access across register boundary: "
                  "%lx %lx\n", addr, len);
-        domain_crash(current->domain);
         return -EINVAL;
     }


-- -- Dexuan

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] Don't crash guest when HVM guest attempts to access HPET registers across boundaries., Cui, Dexuan <=