From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] x86 emulator: Add pop es instruction (opcode 0x07) Date: Thu, 26 Feb 2009 09:13:23 +0200 Message-ID: <49A64113.1020002@redhat.com> References: <20090225213929.GA22725@mohd-laptop> 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]:59029 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751307AbZBZHM5 (ORCPT ); Thu, 26 Feb 2009 02:12:57 -0500 In-Reply-To: <20090225213929.GA22725@mohd-laptop> Sender: kvm-owner@vger.kernel.org List-ID: Mohammed Gamal wrote: > Add pop es instruction > > Hi again... > @@ -1446,6 +1446,9 @@ special_insn: > add: /* add */ > emulate_2op_SrcV("add", c->src, c->dst, ctxt->eflags); > break; > + case 0x07: /* pop es */ > + emulate_pop(ctxt, ops, &c->regs[VCPU_SREG_ES], c->op_bytes); > + break; > case 0x08 ... 0x0d: > or: /* or */ > emulate_2op_SrcV("or", c->src, c->dst, ctxt->eflags); > ... but this is insufficient. You need to load the segment cache, see kvm_load_segment_descriptor(). -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain.