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:   Wed, 16 Aug 2023 08:59:59 -0300
From:   Jason Gunthorpe <jgg@...dia.com>
To:     Nicolin Chen <nicolinc@...dia.com>
Cc:     will@...nel.org, robin.murphy@....com, joro@...tes.org,
        jean-philippe@...aro.org, apopple@...dia.com,
        linux-kernel@...r.kernel.org, linux-arm-kernel@...ts.infradead.org,
        iommu@...ts.linux.dev
Subject: Re: [PATCH] iommu/arm-smmu-v3: Add a configurable
 tlbi_range_max_n_shift for TLBI

On Mon, Aug 14, 2023 at 02:57:01PM -0700, Nicolin Chen wrote:
> +static ssize_t tlbi_range_max_n_shift_show(struct device *dev,
> +					   struct device_attribute *attr,
> +					   char *buf)
> +{
> +	struct arm_smmu_device *smmu = dev_get_drvdata(dev->parent);
> +
> +	return sprintf(buf, "%u\n", smmu->tlbi_range_max_n_shift);
> +}

sysfs_emit and missing newline

> +static ssize_t tlbi_range_max_n_shift_store(struct device *dev,
> +					    struct device_attribute *attr,
> +					    const char *buf, size_t size)
> +{
> +	struct arm_smmu_device *smmu = dev_get_drvdata(dev->parent);
> +	unsigned int max_n_shift;
> +	int ret;
> +
> +	ret = kstrtou32(buf, 0, &max_n_shift);
> +	if (ret)
> +		return ret;
> +	if (max_n_shift > VA_BITS || max_n_shift < PAGE_SHIFT)
> +		return -EINVAL;
> +	smmu->tlbi_range_max_n_shift = max_n_shift;
> +	return size;

This seems convoluted for a uapi, you should just make it
'invalidate_threshold' in bytes or something simpler.

> +
> +static struct attribute_group arm_smmu_group = {
> +	.name = "arm-smmu-v3",
> +	.attrs = arm_smmu_attrs,
> +};

Do we really need the subdirectory?

Jason

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ