From: Keir Fraser Subject: Re: [PATCH] x86_emulate adjustments Date: Fri, 05 Jan 2007 14:34:02 +0000 Message-ID: References: <459E4B54.76E4.0078.0@novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <459E4B54.76E4.0078.0@novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Jan Beulich Cc: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On 5/1/07 11:57, "Jan Beulich" wrote: >> I already got the mis-emulation of x86/64 PUSH/POP with operand-size >> override. The stacksz thing I would do differently -- extend the mode input >> field to have an extra stack-address-size field. There's another thing >> that's not right at the moment -- I think on POP we have to calculate the >> operand effective address after adjusting the stack pointer? That is broken >> right now which is not a good thing. :-) > > The patch sent actually fixes that. Oh yes, that's neat. But it should increment the effective address by op_bytes not by stacksz. stacksz only specifies the stack pointer's width, not stack data size. > I finally also want the main one fixed. And yes, there are problems with the > prefix decoding, which can possibly be ignored when emulation pv guest insns, > but which (in my opinion) should match hardware behavior 1:1 for hvm guests. I don't see any problem with the existing code w.r.t. what is architecturally supported. REX byte must come after all prefix bytes, and Intel says that only 4 prefix bytes are allowed. REPNE is not a valid prefix on any instruction that the emulator currently supports. If instructions are outside these defined boundaries we must have some scope for interpretation? -- Keir