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: <20240827130233.GF4772@willie-the-truck>
Date: Tue, 27 Aug 2024 14:02:34 +0100
From: Will Deacon <will@...nel.org>
To: Nicolin Chen <nicolinc@...dia.com>
Cc: robin.murphy@....com, joro@...tes.org, jgg@...dia.com,
	thierry.reding@...il.com, vdumpa@...dia.com, jonathanh@...dia.com,
	linux-kernel@...r.kernel.org, iommu@...ts.linux.dev,
	linux-arm-kernel@...ts.infradead.org, linux-tegra@...r.kernel.org
Subject: Re: [PATCH v13 06/10] iommu/arm-smmu-v3: Add
 acpi_smmu_acpi_probe_model for impl

On Fri, Aug 23, 2024 at 05:10:40PM -0700, Nicolin Chen wrote:
> For model-specific implementation, repurpose the acpi_smmu_get_options()
> to a wider acpi_smmu_acpi_probe_model(). A new model can add to the list
> in this new function.
> 
> Suggested-by: Will Deacon <will@...nel.org>
> Signed-off-by: Nicolin Chen <nicolinc@...dia.com>
> ---
>  drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c | 18 +++++++++++++-----
>  1 file changed, 13 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> index afdb8a76a72a..ceb31d63f79b 100644
> --- a/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> +++ b/drivers/iommu/arm/arm-smmu-v3/arm-smmu-v3.c
> @@ -4341,18 +4341,28 @@ static int arm_smmu_device_hw_probe(struct arm_smmu_device *smmu)
>  }
>  
>  #ifdef CONFIG_ACPI
> -static void acpi_smmu_get_options(u32 model, struct arm_smmu_device *smmu)
> +static int acpi_smmu_iort_probe_model(struct acpi_iort_node *node,
> +				      struct arm_smmu_device *smmu)
>  {
> -	switch (model) {
> +	struct acpi_iort_smmu_v3 *iort_smmu =
> +		(struct acpi_iort_smmu_v3 *)node->node_data;
> +
> +	switch (iort_smmu->model) {
>  	case ACPI_IORT_SMMU_V3_CAVIUM_CN99XX:
>  		smmu->options |= ARM_SMMU_OPT_PAGE0_REGS_ONLY;
>  		break;
>  	case ACPI_IORT_SMMU_V3_HISILICON_HI161X:
>  		smmu->options |= ARM_SMMU_OPT_SKIP_PREFETCH;
>  		break;
> +	case ACPI_IORT_SMMU_V3_GENERIC:
> +		break;
> +	default:
> +		dev_err(smmu->dev, "Unknown/unsupported IORT model!\n");
> +		return -ENXIO;

We probably don't want this 'default' case, otherwise the driver will
need to be updated every time there's a new model.

If you agree, then I can just drop this bit when applying.

Will

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ