From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] x86 emulator: Add 'push/pop sreg' instructions Date: Wed, 19 Aug 2009 11:23:16 +0300 Message-ID: <4A8BB674.8000401@redhat.com> References: <1250599685-2351-1-git-send-email-m.gamal005@gmail.com> <4A8ABD19.1000807@redhat.com> <52d4a3890908181240t2cfd696rf1b7a5d99175c0f7@mail.gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: Mohammed Gamal Return-path: Received: from mx2.redhat.com ([66.187.237.31]:51384 "EHLO mx2.redhat.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1751643AbZHSIXU (ORCPT ); Wed, 19 Aug 2009 04:23:20 -0400 In-Reply-To: <52d4a3890908181240t2cfd696rf1b7a5d99175c0f7@mail.gmail.com> Sender: kvm-owner@vger.kernel.org List-ID: On 08/18/2009 10:40 PM, Mohammed Gamal wrote: >> >>> + kvm_x86_ops->set_segment(ctxt->vcpu,&segment, seg); >>> >>> > But we're popping the contents of the stack top to a segment register > which is going to be of 16-bits anyway, so we know the length before > hand, no? > No, the operand size attribute determines the change to rsp. If it's larger than 2 bytes we drop the excess bits. See the documentation of the POP instruction. >> Note some of these instructions are not encodable in long mode; need to >> check for that instead of emulating the wrong instruction. >> > I was under the impression that the emulator doesn't support long mode > yet, is that still the case? > The emulator has always supported long mode, we need it for mmio and pagetable updates. -- error compiling committee.c: too many arguments to function