lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <DB9PR04MB93804D3ACA821792A5D2E94EECB1A@DB9PR04MB9380.eurprd04.prod.outlook.com>
Date:   Wed, 15 Nov 2023 11:01:08 +0000
From:   Laurentiu Tudor <laurentiu.tudor@....com>
To:     "joro@...tes.org" <joro@...tes.org>,
        "will@...nel.org" <will@...nel.org>,
        "robin.murphy@....com" <robin.murphy@....com>,
        "treding@...dia.com" <treding@...dia.com>,
        "jgg@...dia.com" <jgg@...dia.com>,
        "iommu@...ts.linux.dev" <iommu@...ts.linux.dev>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH v3] iommu: map reserved memory as cacheable if device is
 coherent

Hello,

Any chance of having this picked up? It is the last missing bit to fix 
booting vanilla images on some NXP platforms (Layerscape LX2160A, 
LS2088A, LS1088A) given that the bootloader side of things [1] was accepted.
Thank you!

[1] https://patchwork.ozlabs.org/project/uboot/list/?series=375154&state=*

---
Best Regards, Laurentiu

On 9/26/2023 6:26 PM, Laurentiu Tudor wrote:
> Check if the device is marked as DMA coherent in the DT and if so,
> map its reserved memory as cacheable in the IOMMU.
> This fixes the recently added IOMMU reserved memory support which
> uses IOMMU_RESV_DIRECT without properly building the PROT for the
> mapping.
> 
> Fixes: a5bf3cfce8cb ("iommu: Implement of_iommu_get_resv_regions()")
> Signed-off-by: Laurentiu Tudor <laurentiu.tudor@....com>
> Reviewed-by: Jason Gunthorpe <jgg@...dia.com>
> Acked-by: Thierry Reding <treding@...dia.com>
> ---
> Changes in v3:
>   - added Acked-by tag (Thierry)
> 
> Changes in v2:
>   - added Reviewed-by tag (Jason)
> 
>   drivers/iommu/of_iommu.c | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/iommu/of_iommu.c b/drivers/iommu/of_iommu.c
> index 157b286e36bf..5b3631ba5a45 100644
> --- a/drivers/iommu/of_iommu.c
> +++ b/drivers/iommu/of_iommu.c
> @@ -254,6 +254,9 @@ void of_iommu_get_resv_regions(struct device *dev, struct list_head *list)
>   				phys_addr_t iova;
>   				size_t length;
>   
> +				if (of_dma_is_coherent(dev->of_node))
> +					prot |= IOMMU_CACHE;
> +
>   				maps = of_translate_dma_region(np, maps, &iova, &length);
>   				type = iommu_resv_region_get_type(dev, &phys, iova, length);
>   

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ