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]
Date:   Thu, 28 Apr 2022 16:17:58 +0200
From:   Matthias Brugger <matthias.bgg@...il.com>
To:     Yong Wu <yong.wu@...iatek.com>, Joerg Roedel <joro@...tes.org>,
        Rob Herring <robh+dt@...nel.org>, Will Deacon <will@...nel.org>
Cc:     Robin Murphy <robin.murphy@....com>,
        Krzysztof Kozlowski <krzysztof.kozlowski@...onical.com>,
        Tomasz Figa <tfiga@...omium.org>,
        linux-mediatek@...ts.infradead.org, srv_heupstream@...iatek.com,
        devicetree@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        iommu@...ts.linux-foundation.org,
        Hsin-Yi Wang <hsinyi@...omium.org>, youlin.pei@...iatek.com,
        anan.sun@...iatek.com, xueqi.zhang@...iatek.com,
        yen-chang.chen@...iatek.com,
        AngeloGioacchino Del Regno 
        <angelogioacchino.delregno@...labora.com>,
        mingyuan.ma@...iatek.com, yf.wang@...iatek.com,
        libo.kang@...iatek.com, chengci.xu@...iatek.com
Subject: Re: [PATCH v6 15/34] iommu/mediatek: Add IOMMU_TYPE flag



On 07/04/2022 09:57, Yong Wu wrote:
> Add IOMMU_TYPE definition. In the mt8195, we have another IOMMU_TYPE:
> infra iommu, also there will be another APU_IOMMU, thus, use 2bits for the
> IOMMU_TYPE.
> 
> Signed-off-by: Yong Wu <yong.wu@...iatek.com>
> Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@...labora.com>
> ---
>   drivers/iommu/mtk_iommu.c | 12 ++++++++++--
>   1 file changed, 10 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/iommu/mtk_iommu.c b/drivers/iommu/mtk_iommu.c
> index 84d661e0b371..642949aad47e 100644
> --- a/drivers/iommu/mtk_iommu.c
> +++ b/drivers/iommu/mtk_iommu.c
> @@ -126,9 +126,17 @@
>   #define SHARE_PGTABLE			BIT(10) /* 2 HW share pgtable */
>   #define DCM_DISABLE			BIT(11)
>   #define NOT_STD_AXI_MODE		BIT(12)
> +/* 2 bits: iommu type */
> +#define MTK_IOMMU_TYPE_MM		(0x0 << 13)
> +#define MTK_IOMMU_TYPE_INFRA		(0x1 << 13)
> +#define MTK_IOMMU_TYPE_MASK		(0x3 << 13)
>   
> -#define MTK_IOMMU_HAS_FLAG(pdata, _x) \
> -		((((pdata)->flags) & (_x)) == (_x))
> +#define MTK_IOMMU_HAS_FLAG(pdata, _x)	(!!(((pdata)->flags) & (_x)))

That could be:
MTK_IOMMU_HAS_FLAG(pdata, _x) \
                 MTK_IOMMU_HAS_FLAG_MASK(pdata, _x, _x)

> +
> +#define MTK_IOMMU_HAS_FLAG_MASK(pdata, _x, mask)	\
> +				((((pdata)->flags) & (mask)) == (_x))
> +#define MTK_IOMMU_IS_TYPE(pdata, _x)	MTK_IOMMU_HAS_FLAG_MASK(pdata, _x,\
> +							MTK_IOMMU_TYPE_MASK)
>   
>   struct mtk_iommu_domain {
>   	struct io_pgtable_cfg		cfg;

Powered by blists - more mailing lists