public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: "Kamble, Nitin A" <nitin.a.kamble-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
To: "kvm-devel"
	<kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org>
Subject: [PATCH] Handle #SS(0), caused by address size override in vm86 mode
Date: Wed, 16 May 2007 18:11:38 -0700	[thread overview]
Message-ID: <1179364298.21228.6.camel@lnitindesktop.sc.intel.com> (raw)
In-Reply-To: <4649671D.5000705-atKUWr5tajBWk0Htik3J/w@public.gmane.org>


[-- Attachment #1.1.1.1: Type: text/plain, Size: 549 bytes --]

Hi Avi,

I was playing with KVM while booting SuSE Linux 10.1 on it. And I found
it was bailing out with #SS fault. I root caused it to the address size
override opcode (0x67) from a mov instruction from the boot loader.
  The attached patch handles the #SS(0) fault with emulation, letting
guest can proceed further.

Thanks & Regards,
Nitin 
Open Source Technology Center, Intel Corporation.
-------------------------------------------------------------------------
The mind is like a parachute; it works much better when it's open. 

[-- Attachment #1.1.1.2: Type: text/html, Size: 1250 bytes --]

[-- Attachment #1.1.2: ss_fault_handling_in_vm86mode.patch --]
[-- Type: text/x-patch, Size: 921 bytes --]

commit e7ae040a34ae99ac4eb08701b1a54a7e4315238a
Author: Nitin A Kamble <nitin.a.kamble@intel.com>
Date:   Wed May 16 21:05:58 2007 -0700

     Instruction with address size override prefix opcode 0x67
     Cause the #SS fault with 0 error code in VM86 mode.
     <Signed-Off-By: Nitin A Kamble <nitin.a.kamble@intel.com>

diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c
index b1430e1..7d7edb7 100644
--- a/drivers/kvm/vmx.c
+++ b/drivers/kvm/vmx.c
@@ -1487,7 +1487,9 @@ static int handle_rmode_exception(struct kvm_vcpu *vcpu,
 	if (!vcpu->rmode.active)
 		return 0;
 
-	if (vec == GP_VECTOR && err_code == 0)
+    /* Instruction with address size override prefix opcode 0x67
+       Cause the #SS fault with 0 error code in VM86 mode.  */
+	if (((vec == GP_VECTOR) || (vec == SS_VECTOR)) && err_code == 0)
 		if (emulate_instruction(vcpu, NULL, 0, 0) == EMULATE_DONE)
 			return 1;
 	return 0;

[-- Attachment #1.2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 189 bytes --]

[-- Attachment #2: Type: text/plain, Size: 286 bytes --]

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/

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

_______________________________________________
kvm-devel mailing list
kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
https://lists.sourceforge.net/lists/listinfo/kvm-devel

  parent reply	other threads:[~2007-05-17  1:11 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-15  3:27 SDL problem with 2.6.21/kvm-17 on x86_64? Joshua Hoblitt
     [not found] ` <20070515032704.GH31709-yzCOL6m36nBBFM95potWkg@public.gmane.org>
2007-05-15  7:54   ` Avi Kivity
     [not found]     ` <4649671D.5000705-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-05-17  1:11       ` Kamble, Nitin A [this message]
     [not found]         ` <1179364298.21228.6.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org>
2007-05-17 12:51           ` [PATCH] Handle #SS(0), caused by address size override in vm86 mode Avi Kivity

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=1179364298.21228.6.camel@lnitindesktop.sc.intel.com \
    --to=nitin.a.kamble-ral2jqcrhueavxtiumwx3w@public.gmane.org \
    --cc=kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox