Re: [PATCH v15 11/11] RFC: fw_cfg: do DMA read operation

2018-02-28 Thread Marc-André Lureau
Hi On Wed, Feb 28, 2018 at 6:17 PM, Michael S. Tsirkin wrote: > On Wed, Feb 28, 2018 at 04:41:51PM +0100, Marc-André Lureau wrote: >> I don't know if it's always safe to enable dma in read_raw(), how >> could we know? Is there a check we could use to choose one or ther >> other

Re: [PATCH v15 11/11] RFC: fw_cfg: do DMA read operation

2018-02-28 Thread Marc-André Lureau
Hi On Wed, Feb 28, 2018 at 6:17 PM, Michael S. Tsirkin wrote: > On Wed, Feb 28, 2018 at 04:41:51PM +0100, Marc-André Lureau wrote: >> I don't know if it's always safe to enable dma in read_raw(), how >> could we know? Is there a check we could use to choose one or ther >> other (and thus

Re: [PATCH v15 11/11] RFC: fw_cfg: do DMA read operation

2018-02-28 Thread Michael S. Tsirkin
On Wed, Feb 28, 2018 at 04:41:51PM +0100, Marc-André Lureau wrote: > I don't know if it's always safe to enable dma in read_raw(), how > could we know? Is there a check we could use to choose one or ther > other (and thus avoiding explicit dma/readfn argument)? IMHO the way to go is not to try to

Re: [PATCH v15 11/11] RFC: fw_cfg: do DMA read operation

2018-02-28 Thread Michael S. Tsirkin
On Wed, Feb 28, 2018 at 04:41:51PM +0100, Marc-André Lureau wrote: > I don't know if it's always safe to enable dma in read_raw(), how > could we know? Is there a check we could use to choose one or ther > other (and thus avoiding explicit dma/readfn argument)? IMHO the way to go is not to try to

Re: [PATCH v15 11/11] RFC: fw_cfg: do DMA read operation

2018-02-28 Thread Michael S. Tsirkin
On Wed, Feb 28, 2018 at 05:00:58PM +0100, Marc-André Lureau wrote: > Hi > > On Wed, Feb 28, 2018 at 4:48 PM, Michael S. Tsirkin wrote: > > On Wed, Feb 28, 2018 at 04:41:51PM +0100, Marc-André Lureau wrote: > >> I don't know if it's always safe to enable dma in read_raw(), how >

Re: [PATCH v15 11/11] RFC: fw_cfg: do DMA read operation

2018-02-28 Thread Michael S. Tsirkin
On Wed, Feb 28, 2018 at 05:00:58PM +0100, Marc-André Lureau wrote: > Hi > > On Wed, Feb 28, 2018 at 4:48 PM, Michael S. Tsirkin wrote: > > On Wed, Feb 28, 2018 at 04:41:51PM +0100, Marc-André Lureau wrote: > >> I don't know if it's always safe to enable dma in read_raw(), how > >> could we know?

Re: [PATCH v15 11/11] RFC: fw_cfg: do DMA read operation

2018-02-28 Thread Marc-André Lureau
Hi On Wed, Feb 28, 2018 at 4:48 PM, Michael S. Tsirkin wrote: > On Wed, Feb 28, 2018 at 04:41:51PM +0100, Marc-André Lureau wrote: >> I don't know if it's always safe to enable dma in read_raw(), how >> could we know? Is there a check we could use to choose one or ther >> other

Re: [PATCH v15 11/11] RFC: fw_cfg: do DMA read operation

2018-02-28 Thread Marc-André Lureau
Hi On Wed, Feb 28, 2018 at 4:48 PM, Michael S. Tsirkin wrote: > On Wed, Feb 28, 2018 at 04:41:51PM +0100, Marc-André Lureau wrote: >> I don't know if it's always safe to enable dma in read_raw(), how >> could we know? Is there a check we could use to choose one or ther >> other (and thus

Re: [PATCH v15 11/11] RFC: fw_cfg: do DMA read operation

2018-02-28 Thread Michael S. Tsirkin
On Wed, Feb 28, 2018 at 04:41:51PM +0100, Marc-André Lureau wrote: > I don't know if it's always safe to enable dma in read_raw(), how > could we know? Is there a check we could use to choose one or ther > other (and thus avoiding explicit dma/readfn argument)? I'm not sure - but does it really

Re: [PATCH v15 11/11] RFC: fw_cfg: do DMA read operation

2018-02-28 Thread Michael S. Tsirkin
On Wed, Feb 28, 2018 at 04:41:51PM +0100, Marc-André Lureau wrote: > I don't know if it's always safe to enable dma in read_raw(), how > could we know? Is there a check we could use to choose one or ther > other (and thus avoiding explicit dma/readfn argument)? I'm not sure - but does it really

Re: [PATCH v15 11/11] RFC: fw_cfg: do DMA read operation

2018-02-28 Thread Marc-André Lureau
On Wed, Feb 28, 2018 at 4:35 PM, Michael S. Tsirkin wrote: > On Wed, Feb 28, 2018 at 01:27:02PM +0100, Marc-André Lureau wrote: >> Hi >> >> On Tue, Feb 27, 2018 at 1:04 AM, Michael S. Tsirkin wrote: >> > On Thu, Feb 15, 2018 at 10:33:12PM +0100, Marc-André

Re: [PATCH v15 11/11] RFC: fw_cfg: do DMA read operation

2018-02-28 Thread Marc-André Lureau
On Wed, Feb 28, 2018 at 4:35 PM, Michael S. Tsirkin wrote: > On Wed, Feb 28, 2018 at 01:27:02PM +0100, Marc-André Lureau wrote: >> Hi >> >> On Tue, Feb 27, 2018 at 1:04 AM, Michael S. Tsirkin wrote: >> > On Thu, Feb 15, 2018 at 10:33:12PM +0100, Marc-André Lureau wrote: >> >> Modify

Re: [PATCH v15 11/11] RFC: fw_cfg: do DMA read operation

2018-02-28 Thread Michael S. Tsirkin
On Wed, Feb 28, 2018 at 01:27:02PM +0100, Marc-André Lureau wrote: > Hi > > On Tue, Feb 27, 2018 at 1:04 AM, Michael S. Tsirkin wrote: > > On Thu, Feb 15, 2018 at 10:33:12PM +0100, Marc-André Lureau wrote: > >> Modify fw_cfg_read_blob() to use DMA if the device supports it. > >>

Re: [PATCH v15 11/11] RFC: fw_cfg: do DMA read operation

2018-02-28 Thread Michael S. Tsirkin
On Wed, Feb 28, 2018 at 01:27:02PM +0100, Marc-André Lureau wrote: > Hi > > On Tue, Feb 27, 2018 at 1:04 AM, Michael S. Tsirkin wrote: > > On Thu, Feb 15, 2018 at 10:33:12PM +0100, Marc-André Lureau wrote: > >> Modify fw_cfg_read_blob() to use DMA if the device supports it. > >> Return errors,

Re: [PATCH v15 11/11] RFC: fw_cfg: do DMA read operation

2018-02-28 Thread Marc-André Lureau
Hi On Tue, Feb 27, 2018 at 1:04 AM, Michael S. Tsirkin wrote: > On Thu, Feb 15, 2018 at 10:33:12PM +0100, Marc-André Lureau wrote: >> Modify fw_cfg_read_blob() to use DMA if the device supports it. >> Return errors, because the operation may fail. >> >> So far, only one call in

Re: [PATCH v15 11/11] RFC: fw_cfg: do DMA read operation

2018-02-28 Thread Marc-André Lureau
Hi On Tue, Feb 27, 2018 at 1:04 AM, Michael S. Tsirkin wrote: > On Thu, Feb 15, 2018 at 10:33:12PM +0100, Marc-André Lureau wrote: >> Modify fw_cfg_read_blob() to use DMA if the device supports it. >> Return errors, because the operation may fail. >> >> So far, only one call in

Re: [PATCH v15 11/11] RFC: fw_cfg: do DMA read operation

2018-02-26 Thread Michael S. Tsirkin
On Thu, Feb 15, 2018 at 10:33:12PM +0100, Marc-André Lureau wrote: > Modify fw_cfg_read_blob() to use DMA if the device supports it. > Return errors, because the operation may fail. > > So far, only one call in fw_cfg_register_dir_entries() is using > kmalloc'ed buf and is thus clearly eligible

Re: [PATCH v15 11/11] RFC: fw_cfg: do DMA read operation

2018-02-26 Thread Michael S. Tsirkin
On Thu, Feb 15, 2018 at 10:33:12PM +0100, Marc-André Lureau wrote: > Modify fw_cfg_read_blob() to use DMA if the device supports it. > Return errors, because the operation may fail. > > So far, only one call in fw_cfg_register_dir_entries() is using > kmalloc'ed buf and is thus clearly eligible

[PATCH v15 11/11] RFC: fw_cfg: do DMA read operation

2018-02-15 Thread Marc-André Lureau
Modify fw_cfg_read_blob() to use DMA if the device supports it. Return errors, because the operation may fail. So far, only one call in fw_cfg_register_dir_entries() is using kmalloc'ed buf and is thus clearly eligible to DMA read. Initially, I didn't implement DMA read to speed up boot time,

[PATCH v15 11/11] RFC: fw_cfg: do DMA read operation

2018-02-15 Thread Marc-André Lureau
Modify fw_cfg_read_blob() to use DMA if the device supports it. Return errors, because the operation may fail. So far, only one call in fw_cfg_register_dir_entries() is using kmalloc'ed buf and is thus clearly eligible to DMA read. Initially, I didn't implement DMA read to speed up boot time,