From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48094) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aXvx7-0008Gc-6Z for qemu-devel@nongnu.org; Mon, 22 Feb 2016 14:15:26 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aXvx6-0007Gu-8L for qemu-devel@nongnu.org; Mon, 22 Feb 2016 14:15:25 -0500 Date: Mon, 22 Feb 2016 21:15:13 +0200 From: "Michael S. Tsirkin" Message-ID: <20160222211352-mutt-send-email-mst@redhat.com> References: <1456144729-17196-1-git-send-email-mst@redhat.com> <20160222144749.GA6977@morn.lan> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160222144749.GA6977@morn.lan> Subject: Re: [Qemu-devel] [PATCH RFC] fw-cfg: support writeable blobs List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Kevin O'Connor 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 09:47:49AM -0500, Kevin O'Connor wrote: > 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 So far, I didn't see any need to invoke callbacks. All users seem happy with simply using data written by guest. OTOH if there's no blob to write, users need to add code to migrate it manually, blobs are migrated automatically. -- MST