From: Anthony Liguori <aliguori@us.ibm.com>
To: Khoa Huynh <khoa@us.ibm.com>
Cc: xen-devel <xen-devel@lists.xensource.com>
Subject: Re: [PATCH] Calculate correct instruction length for data-fault VM exits on VT-x systems
Date: Thu, 27 Apr 2006 21:41:01 -0500 [thread overview]
Message-ID: <445180BD.5000007@us.ibm.com> (raw)
In-Reply-To: <OF6D39649D.9B84AE2D-ON8525715E.00058331-8625715E.000A4873@us.ibm.com>
Please don't submit patches with mailers that attach as binary attachments.
You'll have to resubmit anyway as your copyright line is wrong (unless
you really did write this code a thousand years ago ;-))
Regards,
Anthony Liguori
Khoa Huynh wrote:
> On VT-x systems, according to Intel VMX specifications,
> the instruction-length information in VMCS on VM exits
> is not always valid. The instruction-length field in
> VMCS is ONLY valid in the follwing cases: when the VM
> exit is caused by the execution of instructions that
> cause the VM exit unconditionally or based on the
> execution-control bitmap, a software exception (INT3
> or INT0), or a task switch.
>
> For VM exits caused by data faults (hardware exceptions),
> the instruction-length field in VMCS is actually undefined.
> In these cases, the hypervisor can derive the correct
> instruction length by fetching bytes based on the guest
> instruction pointer and decoding those bytes. There is
> already a function to do this in the SVM sub-directory.
> This function should be moved up one level to HVM
> sub-directory, so both VMX and SVM can use it.
>
> It should be noted that VMX only uses this instrlen
> function when the hypervisor needs the instruction-length
> info and that info is undefined in VMCS, e.g., for MMIO
> instructions. In other cases where the instruction-length
> field is valid in VMCS, the hypervisor continues to get
> that info from VMCS (via vmread operation).
>
> I came across this problem in my effort to get Windows
> NT booting on Xen.
>
> There are TWO patches attached below:
>
> * instrlen1.patch effectively moves the instrlen.c file
> from xen/arch/x86/hvm/svm sub-directory up one level to
> xen/arch/x86/hvm sub-directory and makes minor changes
> to instrlen.c so that it will work at its new location.
>
> * instrlen2.patch makes additional changes to VMX code
> so the hypervisor can use the instrlen function correctly
> in all modes in cases where the instruction-length field is
> undefined and read from VMCS in cases where it is defined.
>
> I must acknowledge that most of the code in the first patch
> (instrlen1.patch) does not come from me since the primary
> prupose of this patch is to move the instrlen.c file from
> one location to another in the tree (it also makes some
> minor changes). The second patch (instrlen2.patch) is
> more meaty :-)
>
> These two patches should apply cleanly to the latest
> xen-unstable tree (hg tip = 9866).
>
> I have tested these patches successfully on two systems
> using a variety of guest OSes (e.g. WinXP, Win2003 Server).
>
> Signed-off-by: Khoa Huynh <khoa@us.ibm.com>
>
> (See attached file: instrlen1.patch)(See attached file: instrlen2.patch)
>
> Regards,
> Khoa
> _________________________________________
> Khoa Huynh, Ph.D.
> IBM Linux Technology Center
> (512) 838-4903; T/L 678-4903; khoa@us.ibm.com
> ------------------------------------------------------------------------
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2006-04-28 2:41 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-04-28 1:52 [PATCH] Calculate correct instruction length for data-fault VM exits on VT-x systems Khoa Huynh
2006-04-28 2:41 ` Anthony Liguori [this message]
2006-04-28 6:03 ` Keir Fraser
2006-04-28 18:10 ` Khoa Huynh
2006-04-29 7:21 ` Keir Fraser
-- strict thread matches above, loose matches on Subject: below --
2006-04-28 9:02 Petersson, Mats
2006-04-28 9:14 ` Keir Fraser
2006-04-28 9:19 Petersson, Mats
2006-04-28 9:24 ` Keir Fraser
2006-04-29 1:20 ` Leendert van Doorn
2006-04-28 20:02 ` Anthony Liguori
2006-04-29 8:00 ` Keir Fraser
2006-04-29 14:54 ` Leendert van Doorn
2006-04-29 10:39 ` Keir Fraser
2006-04-29 23:24 ` Leendert van Doorn
2006-04-29 18:54 ` Keir Fraser
2006-04-30 1:37 ` Leendert van Doorn
2006-04-29 19:46 ` Keir Fraser
2006-05-02 12:36 Petersson, Mats
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=445180BD.5000007@us.ibm.com \
--to=aliguori@us.ibm.com \
--cc=khoa@us.ibm.com \
--cc=xen-devel@lists.xensource.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.