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] VMXAssist: Bug fix (selector initialization)

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] VMXAssist: Bug fix (selector initialization)
From: "Guy Zana" <guy@xxxxxxxxxxxx>
Date: Sun, 20 May 2007 11:09:29 -0400
Delivery-date: Sun, 20 May 2007 08:11:38 -0700
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: Acea8NzqwaJQXijoT0OJdI8E07f9aA==
Thread-topic: [PATCH] VMXAssist: Bug fix (selector initialization)
In VMXAssist (setup.c), the function setup_ctx() initializes the various
selectors, especially, the TSS is being set up like this:
 
    c->tr_sel = TSS_SELECTOR;
    c->tr_limit = sizeof(tss)-1;
    c->tr_base = (unsigned long) &tss;
    c->tr_arbytes.fields.seg_type = 0xb; /* 0x9 | 0x2 (busy) */
 
The TSS limit is initialized to be sizeof(tss)-1, this leaves the last
byte of the I/O permission bitmap out, and accesses to ioports above
0xFFF8 causes the emulation to halt (the bits that were left out are
treated as being set and a #GPF is generated but not treated for outw,
for example).
 
Besides that, all other selectors are initialized in the same way (idt,
gdt).
I'm guessing that way way way back, the TSS was not a structure but
rather a null-terminated string.

We encountered this problem while developing PCI pass-through support
for Xen.

Signed-off-by: Alex Novik <alex@xxxxxxxxxxxx>
Signed-off-by: Guy Zana <guy@xxxxxxxxxxxx>
 
Thanks,
Guy.

Attachment: bug-fix-tss-limit.patch
Description: bug-fix-tss-limit.patch

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>