qemu-arm
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-arm] [PATCH RFC] fw-cfg: support writeable blobs


From: Michael S. Tsirkin
Subject: Re: [Qemu-arm] [PATCH RFC] fw-cfg: support writeable blobs
Date: Mon, 22 Feb 2016 21:15:13 +0200

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 <address@hidden>
> > Signed-off-by: Michael S. Tsirkin <address@hidden>
> > ---
> > 
> >  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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]