From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: [RFT] Possible fix for 32-bit guests Date: Wed, 28 Mar 2007 20:08:15 +0200 Message-ID: <460AAF0F.3060905@qumranet.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------090709090600060903060700" To: kvm-devel Return-path: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org This is a multi-part message in MIME format. --------------090709090600060903060700 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 --------------090709090600060903060700 Content-Type: text/x-patch; name="kvm-bitop-fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="kvm-bitop-fix.patch" 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)) --------------090709090600060903060700 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- 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 --------------090709090600060903060700 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/kvm-devel --------------090709090600060903060700--