Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1338903

Re: [PATCH v8 1/4] firmware: introduce sysfs driver for QEMU's fw_cfg device

From "Michael S. Tsirkin" <mst@redhat.com>
Newsgroups linux.kernel
Subject Re: [PATCH v8 1/4] firmware: introduce sysfs driver for QEMU's fw_cfg device
Date 2016-02-21 19:00 +0100
Message-ID <r4FZx-Tg-21@gated-at.bofh.it> (permalink)
References <qVVK9-4Gz-15@gated-at.bofh.it> <qVVK9-4Gz-13@gated-at.bofh.it> <r4FZw-Tg-13@gated-at.bofh.it> <r4FZw-Tg-19@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Sun, Feb 21, 2016 at 08:06:17AM -0500, Gabriel L. Somlo wrote:
> 
> > 
> > > +#if !(defined(FW_CFG_CTRL_OFF) && defined(FW_CTRL_DATA_OFF))
> > > +# if (defined(CONFIG_ARM) || defined(CONFIG_ARM64))
> > > +#  define FW_CFG_CTRL_OFF 0x08
> > > +#  define FW_CFG_DATA_OFF 0x00
> > > +# elif (defined(CONFIG_PPC_PMAC) || defined(CONFIG_SPARC32)) /* ppc/mac,sun4m */
> > > +#  define FW_CFG_CTRL_OFF 0x00
> > > +#  define FW_CFG_DATA_OFF 0x02
> > > +# elif (defined(CONFIG_X86) || defined(CONFIG_SPARC64)) /* x86, sun4u */
> > > +#  define FW_CFG_CTRL_OFF 0x00
> > > +#  define FW_CFG_DATA_OFF 0x01
> > > +# else
> > > +#  warning "QEMU FW_CFG may not be available on this architecture!"
> > > +#  define FW_CFG_CTRL_OFF 0x00
> > > +#  define FW_CFG_DATA_OFF 0x01
> > 
> > Better not try hacks like this, they are hard
> > to support down the road. Please only list what is tested and
> > actually exposed by QEMU.
> 
> I was looking for a standard way to advertise register offsets within
> the ioport or mmio region assigned to fw_cfg, but right now the answer
> is "there isn't one", and "register offsets are an arch specific
> detail". As such, the only reasonable way I saw was to copy the same
> values used in the QEMU source.
> 
> See also:
> https://lists.gnu.org/archive/html/qemu-devel/2015-11/msg05037.html
>  
> Thanks much,
> --Gabriel

My point is you don't know what will qemu do on these
other arches which do not at the moment have fw cfg.
So don't try to guess!

-- 
MST

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

Re: [PATCH v8 1/4] firmware: introduce sysfs driver for QEMU's  fw_cfg device "Michael S. Tsirkin" <mst@redhat.com> - 2016-02-21 18:30 +0100
  Re: [PATCH v8 1/4] firmware: introduce sysfs driver for QEMU's  fw_cfg device "Gabriel L. Somlo" <somlo@cmu.edu> - 2016-02-21 18:30 +0100
  Re: [PATCH v8 1/4] firmware: introduce sysfs driver for QEMU's  fw_cfg device "Gabriel L. Somlo" <somlo@cmu.edu> - 2016-02-21 18:30 +0100
    Re: [PATCH v8 1/4] firmware: introduce sysfs driver for QEMU's  fw_cfg device "Michael S. Tsirkin" <mst@redhat.com> - 2016-02-21 19:00 +0100
    Re: [PATCH v8 1/4] firmware: introduce sysfs driver for QEMU's  fw_cfg device "Michael S. Tsirkin" <mst@redhat.com> - 2016-02-21 19:10 +0100
    Re: [PATCH v8 1/4] firmware: introduce sysfs driver for QEMU's  fw_cfg device "Michael S. Tsirkin" <mst@redhat.com> - 2016-02-22 21:20 +0100
      Re: [PATCH v8 1/4] firmware: introduce sysfs driver for QEMU's  fw_cfg device "Gabriel L. Somlo" <somlo@cmu.edu> - 2016-02-22 21:30 +0100

csiph-web