From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: KVM: x86: Push potential exception error code on task switches Date: Wed, 14 Apr 2010 14:37:18 +0200 Message-ID: <4BC5B6FE.8060706@siemens.com> References: <4BC5B0FB.8020700@siemens.com> <4BC5B38C.2040500@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: Marcelo Tosatti , kvm , Gleb Natapov To: Avi Kivity Return-path: Received: from thoth.sbs.de ([192.35.17.2]:24773 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754448Ab0DNMhe (ORCPT ); Wed, 14 Apr 2010 08:37:34 -0400 In-Reply-To: <4BC5B38C.2040500@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Avi Kivity wrote: > On 04/14/2010 03:11 PM, Jan Kiszka wrote: >> When a fault triggers a task switch, the error code, if it exists, has >> to be pushed on the new task's stack. Implement the missing bits. >> >> >> @@ -2416,12 +2417,23 @@ static int emulator_do_task_switch(struct x86_emulate_ctxt *ctxt, >> ops->set_cached_descriptor(&next_tss_desc, VCPU_SREG_TR, ctxt->vcpu); >> ops->set_segment_selector(tss_selector, VCPU_SREG_TR, ctxt->vcpu); >> >> + if (ret == X86EMUL_CONTINUE&& has_error_code) { >> + struct decode_cache *c =&ctxt->decode; >> + >> + c->op_bytes = c->ad_bytes = (next_tss_desc.type& 8) ? 4 : 2; >> > > Don't these depend on the attributes of the segment as well? Not on the segment, but actually on the gate size. Will fix. Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux