From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: Kernel Oops with kvm 66 running WinXP Date: Mon, 05 May 2008 15:00:33 +0300 Message-ID: <481EF6E1.1070807@qumranet.com> References: <48131C2A.20307@logix.net.nz> <4814772F.7030708@qumranet.com> <48148382.4040403@qumranet.com> <481E408D.4040501@logix.net.nz> <481EB307.4070604@qumranet.com> <481EEB4A.4060400@logix.net.nz> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------050605000102070504070108" Cc: kvm-devel@lists.sourceforge.net To: Michal Ludvig Return-path: In-Reply-To: <481EEB4A.4060400@logix.net.nz> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org This is a multi-part message in MIME format. --------------050605000102070504070108 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit Michal Ludvig wrote: >>> >>> loaded kvm module (kvm-68) >>> kvm: emulating exchange as write >>> Unable to handle kernel NULL pointer dereference at 0000000000000000 >>> RIP: >>> [] :kvm:x86_emulate_insn+0x3fa/0x4240 >> >> Please apply the attached patch, and post 'dmesg | grep writeback'. > > writeback: b 01 mordm e0 > Ah, it only affects pre-npt, so my testing was worthless. The attached patch should fix. -- error compiling committee.c: too many arguments to function --------------050605000102070504070108 Content-Type: text/x-patch; name="smsw-fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="smsw-fix.patch" diff --git a/kernel/x86_emulate.c b/kernel/x86_emulate.c index f2a696d..8a96320 100644 --- a/kernel/x86_emulate.c +++ b/kernel/x86_emulate.c @@ -677,8 +677,9 @@ static int decode_modrm(struct x86_emulate_ctxt *ctxt, c->use_modrm_ea = 1; if (c->modrm_mod == 3) { - c->modrm_val = *(unsigned long *) - decode_register(c->modrm_rm, c->regs, c->d & ByteOp); + c->modrm_ptr = decode_register(c->modrm_rm, + c->regs, c->d & ByteOp); + c->modrm_val = *(unsigned long *)c->modrm_ptr; return rc; } @@ -1005,6 +1006,7 @@ done_prefixes: if ((c->d & ModRM) && c->modrm_mod == 3) { c->src.type = OP_REG; c->src.val = c->modrm_val; + c->src.ptr = c->modrm_ptr; break; } c->src.type = OP_MEM; @@ -1049,6 +1051,7 @@ done_prefixes: if ((c->d & ModRM) && c->modrm_mod == 3) { c->dst.type = OP_REG; c->dst.val = c->dst.orig_val = c->modrm_val; + c->dst.ptr = c->modrm_ptr; break; } c->dst.type = OP_MEM; diff --git a/include/asm-x86/kvm_x86_emulate.h b/include/asm-x86/kvm_x86_emulate.h index d6337f9..b877bbd 100644 --- a/kernel/include/asm-x86/kvm_x86_emulate.h +++ b/kernel/include/asm-x86/kvm_x86_emulate.h @@ -135,6 +135,7 @@ struct decode_cache { u8 modrm_rm; u8 use_modrm_ea; unsigned long modrm_ea; + void *modrm_ptr; unsigned long modrm_val; struct fetch_cache fetch; }; --------------050605000102070504070108 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone --------------050605000102070504070108 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ kvm-devel mailing list kvm-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/kvm-devel --------------050605000102070504070108--