[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-devel] [PATCH] VMXAssist: Bug fix (selector initialization)

  • To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
  • From: "Guy Zana" <guy@xxxxxxxxxxxx>
  • Date: Sun, 20 May 2007 11:09:29 -0400
  • Delivery-date: Sun, 20 May 2007 08:11:38 -0700
  • List-id: Xen developer discussion <xen-devel.lists.xensource.com>
  • 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,
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>

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

Xen-devel mailing list



Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.