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, 2 Mar 2023 15:04:16 +0000
From:   Robin Murphy <robin.murphy@....com>
To:     Sven Peter <sven@...npeter.dev>, Hector Martin <marcan@...can.st>,
        Joerg Roedel <joro@...tes.org>, Will Deacon <will@...nel.org>
Cc:     Rob Herring <robh+dt@...nel.org>,
        Krzysztof Kozlowski <krzysztof.kozlowski+dt@...aro.org>,
        Alyssa Rosenzweig <alyssa@...enzweig.io>,
        linux-arm-kernel@...ts.infradead.org, asahi@...ts.linux.dev,
        iommu@...ts.linux.dev, devicetree@...r.kernel.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 2/4] iommu: dart: Add flag to override bypass support

On 28/02/2023 8:21 pm, Sven Peter wrote:
> The USB4 PCIe DARTs claim to support bypass but we never want to allow
> that on externally facing ports.

IOMMU drivers shouldn't be implementing their own individual policies 
for this - externally-facing ports should be correctly marked as 
such[1], so that the PCI layer is properly informed, which in turn will 
be picked up and handled properly by IOMMU core code.

Thanks,
Robin.

[1] see Documentation/devicetree/bindings/pci/pci.txt

> Acked-by: Hector Martin <marcan@...can.st>
> Signed-off-by: Sven Peter <sven@...npeter.dev>
> ---
>   drivers/iommu/apple-dart.c | 5 +++++
>   1 file changed, 5 insertions(+)
> 
> diff --git a/drivers/iommu/apple-dart.c b/drivers/iommu/apple-dart.c
> index 42666617803d..7d8b2b90cdb6 100644
> --- a/drivers/iommu/apple-dart.c
> +++ b/drivers/iommu/apple-dart.c
> @@ -182,6 +182,8 @@ struct apple_dart_hw {
>   	u64 ttbr_addr_field_shift;
>   	u64 ttbr_shift;
>   	int ttbr_count;
> +
> +	bool disable_bypass;
>   };
>   
>   /*
> @@ -1075,6 +1077,9 @@ static int apple_dart_probe(struct platform_device *pdev)
>   	dart->pgsize = 1 << FIELD_GET(DART_PARAMS1_PAGE_SHIFT, dart_params[0]);
>   	dart->supports_bypass = dart_params[1] & DART_PARAMS2_BYPASS_SUPPORT;
>   
> +	if (dart->hw->disable_bypass)
> +		dart->supports_bypass = 0;
> +
>   	switch (dart->hw->type) {
>   	case DART_T8020:
>   	case DART_T6000:

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ