From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: Question about EMULATE_DO_MMIO Date: Tue, 16 Oct 2007 22:12:40 +0200 Message-ID: <47151B38.1070402@qumranet.com> References: <1192559057.2488.5.camel@lnitindesktop.sc.intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel To: nitin.a.kamble-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org Return-path: In-Reply-To: <1192559057.2488.5.camel-mpPvwfgnXtFHIUuj5cj4Omt3HXsI98Cx0E9HWUfgJXw@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org Errors-To: kvm-devel-bounces-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org List-Id: kvm.vger.kernel.org Nitin A Kamble wrote: > Hi Avi, > I was trying to avoid vm86 mode completely, by using emulation for > all the real mode code emulation. It is doing better than vm86 mode, Why do you think it is better? I would have thought that vm86 is much faster. I thought of doing it this way: - try to run normally - if vm entry failed due to invalid guest state (the famous 0x80000021), then emulate 50 instructions - repeat That will also handle the few cases where VT can't handle protected mode. > but > I am seeing one issue with this approch. > > The emulator is failing due to this code. Seems like the execution > need to go back to qemu to finish some pending MMIO. > > if (vcpu->mmio_is_write) { > vcpu->mmio_needed = 0; > return EMULATE_DO_MMIO; > } > > Do you have how should it be handled? I am not clear what needs to be > done to handle this situation properly. > It should exit to userspace, same as the non-emulating case. However it shouldn't happen for normal writes. -- Do not meddle in the internals of kernels, for they are subtle and quick to panic. ------------------------------------------------------------------------- This SF.net email is sponsored by: Splunk Inc. Still grepping through log files to find problems? Stop. Now Search log events and configuration files using AJAX and a browser. Download your FREE copy of Splunk now >> http://get.splunk.com/