Re: [PATCH] fw_cfg: don't use DMA mapping for fw_cfg device

2018-01-15 Thread Marc-Andre Lureau
Hi On Mon, Jan 15, 2018 at 9:55 AM, Peter Xu wrote: > fw_cfg device does not need IOMMU protection, so use physical addresses > always. That's how QEMU implements fw_cfg. Otherwise we'll see call > traces during boot when vIOMMU is enabled in guest: > > [1.018306]

Re: [PATCH v11 4/4] fw_cfg: write vmcoreinfo details

2018-02-02 Thread Marc-Andre Lureau
Hi On Fri, Feb 2, 2018 at 3:44 AM, Michael S. Tsirkin wrote: > On Thu, Feb 01, 2018 at 02:03:00PM +0100, Marc-André Lureau wrote: >> @@ -314,6 +359,37 @@ struct fw_cfg_sysfs_entry { >> struct device *dev; >> }; >> >> +#ifdef CONFIG_CRASH_CORE >> +static ssize_t

Re: [PATCH v13 3/4] fw_cfg: write vmcoreinfo details

2018-02-12 Thread Marc-Andre Lureau
Hi On Mon, Feb 12, 2018 at 4:43 AM, Michael S. Tsirkin wrote: > On Wed, Feb 07, 2018 at 02:35:24AM +0100, Marc-André Lureau wrote: >> If the "etc/vmcoreinfo" fw_cfg file is present and we are not running >> the kdump kernel, write the addr/size of the vmcoreinfo ELF note. >> >>

Re: [PATCH v13 4/4] RFC: fw_cfg: do DMA read operation

2018-02-12 Thread Marc-Andre Lureau
Hi On Mon, Feb 12, 2018 at 4:30 AM, Michael S. Tsirkin wrote: > On Wed, Feb 07, 2018 at 02:35:25AM +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 v13 3/4] fw_cfg: write vmcoreinfo details

2018-02-13 Thread Marc-Andre Lureau
On Tue, Feb 13, 2018 at 4:19 PM, Michael S. Tsirkin <m...@redhat.com> wrote: > On Tue, Feb 13, 2018 at 04:16:08PM +0100, Marc-Andre Lureau wrote: >> Hi >> >> On Tue, Feb 13, 2018 at 3:27 PM, Michael S. Tsirkin <m...@redhat.com> wrote: >> > On Tue, Fe

Re: [PATCH v13 3/4] fw_cfg: write vmcoreinfo details

2018-02-13 Thread Marc-Andre Lureau
Hi On Mon, Feb 12, 2018 at 10:00 PM, Michael S. Tsirkin <m...@redhat.com> wrote: > On Mon, Feb 12, 2018 at 11:04:49AM +0100, Marc-Andre Lureau wrote: >> >> +} >> >> + >> >> +/* qemu fw_cfg device is sync today, but spec says it may become async */ >

Re: [PATCH v13 3/4] fw_cfg: write vmcoreinfo details

2018-02-13 Thread Marc-Andre Lureau
Hi On Tue, Feb 13, 2018 at 3:27 PM, Michael S. Tsirkin <m...@redhat.com> wrote: > On Tue, Feb 13, 2018 at 03:14:03PM +0100, Marc-Andre Lureau wrote: >> Hi >> >> On Mon, Feb 12, 2018 at 10:00 PM, Michael S. Tsirkin <m...@redhat.com> wrote: >> > On Mon, Fe

Re: [PATCH v14 9/9] RFC: fw_cfg: do DMA read operation

2018-02-14 Thread Marc-Andre Lureau
Hi On Wed, Feb 14, 2018 at 5:59 PM, Michael S. Tsirkin <m...@redhat.com> wrote: > On Wed, Feb 14, 2018 at 05:52:10PM +0100, Marc-Andre Lureau wrote: >> >> @@ -282,8 +320,9 @@ static int fw_cfg_do_platform_probe(struct >> >> platform_device *pdev) >> >&g

Re: [PATCH v14 9/9] RFC: fw_cfg: do DMA read operation

2018-02-14 Thread Marc-Andre Lureau
Hi On Wed, Feb 14, 2018 at 5:48 PM, Michael S. Tsirkin wrote: > On Wed, Feb 14, 2018 at 03:18:50PM +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 v14 2/9] fw_cfg: add a public uapi header

2018-02-15 Thread Marc-Andre Lureau
Hi On Wed, Feb 14, 2018 at 9:41 PM, Michael S. Tsirkin wrote: > On Wed, Feb 14, 2018 at 03:18:43PM +0100, Marc-André Lureau wrote: >> Create a common header file for well-known values and structures to be >> shared by the Linux kernel with qemu or other projects. >> >>

Re: [PATCH v14 3/9] fw_cfg: fix sparse warnings in fw_cfg_sel_endianness()

2018-02-15 Thread Marc-Andre Lureau
On Wed, Feb 14, 2018 at 9:46 PM, Michael S. Tsirkin wrote: > On Wed, Feb 14, 2018 at 03:18:44PM +0100, Marc-André Lureau wrote: >> The function is used for both LE & BE target type, use __force casting. >> >> Fixes: >> $ make C=1 CF=-D__CHECK_ENDIAN__

Re: [PATCH v14 2/9] fw_cfg: add a public uapi header

2018-02-15 Thread Marc-Andre Lureau
Hi On Wed, Feb 14, 2018 at 8:37 PM, Michael S. Tsirkin wrote: > On Wed, Feb 14, 2018 at 03:18:43PM +0100, Marc-André Lureau wrote: >> Create a common header file for well-known values and structures to be >> shared by the Linux kernel with qemu or other projects. >> >>

Re: [PATCH v10 2/4] fw_cfg: do DMA read operation

2018-01-24 Thread Marc-Andre Lureau
Hi On Wed, Jan 24, 2018 at 4:25 AM, Peter Xu wrote: > On Tue, Jan 23, 2018 at 05:40:39PM +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. >> >> The DMA operation is expected to

Re: [PATCH v14 9/9] RFC: fw_cfg: do DMA read operation

2018-02-14 Thread Marc-Andre Lureau
Hi On Wed, Feb 14, 2018 at 5:48 PM, Michael S. Tsirkin wrote: > On Wed, Feb 14, 2018 at 03:18:50PM +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 v14 9/9] RFC: fw_cfg: do DMA read operation

2018-02-14 Thread Marc-Andre Lureau
Hi On Wed, Feb 14, 2018 at 5:59 PM, Michael S. Tsirkin wrote: > On Wed, Feb 14, 2018 at 05:52:10PM +0100, Marc-Andre Lureau wrote: >> >> @@ -282,8 +320,9 @@ static int fw_cfg_do_platform_probe(struct >> >> platform_device *pdev) >> >> #endif >> >

Re: [PATCH v14 2/9] fw_cfg: add a public uapi header

2018-02-15 Thread Marc-Andre Lureau
Hi On Wed, Feb 14, 2018 at 9:41 PM, Michael S. Tsirkin wrote: > On Wed, Feb 14, 2018 at 03:18:43PM +0100, Marc-André Lureau wrote: >> Create a common header file for well-known values and structures to be >> shared by the Linux kernel with qemu or other projects. >> >> Suggested-by: Michael S.

Re: [PATCH v14 2/9] fw_cfg: add a public uapi header

2018-02-15 Thread Marc-Andre Lureau
Hi On Wed, Feb 14, 2018 at 8:37 PM, Michael S. Tsirkin wrote: > On Wed, Feb 14, 2018 at 03:18:43PM +0100, Marc-André Lureau wrote: >> Create a common header file for well-known values and structures to be >> shared by the Linux kernel with qemu or other projects. >> >> Suggested-by: Michael S.

Re: [PATCH v14 3/9] fw_cfg: fix sparse warnings in fw_cfg_sel_endianness()

2018-02-15 Thread Marc-Andre Lureau
On Wed, Feb 14, 2018 at 9:46 PM, Michael S. Tsirkin wrote: > On Wed, Feb 14, 2018 at 03:18:44PM +0100, Marc-André Lureau wrote: >> The function is used for both LE & BE target type, use __force casting. >> >> Fixes: >> $ make C=1 CF=-D__CHECK_ENDIAN__ drivers/firmware/qemu_fw_cfg.o >> >>

Re: [PATCH v11 4/4] fw_cfg: write vmcoreinfo details

2018-02-02 Thread Marc-Andre Lureau
Hi On Fri, Feb 2, 2018 at 3:44 AM, Michael S. Tsirkin wrote: > On Thu, Feb 01, 2018 at 02:03:00PM +0100, Marc-André Lureau wrote: >> @@ -314,6 +359,37 @@ struct fw_cfg_sysfs_entry { >> struct device *dev; >> }; >> >> +#ifdef CONFIG_CRASH_CORE >> +static ssize_t write_vmcoreinfo(struct

Re: [PATCH v13 3/4] fw_cfg: write vmcoreinfo details

2018-02-12 Thread Marc-Andre Lureau
Hi On Mon, Feb 12, 2018 at 4:43 AM, Michael S. Tsirkin wrote: > On Wed, Feb 07, 2018 at 02:35:24AM +0100, Marc-André Lureau wrote: >> If the "etc/vmcoreinfo" fw_cfg file is present and we are not running >> the kdump kernel, write the addr/size of the vmcoreinfo ELF note. >> >> The DMA operation

Re: [PATCH v13 4/4] RFC: fw_cfg: do DMA read operation

2018-02-12 Thread Marc-Andre Lureau
Hi On Mon, Feb 12, 2018 at 4:30 AM, Michael S. Tsirkin wrote: > On Wed, Feb 07, 2018 at 02:35:25AM +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 v13 3/4] fw_cfg: write vmcoreinfo details

2018-02-13 Thread Marc-Andre Lureau
Hi On Mon, Feb 12, 2018 at 10:00 PM, Michael S. Tsirkin wrote: > On Mon, Feb 12, 2018 at 11:04:49AM +0100, Marc-Andre Lureau wrote: >> >> +} >> >> + >> >> +/* qemu fw_cfg device is sync today, but spec says it may become async */ >> >> +stati

Re: [PATCH v13 3/4] fw_cfg: write vmcoreinfo details

2018-02-13 Thread Marc-Andre Lureau
Hi On Tue, Feb 13, 2018 at 3:27 PM, Michael S. Tsirkin wrote: > On Tue, Feb 13, 2018 at 03:14:03PM +0100, Marc-Andre Lureau wrote: >> Hi >> >> On Mon, Feb 12, 2018 at 10:00 PM, Michael S. Tsirkin wrote: >> > On Mon, Feb 12, 2018 at 11:04:49AM

Re: [PATCH v13 3/4] fw_cfg: write vmcoreinfo details

2018-02-13 Thread Marc-Andre Lureau
On Tue, Feb 13, 2018 at 4:19 PM, Michael S. Tsirkin wrote: > On Tue, Feb 13, 2018 at 04:16:08PM +0100, Marc-Andre Lureau wrote: >> Hi >> >> On Tue, Feb 13, 2018 at 3:27 PM, Michael S. Tsirkin wrote: >> > On Tue, Feb 13, 2018 at 03:14:03PM +0100, Mar

Re: [PATCH] fw_cfg: don't use DMA mapping for fw_cfg device

2018-01-15 Thread Marc-Andre Lureau
Hi On Mon, Jan 15, 2018 at 9:55 AM, Peter Xu wrote: > fw_cfg device does not need IOMMU protection, so use physical addresses > always. That's how QEMU implements fw_cfg. Otherwise we'll see call > traces during boot when vIOMMU is enabled in guest: > > [1.018306] [ cut here

Re: [PATCH v10 2/4] fw_cfg: do DMA read operation

2018-01-24 Thread Marc-Andre Lureau
Hi On Wed, Jan 24, 2018 at 4:25 AM, Peter Xu wrote: > On Tue, Jan 23, 2018 at 05:40:39PM +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. >> >> The DMA operation is expected to run synchronously