From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alexander Graf Subject: Re: [PATCH] slow_map: minor improvements to ROM BAR handling Date: Tue, 22 Dec 2009 16:41:05 +0100 Message-ID: <4B30E891.9050908@suse.de> References: <20091222111044.GA16000@redhat.com> <4B30B603.8080707@suse.de> <20091222124311.GD16165@redhat.com> <4B30CAF2.4040409@suse.de> <20091222151911.GC18541@redhat.com> <4B30E470.2030001@redhat.com> <4B30E4BB.8000507@suse.de> <20091222152806.GA18676@redhat.com> <4B30E783.7080903@suse.de> <4B30E82A.5030702@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: "Michael S. Tsirkin" , kvm@vger.kernel.org To: Avi Kivity Return-path: Received: from cantor.suse.de ([195.135.220.2]:43593 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752043AbZLVPlI (ORCPT ); Tue, 22 Dec 2009 10:41:08 -0500 In-Reply-To: <4B30E82A.5030702@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: Avi Kivity wrote: > On 12/22/2009 05:36 PM, Alexander Graf wrote: >> >>> Is there a way to trap this and fprintf something? >>> >> I don't think so. KVM will just trap on execution outside of RAM and >> either fail badly or throw something bad into the guest. MMIO access >> works by analyzing the instruction that accesses the MMIO address. That >> just doesn't work when we don't have an instruction to analyze. >> > > We could certainly extend emulate.c to fetch instruction bytes from > userspace. It uses ->read_std() now, so we'd need to switch to > ->read_emulated() and add appropriate buffering. I thought the policy on emulate.c was to not have a full instruction emulator but only emulate instructions that do PT modifications or MMIO access? Btw, we're in the same situation with PowerPC here. The instruction emulator is _really_ small. It only does a few MMU specific instructions, a couple of privileged ones and MMIO accessing ones. Alex