From mboxrd@z Thu Jan 1 00:00:00 1970 From: Razvan Cojocaru Subject: Re: [PATCH RFC 1/9] xen: Emulate with no writes; compute current instruction length Date: Thu, 03 Jul 2014 10:38:18 +0300 Message-ID: <53B5086A.8060002@bitdefender.com> References: <1404308041-15461-1-git-send-email-rcojocaru@bitdefender.com> <53B43FA1020000780001FA92@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <53B43FA1020000780001FA92@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: tim@xen.org, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On 07/02/2014 06:21 PM, Jan Beulich wrote: >> +void hvm_emulate_one_full(bool_t nowrite) >> +{ >> + struct hvm_emulate_ctxt ctx[1] = {}; >> + int rc = X86EMUL_RETRY; >> + >> + hvm_emulate_prepare(ctx, guest_cpu_user_regs()); >> + >> + while ( rc == X86EMUL_RETRY ) >> + { >> + if ( nowrite ) >> + rc = hvm_emulate_one_no_write(ctx); >> + else >> + rc = hvm_emulate_one(ctx); >> + } >> + >> + switch ( rc ) >> + { >> + case X86EMUL_UNHANDLEABLE: >> + hvm_inject_hw_exception(TRAP_invalid_op, HVM_DELIVER_NO_ERROR_CODE); > > Is it certain that #UD is always the right exception here? I'll make that configurable (extra parameters to hvm_emulate_one_full()), would that work for you? Thanks, Razvan Cojocaru