From mboxrd@z Thu Jan 1 00:00:00 1970 From: Sheng Yang Subject: Re: [PATCH 1/2] KVM: x86 emulator: modify 'cmpxchg8b', 'lods', 'stos' to not depend on CR2 Date: Fri, 16 Nov 2007 10:11:52 +0800 Message-ID: <200711161011.52228.sheng.yang@intel.com> References: <200711151531.50461.sheng.yang@intel.com> <473C19EA.80804@qumranet.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org To: Avi Kivity Return-path: In-Reply-To: <473C19EA.80804-atKUWr5tajBWk0Htik3J/w@public.gmane.org> 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 On Thursday 15 November 2007 18:05:30 Avi Kivity wrote: > Sheng Yang wrote: > > From c7b60a362930679e24df27e6a412cdbdf1a55f69 Mon Sep 17 00:00:00 2001 > > From: Sheng Yang > > Date: Thu, 15 Nov 2007 14:52:28 +0800 > > Subject: [PATCH 1/2] KVM: x86 emulator: modify 'cmpxchg8b', 'lods', > > 'stos' to not depend on CR2 > > > > The current 'lods' and 'stos' is depending on incoming CR2 rather than > > decode memory address from registers. > > Applied, thanks. > > > diff --git a/drivers/kvm/x86_emulate.c b/drivers/kvm/x86_emulate.c > > index dfcbda5..c020010 100644 > > --- a/drivers/kvm/x86_emulate.c > > +++ b/drivers/kvm/x86_emulate.c > > @@ -214,7 +214,8 @@ static u16 twobyte_table[256] = { > > 0, 0, ByteOp | DstReg | SrcMem | ModRM | Mov, > > DstReg | SrcMem16 | ModRM | Mov, > > /* 0xC0 - 0xCF */ > > - 0, 0, 0, DstMem | SrcReg | ModRM | Mov, 0, 0, 0, ImplicitOps | ModRM, > > + 0, 0, 0, DstMem | SrcReg | ModRM | Mov, > > + 0, 0, 0, ImplicitOps | ModRM | MemAbs, > > 0, 0, 0, 0, 0, 0, 0, 0, > > /* 0xD0 - 0xDF */ > > 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, > > Dropped this part: ModRM and MemAbs are mutually exclusive. MemAbs is > where you have an absolute address in the instruction that is not > encoded with mod r/m. > > Didn't see anything else about cmpchg{8,16}b. Is something missing? In fact, this was about cmpchg{8,16}b. And yes, you're right. I miss that. Only ModRM is needed. -- Thanks Yang, Sheng ------------------------------------------------------------------------- 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/