public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Ryan Harper <ryanh-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
Subject: [RFC][PATCH] ignore set_cr3 GP fault in non-pae mode
Date: Tue, 18 Sep 2007 14:05:16 -0500	[thread overview]
Message-ID: <20070918190516.GC7519@us.ibm.com> (raw)

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

Playing around with running VMware-server within a KVM guest and noticed
that whenever we launch a VM within the guest, KVM reports a GP fault in
set_cr3.  Removing the fault injection (raised for attempting to set
reserved bits) for the non-pae case allows memtest to boot and run 
within VMWare Server, running in a KVM Linux guest.

This same test (Linux, VMware-server, booting/running memtest iso) works
fine on bare-metal.  Thoughts?

-- 
Ryan Harper
Software Engineer; Linux Technology Center
IBM Corp., Austin, Tx
(512) 838-9253   T/L: 678-9253
ryanh-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org

[-- Attachment #2: ignore_gp_fault_in_nonpae_paging.patch --]
[-- Type: text/plain, Size: 789 bytes --]


This patch removes the fault injected when the guest attempts to set reserved
bits in cr3.  X86 hardware doesn't generate a fault when setting reserved bits.
The result of this patch is that vmware-server, running within a kvm guest,
boots and runs memtest from an iso.

Signed-off-by: Ryan Harper <ryanh-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>

diff --git a/drivers/kvm/kvm_main.c b/drivers/kvm/kvm_main.c
index 353e585..386f9c1 100644
--- a/drivers/kvm/kvm_main.c
+++ b/drivers/kvm/kvm_main.c
@@ -573,13 +573,6 @@ void set_cr3(struct kvm_vcpu *vcpu, unsigned long cr3)
 				inject_gp(vcpu);
 				return;
 			}
-		} else {
-			if (cr3 & CR3_NONPAE_RESERVED_BITS) {
-				printk(KERN_DEBUG
-				       "set_cr3: #GP, reserved bits\n");
-				inject_gp(vcpu);
-				return;
-			}
 		}
 	}
 

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

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2005.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

[-- Attachment #4: 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

             reply	other threads:[~2007-09-18 19:05 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-18 19:05 Ryan Harper [this message]
     [not found] ` <20070918190516.GC7519-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-09-18 19:15   ` [RFC][PATCH] ignore set_cr3 GP fault in non-pae mode Anthony Liguori
     [not found]     ` <46F023D8.90905-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
2007-09-18 21:21       ` Nakajima, Jun
     [not found]         ` <97D612E30E1F88419025B06CB4CF1BE1037F9013-1a9uaKK1+wJcIJlls4ac1rfspsVTdybXVpNB7YpNyf8@public.gmane.org>
2007-09-18 21:25           ` Ryan Harper
     [not found]             ` <20070918212509.GE7519-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-09-18 21:34               ` Nakajima, Jun
2007-09-18 21:58               ` Zachary Amsden
     [not found]                 ` <1190152700.8353.14.camel-cxY/u30q8FloTgUnLF1by8fTvwmfpRNyZeezCHUQhQ4@public.gmane.org>
2007-09-18 22:03                   ` Ryan Harper
     [not found]                     ` <20070918220308.GF7519-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-09-19  8:57                       ` Avi Kivity
     [not found]                         ` <46F0E46C.1060905-atKUWr5tajBWk0Htik3J/w@public.gmane.org>
2007-09-19 14:55                           ` Ryan Harper
     [not found]                             ` <20070919145536.GH7519-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2007-09-19 15:08                               ` Anthony Liguori
     [not found]                                 ` <46F13B5F.4050107-rdkfGonbjUSkNkDKm+mE6A@public.gmane.org>
2007-09-19 16:01                                   ` Zachary Amsden
     [not found]                                     ` <1190217717.8353.29.camel-cxY/u30q8FloTgUnLF1by8fTvwmfpRNyZeezCHUQhQ4@public.gmane.org>
2007-09-19 16:26                                       ` Avi Kivity
2007-09-19 17:09                               ` Ryan Harper
2007-09-23 12:57   ` 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=20070918190516.GC7519@us.ibm.com \
    --to=ryanh-r/jw6+rmf7hqt0dzr+alfa@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