All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH][SVM] HVM fix for SWINT event injection
@ 2007-07-27 15:31 Woller, Thomas
  2007-07-27 15:57 ` Keir Fraser
  0 siblings, 1 reply; 6+ messages in thread
From: Woller, Thomas @ 2007-07-27 15:31 UTC (permalink / raw)
  To: xen-devel

[-- Attachment #1: Type: text/plain, Size: 1747 bytes --]

This patch resolves issues with booting/installing AMD-V HVM guests,
including 32bit win2000, and 64bit vista/longhorn guests on
xen-unstable.

This patch modifies the AMD-V reinjection logic (intr.c) to not inject
any SWINT that the processor was unable to execute (exitintinfo valid w/
type=4).  The processor indicates that a SWINT was unsuccessful by
filling in the exitintinfo field on an #PF intercept, during a world
switch from SVM/guest mode.  

There were several cases observed during boot of win2000 and
vista/longhorn 64b:

Win2000 -
A VMEXIT_EXCEPTION_PF (#PF intercept) occurs during execution of an "Int
10" instruction.  
The exitintinfo field is properly filled out by the processor containing
type=4/vector=0x10.
The call into paging_fault() to handle the #PF is not resolved
(not_a_shadow_fault/0 returned), so the eventinj information is filled
out in the #PF vmexit handler (to inject later).
The svm_intr_assist() code is executed with both the eventinj, and the
exitininfo fields filled out.
In this case the #PF needs to be injected, ignoring the SWINT in the
exitintinfo fields.

Vista/Longhorn 64b -
Similar to above, but the call into paging_fault() is resolved
(EXCRET_fault_fixed returned), and in this case the SWINT in exitintifo
should also be ignored.

Please apply to xen-unstable.
Applies cleanly to c/s 15651.
Signed-off-by Tom Woller <thomas.woller@amd.com> 

Note that HVM guests will not boot on AMD-V with xen-staging.hg c/s
15652.  
Keir, do you want me to take a look at staging c/s 15652 on AMD-V w/
HVM?

  --Tom

thomas.woller@amd.com  +1-512-602-0059
AMD Corporation - Operating Systems Research Center
5204 E. Ben White Blvd. UBC1
Austin, Texas 78741


[-- Attachment #2: svm_inj_fix_for_hvm_15651.patch --]
[-- Type: application/octet-stream, Size: 549 bytes --]

diff -r 5682f899c7ae xen/arch/x86/hvm/svm/intr.c
--- a/xen/arch/x86/hvm/svm/intr.c	Fri Jul 27 09:06:58 2007 +0100
+++ b/xen/arch/x86/hvm/svm/intr.c	Thu Jul 26 23:14:42 2007 -0500
@@ -93,7 +93,7 @@ asmlinkage void svm_intr_assist(void)
      * occurs (e.g., due to lack of shadow mapping of guest IDT or guest-kernel
      * stack).
      */
-    if ( vmcb->exitintinfo.fields.v )
+    if ( vmcb->exitintinfo.fields.v && (vmcb->exitintinfo.fields.type != 4) )
     {
         vmcb->eventinj = vmcb->exitintinfo;
         vmcb->exitintinfo.bytes = 0;

[-- Attachment #3: Type: text/plain, Size: 138 bytes --]

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-07-31 18:02 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-27 15:31 [PATCH][SVM] HVM fix for SWINT event injection Woller, Thomas
2007-07-27 15:57 ` Keir Fraser
2007-07-30 19:06   ` Woller, Thomas
2007-07-30 21:17     ` Keir Fraser
2007-07-31 15:30       ` Woller, Thomas
2007-07-31 18:02         ` Keir Fraser

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.