From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([140.186.70.92]:47026) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qrs68-0004XY-KR for qemu-devel@nongnu.org; Fri, 12 Aug 2011 09:48:29 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Qrs67-0001H2-Ph for qemu-devel@nongnu.org; Fri, 12 Aug 2011 09:48:28 -0400 Received: from mail-yw0-f45.google.com ([209.85.213.45]:48694) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Qrs67-0001Gx-KH for qemu-devel@nongnu.org; Fri, 12 Aug 2011 09:48:27 -0400 Received: by ywf9 with SMTP id 9so2290614ywf.4 for ; Fri, 12 Aug 2011 06:48:27 -0700 (PDT) Message-ID: <4E452F28.5000902@codemonkey.ws> Date: Fri, 12 Aug 2011 08:48:24 -0500 From: Anthony Liguori MIME-Version: 1.0 References: <1312822730-9577-1-git-send-email-avi@redhat.com> <1312822730-9577-3-git-send-email-avi@redhat.com> In-Reply-To: <1312822730-9577-3-git-send-email-avi@redhat.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH 2/3] memory: add API for creating ROM/device regions List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Avi Kivity Cc: qemu-devel@nongnu.org, kvm@vger.kernel.org On 08/08/2011 11:58 AM, Avi Kivity wrote: > ROM/device regions act as mapped RAM for reads, can I/O memory for > writes. This allow emulation of flash devices. > > Signed-off-by: Avi Kivity > --- > memory.c | 46 ++++++++++++++++++++++++++++++++++++++++++++-- > memory.h | 34 ++++++++++++++++++++++++++++++++++ > 2 files changed, 78 insertions(+), 2 deletions(-) > > diff --git a/memory.c b/memory.c > index 5e3d966..beff98c 100644 > --- a/memory.c > +++ b/memory.c > @@ -125,6 +125,7 @@ struct FlatRange { > target_phys_addr_t offset_in_region; > AddrRange addr; > uint8_t dirty_log_mask; > + bool readable; In a follow up, it might be good to add a comment explaining that this whole readable thing is not just an optimization, but a hard requirement for KVM in order to be able to execute code from ROM. Regards, Anthony Liguori