From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50760) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXrmG-0007Pg-8A for qemu-devel@nongnu.org; Mon, 22 Feb 2016 09:48:00 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXrmC-0001el-2a for qemu-devel@nongnu.org; Mon, 22 Feb 2016 09:47:56 -0500 Received: from mail-qg0-x233.google.com ([2607:f8b0:400d:c04::233]:32895) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXrmB-0001ef-PS for qemu-devel@nongnu.org; Mon, 22 Feb 2016 09:47:51 -0500 Received: by mail-qg0-x233.google.com with SMTP id b35so112057766qge.0 for ; Mon, 22 Feb 2016 06:47:51 -0800 (PST) Date: Mon, 22 Feb 2016 09:47:49 -0500 From: Kevin O'Connor Message-ID: <20160222144749.GA6977@morn.lan> References: <1456144729-17196-1-git-send-email-mst@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1456144729-17196-1-git-send-email-mst@redhat.com> Subject: Re: [Qemu-devel] [PATCH RFC] fw-cfg: support writeable blobs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: "Michael S. Tsirkin" Cc: Peter Maydell , Eduardo Habkost , Shannon Zhao , qemu-devel@nongnu.org, Michael Walle , qemu-arm@nongnu.org, Paolo Bonzini , Igor Mammedov , Richard Henderson On Mon, Feb 22, 2016 at 02:41:38PM +0200, Michael S. Tsirkin wrote: > Useful to send guest data back to QEMU. > The write interface is restricted to DMA. > > Suggested-by: Kevin O'Connor > Signed-off-by: Michael S. Tsirkin > --- > > hw/lm32/lm32_hwsetup.h | 2 +- > include/hw/loader.h | 4 ++-- > include/hw/nvram/fw_cfg.h | 3 ++- > hw/arm/virt-acpi-build.c | 2 +- > hw/core/loader.c | 19 ++++++++++++------- > hw/i386/acpi-build.c | 4 ++-- > hw/nvram/fw_cfg.c | 36 ++++++++++++++++++++++++++++-------- > 7 files changed, 48 insertions(+), 22 deletions(-) > > diff --git a/hw/lm32/lm32_hwsetup.h b/hw/lm32/lm32_hwsetup.h > index 838754d..805b445 100644 > --- a/hw/lm32/lm32_hwsetup.h > +++ b/hw/lm32/lm32_hwsetup.h > @@ -74,7 +74,7 @@ static inline void hwsetup_create_rom(HWSetup *hw, > hwaddr base) > { > rom_add_blob("hwsetup", hw->data, TARGET_PAGE_SIZE, > - TARGET_PAGE_SIZE, base, NULL, NULL, NULL); > + TARGET_PAGE_SIZE, base, NULL, NULL, NULL, true); > } Instead of supporting "writable blobs", I wonder if it would be simpler for both firmware and qemu to implement an "ioctl" like interface. That is, just directly invoke a new fw_cfg callback from fw_cfg_dma_transfer() with the data obtained via dma_memory_read(). I think that may be more flexible because then the QEMU code doesn't have to check for changes to a blob - it would instead be immediately invoked upon a change. -Kevin