From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH 19/24] KVM: x86 emulator: fix in/out emulation. Date: Wed, 10 Mar 2010 11:12:34 +0200 Message-ID: <4B976282.70406@redhat.com> References: <1268143762-4000-1-git-send-email-gleb@redhat.com> <1268143762-4000-20-git-send-email-gleb@redhat.com> <4B965F7C.5070407@redhat.com> <20100309180938.GE9066@redhat.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: Gleb Natapov Return-path: Received: from mx1.redhat.com ([209.132.183.28]:57589 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751142Ab0CJJMg (ORCPT ); Wed, 10 Mar 2010 04:12:36 -0500 Received: from int-mx08.intmail.prod.int.phx2.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2A9CalX010723 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK) for ; Wed, 10 Mar 2010 04:12:36 -0500 Received: from cleopatra.tlv.redhat.com (cleopatra.tlv.redhat.com [10.35.255.11]) by int-mx08.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2A9CYUE006024 for ; Wed, 10 Mar 2010 04:12:35 -0500 In-Reply-To: <20100309180938.GE9066@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On 03/09/2010 08:09 PM, Gleb Natapov wrote: > >> We don't want to enter the emulator for non-string in/out. Leftover >> test code? >> >> > No, unfortunately this is not leftover. I just don't see a way how we > can bypass emulator and still have emulator be able to emulate in/out > (for big real mode for instance). The problem is basically described in > the commit message. If we have function outside of emulator that does > in/out emulation on vcpu directly, then emulator can't use it since > committing shadowed registers will overwrite the result of emulation. > Having two different emulations (one outside of emulator and another in > emulator) is also problematic since when userspace returns after IO exit > we don't know which emulation to continue. If we want to avoid > instruction decoding we can fill in emulation context from exit info as > if instruction was already decoded and call emulator. > > Alternatively, another entry point would be fine. in/out is a fast path (used for virtio for example). -- error compiling committee.c: too many arguments to function