public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [RFT] Possible fix for 32-bit guests
@ 2007-03-28 18:08 Avi Kivity
  0 siblings, 0 replies; only message in thread
From: Avi Kivity @ 2007-03-28 18:08 UTC (permalink / raw)
  To: kvm-devel

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

Attached is a patch that fixes problems with 32-bit guests on 64-bit 
hosts.  For example, I got damn small linux 0.4.10 to boot with this; 
previously it segfaulted during init.

If you have issues with 32-bit guests, please test with this patch and 
report.  Even if you don't have any issues, testing your usual guests is 
appreciated.

-- 
error compiling committee.c: too many arguments to function


[-- Attachment #2: kvm-bitop-fix.patch --]
[-- Type: text/x-patch, Size: 624 bytes --]

diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c
index 7513cdd..daff430 100644
--- a/drivers/kvm/x86_emulate.c
+++ b/drivers/kvm/x86_emulate.c
@@ -832,10 +832,8 @@ done_prefixes:
 		dst.type = OP_MEM;
 		dst.ptr = (unsigned long *)cr2;
 		dst.bytes = (d & ByteOp) ? 1 : op_bytes;
-		if (d & BitOp) {
-			dst.ptr += src.val / BITS_PER_LONG;
-			dst.bytes = sizeof(long);
-		}
+		if (d & BitOp)
+			dst.ptr += src.val / (dst.bytes * 8);
 		if (!(d & Mov) && /* optimisation - avoid slow emulated read */
 		    ((rc = ops->read_emulated((unsigned long)dst.ptr,
 					      &dst.val, dst.bytes, ctxt)) != 0))

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

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV

[-- 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

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2007-03-28 18:08 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-03-28 18:08 [RFT] Possible fix for 32-bit guests Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox