From mboxrd@z Thu Jan 1 00:00:00 1970 From: Aurelien Jarno Subject: KVM: Fix the invlpg instruction emulation on AMD64 Date: Mon, 15 Oct 2007 21:08:24 +0200 Message-ID: <20071015190823.GA11333@hall.aurel32.net> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Return-path: Content-Disposition: inline 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 The patch below removes the check for c->modrm_reg == 7 to detect the invlpg instruction, as it was the case before before commit aa38840d3d2e0a804e628077df8d8879b496d741. This fixes the boot of FreeBSD on an AMD64 CPU. It also moves the assignation of c->src.bytes after the test as it is not needed for the invlpg instruction. Signed-off-by: Aurelien Jarno diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c index fa33fcd..01aa952 100644 --- a/drivers/kvm/x86_emulate.c +++ b/drivers/kvm/x86_emulate.c @@ -824,12 +824,10 @@ modrm_done: c->src.bytes = 4; goto srcmem_common; case SrcMem: - c->src.bytes = (c->d & ByteOp) ? 1 : - c->op_bytes; /* Don't fetch the address for invlpg: it could be unmapped. */ - if (c->twobyte && c->b == 0x01 - && c->modrm_reg == 7) + if (c->twobyte && c->b == 0x01) break; + c->src.bytes = (c->d & ByteOp) ? 1 : c->op_bytes; srcmem_common: c->src.type = OP_MEM; break; -- .''`. Aurelien Jarno | GPG: 1024D/F1BCDB73 : :' : Debian developer | Electrical Engineer `. `' aurel32-8fiUuRrzOP0dnm+yROfE0A@public.gmane.org | aurelien-rXXEIb44qovR7s880joybQ@public.gmane.org `- people.debian.org/~aurel32 | www.aurel32.net ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/