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: <00afa417-d897-22ee-25a5-cba1bf96c669@arm.com>
Date:   Wed, 14 Oct 2020 16:52:56 +0100
From:   Robin Murphy <robin.murphy@....com>
To:     kholk11@...il.com, will@...nel.org
Cc:     joro@...tes.org, bjorn.andersson@...aro.org,
        linux-arm-kernel@...ts.infradead.org, devicetree@...r.kernel.org,
        marijns95@...il.com, konradybcio@...il.com,
        martin.botka1@...il.com, linux-arm-msm@...r.kernel.org,
        phone-devel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/8] iommu/arm-smmu: Support test_smr_masks implementation
 detail deviation

On 2020-09-26 14:00, kholk11@...il.com wrote:
> From: AngeloGioacchino Del Regno <kholk11@...il.com>
> 
> At least some Qualcomm SoCs do need to override the function
> arm_smmu_test_smr_masks entirely: add a test_smr_masks function
> to the implementation details structure and call it properly.
> 
> Signed-off-by: AngeloGioacchino Del Regno <kholk11@...il.com>
> ---
>   drivers/iommu/arm/arm-smmu/arm-smmu.c | 6 ++++++
>   drivers/iommu/arm/arm-smmu/arm-smmu.h | 1 +
>   2 files changed, 7 insertions(+)
> 
> diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.c b/drivers/iommu/arm/arm-smmu/arm-smmu.c
> index 09c42af9f31e..446a78dde9cd 100644
> --- a/drivers/iommu/arm/arm-smmu/arm-smmu.c
> +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.c
> @@ -977,6 +977,12 @@ static void arm_smmu_test_smr_masks(struct arm_smmu_device *smmu)
>   
>   	if (!smmu->smrs)
>   		return;
> +
> +	if (smmu->impl && smmu->impl->test_smr_masks) {
> +		smmu->impl->test_smr_masks(smmu);

Meh, this doesn't need a special hook - just have ->cfg_probe() 
initialise your masks early and bail out here if smr_mask_mask is 
already set. You could actually bypass this test as-is by marking all 
your SMR entries as valid, but that's likely to cause far more problems 
elsewhere than it solves here ;)

Robin.

> +		return;
> +	}
> +
>   	/*
>   	 * If we've had to accommodate firmware memory regions, we may
>   	 * have live SMRs by now; tread carefully...
> diff --git a/drivers/iommu/arm/arm-smmu/arm-smmu.h b/drivers/iommu/arm/arm-smmu/arm-smmu.h
> index d890a4a968e8..2cd3d126f675 100644
> --- a/drivers/iommu/arm/arm-smmu/arm-smmu.h
> +++ b/drivers/iommu/arm/arm-smmu/arm-smmu.h
> @@ -387,6 +387,7 @@ struct arm_smmu_impl {
>   	int (*cfg_probe)(struct arm_smmu_device *smmu);
>   	int (*reset)(struct arm_smmu_device *smmu);
>   	int (*init_context)(struct arm_smmu_domain *smmu_domain);
> +	void (*test_smr_masks)(struct arm_smmu_device *smmu);
>   	void (*tlb_sync)(struct arm_smmu_device *smmu, int page, int sync,
>   			 int status);
>   	int (*def_domain_type)(struct device *dev);
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ