Re: [RFC 0/3] iommu/iova: Unsafe locking in find_iova()

2018-07-09 Thread Dmitry Safonov via iommu
On Fri, 2018-07-06 at 17:13 +0200, Joerg Roedel wrote: > On Fri, Jul 06, 2018 at 03:10:47PM +0100, Dmitry Safonov wrote: > > Yes, as far as I can see, there are code-paths which may try to > > handle > > it at the same time: > > o memory notifiers for hot-unplug (intel-iommu.c) > > o drivers

Re: [PATCH 2/2] dma: remove unsupported gfp_mask parameter from dma_alloc_from_contiguous()

2018-07-09 Thread Michał Nazarewicz
On Mon, 9 Jul 2018 13:20 Marek Szyprowski, wrote: > The CMA memory allocator doesn't support standard gfp flags for memory > allocation, so there is no point having it as a parameter for > dma_alloc_from_contiguous() function. Replace it by a boolean no_warn > argument, which covers all the

Re: [PATCH 1/2] mm/cma: remove unsupported gfp_mask parameter from cma_alloc()

2018-07-09 Thread Laura Abbott
On 07/09/2018 05:19 AM, Marek Szyprowski wrote: cma_alloc() function doesn't really support gfp flags other than __GFP_NOWARN, so convert gfp_mask parameter to boolean no_warn parameter. This will help to avoid giving false feeling that this function supports standard gfp flags and callers can

[PATCH v4 5/6] iommu: Remove IOMMU_OF_DECLARE

2018-07-09 Thread Rob Herring
Now that we use the driver core to stop deferred probe for missing drivers, IOMMU_OF_DECLARE can be removed. This is slightly less optimal than having a list of built-in drivers in that we'll now defer probe twice before giving up. This shouldn't have a significant impact on boot times as past

[PATCH v4 4/6] iommu: Stop deferring probe at end of initcalls

2018-07-09 Thread Rob Herring
The IOMMU subsystem has its own mechanism to not defer probe if driver support is missing. Now that the driver core supports stopping deferring probe if drivers aren't built-in (and probed), use the driver core support so the IOMMU specific support can be removed. Acked-by: Joerg Roedel Cc:

Re: [RFC PATCH 1/2] dma-mapping: Clean up dma_set_*mask() hooks

2018-07-09 Thread Robin Murphy
On 08/07/18 16:07, Christoph Hellwig wrote: On Fri, Jul 06, 2018 at 03:20:34PM +0100, Robin Murphy wrote: What are you trying to do? I really don't want to see more users of the hooks as they are are a horribly bad idea. I really need to fix the ongoing problem we have where, due to funky

Re: [PATCH 1/2] mm/cma: remove unsupported gfp_mask parameter from cma_alloc()

2018-07-09 Thread Michał Nazarewicz
On Mon, 9 Jul 2018 13:20 Marek Szyprowski, wrote: > cma_alloc() function doesn't really support gfp flags other than > __GFP_NOWARN, so convert gfp_mask parameter to boolean no_warn parameter. > > This will help to avoid giving false feeling that this function supports > standard gfp flags and

Re: [PATCH 1/5 V5] Add a function(ioremap_encrypted) for kdump when AMD sme enabled

2018-07-09 Thread lijiang
在 2018年07月09日 17:29, Borislav Petkov 写道: > On Mon, Jul 09, 2018 at 02:28:11PM +0800, lijiang wrote: >> Last week, I had tried many ways to do this work, but it looks >> like that the ways of deducing address is not suitable to another >> scenarios, such as mapping some devices mmio space, which

Re: [PATCH 1/2] mm/cma: remove unsupported gfp_mask parameter from cma_alloc()

2018-07-09 Thread Michal Hocko
On Mon 09-07-18 14:19:55, Marek Szyprowski wrote: > cma_alloc() function doesn't really support gfp flags other than > __GFP_NOWARN, so convert gfp_mask parameter to boolean no_warn parameter. > > This will help to avoid giving false feeling that this function supports > standard gfp flags and

[PATCH 2/2] dma: remove unsupported gfp_mask parameter from dma_alloc_from_contiguous()

2018-07-09 Thread Marek Szyprowski
The CMA memory allocator doesn't support standard gfp flags for memory allocation, so there is no point having it as a parameter for dma_alloc_from_contiguous() function. Replace it by a boolean no_warn argument, which covers all the underlaying cma_alloc() function supports. This will help to

[PATCH 1/2] mm/cma: remove unsupported gfp_mask parameter from cma_alloc()

2018-07-09 Thread Marek Szyprowski
cma_alloc() function doesn't really support gfp flags other than __GFP_NOWARN, so convert gfp_mask parameter to boolean no_warn parameter. This will help to avoid giving false feeling that this function supports standard gfp flags and callers can pass __GFP_ZERO to get zeroed buffer, what has

[PATCH 0/2] CMA: remove unsupported gfp mask parameter

2018-07-09 Thread Marek Szyprowski
Dear All, The CMA related functions cma_alloc() and dma_alloc_from_contiguous() have gfp mask parameter, but sadly they only support __GFP_NOWARN flag. This gave their users a misleading feeling that any standard memory allocation flags are supported, what resulted in the security issue when

[PATCH 7/7 v6] arm64: dts: ls208xa: comply with the iommu map binding for fsl_mc

2018-07-09 Thread Nipun Gupta
fsl-mc bus support the new iommu-map property. Comply to this binding for fsl_mc bus. Signed-off-by: Nipun Gupta Reviewed-by: Laurentiu Tudor --- arch/arm64/boot/dts/freescale/fsl-ls208xa.dtsi | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git

[PATCH 6/7 v6] bus/fsl-mc: set coherent dma mask for devices on fsl-mc bus

2018-07-09 Thread Nipun Gupta
of_dma_configure() API expects coherent_dma_mask to be correctly set in the devices. This patch does the needful. Signed-off-by: Nipun Gupta Reviewed-by: Robin Murphy --- drivers/bus/fsl-mc/fsl-mc-bus.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/bus/fsl-mc/fsl-mc-bus.c

[PATCH 5/7 v6] bus/fsl-mc: support dma configure for devices on fsl-mc bus

2018-07-09 Thread Nipun Gupta
This patch adds support of dma configuration for devices on fsl-mc bus using 'dma_configure' callback for busses. Also, directly calling arch_setup_dma_ops is removed from the fsl-mc bus. Signed-off-by: Nipun Gupta Reviewed-by: Laurentiu Tudor --- drivers/bus/fsl-mc/fsl-mc-bus.c | 15

[PATCH 4/7 v6] iommu/arm-smmu: Add support for the fsl-mc bus

2018-07-09 Thread Nipun Gupta
Implement bus specific support for the fsl-mc bus including registering arm_smmu_ops and bus specific device add operations. Signed-off-by: Nipun Gupta --- drivers/iommu/arm-smmu.c | 7 +++ drivers/iommu/iommu.c| 13 + include/linux/fsl/mc.h | 8

[PATCH 3/7 v6] iommu/of: support iommu configuration for fsl-mc devices

2018-07-09 Thread Nipun Gupta
With of_pci_map_rid available for all the busses, use the function for configuration of devices on fsl-mc bus Signed-off-by: Nipun Gupta Reviewed-by: Robin Murphy --- drivers/iommu/of_iommu.c | 20 1 file changed, 20 insertions(+) diff --git a/drivers/iommu/of_iommu.c

[PATCH 2/7 v6] iommu/of: make of_pci_map_rid() available for other devices too

2018-07-09 Thread Nipun Gupta
iommu-map property is also used by devices with fsl-mc. This patch moves the of_pci_map_rid to generic location, so that it can be used by other busses too. 'of_pci_map_rid' is renamed here to 'of_map_rid' and there is no functional change done in the API. Signed-off-by: Nipun Gupta

[PATCH 1/7 v6] Documentation: fsl-mc: add iommu-map device-tree binding for fsl-mc bus

2018-07-09 Thread Nipun Gupta
The existing IOMMU bindings cannot be used to specify the relationship between fsl-mc devices and IOMMUs. This patch adds a generic binding for mapping fsl-mc devices to IOMMUs, using iommu-map property. Signed-off-by: Nipun Gupta Reviewed-by: Rob Herring ---

[PATCH 0/7 v6] Support for fsl-mc bus and its devices in SMMU

2018-07-09 Thread Nipun Gupta
This patchset defines IOMMU DT binding for fsl-mc bus and adds support in SMMU for fsl-mc bus. The patch series is based on top of dma-mapping tree (for-next branch): http://git.infradead.org/users/hch/dma-mapping.git These patches - Define property 'iommu-map' for fsl-mc bus (patch 1) -

Re: [PATCH 1/5 V5] Add a function(ioremap_encrypted) for kdump when AMD sme enabled

2018-07-09 Thread Borislav Petkov
On Mon, Jul 09, 2018 at 02:28:11PM +0800, lijiang wrote: > Last week, I had tried many ways to do this work, but it looks > like that the ways of deducing address is not suitable to another > scenarios, such as mapping some devices mmio space, which are > unencrypted, and the device mmio space is

Re: [PATCH 1/5 V5] Add a function(ioremap_encrypted) for kdump when AMD sme enabled

2018-07-09 Thread lijiang
在 2018年07月03日 19:44, lijiang 写道: > 在 2018年07月03日 19:14, Borislav Petkov 写道: >> On Tue, Jul 03, 2018 at 06:58:14PM +0800, lijiang wrote: >>> For kdump, the elf header finally use the crash kernel reserved memory, it >>> is not an old memory. >> >> Lamme repeat my suggestion: >> >> So beef up the