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: <20221118164157.GA4802@willie-the-truck>
Date:   Fri, 18 Nov 2022 16:41:59 +0000
From:   Will Deacon <will@...nel.org>
To:     Jiucheng Xu <jiucheng.xu@...ogic.com>
Cc:     Mark Rutland <mark.rutland@....com>,
        Neil Armstrong <neil.armstrong@...aro.org>,
        Kevin Hilman <khilman@...libre.com>,
        Jerome Brunet <jbrunet@...libre.com>,
        Martin Blumenstingl <martin.blumenstingl@...glemail.com>,
        Jianxin Pan <jianxin.pan@...ogic.com>,
        Kelvin Zhang <kelvin.zhang@...ogic.com>,
        Chris Healy <healych@...on.com>, linux-kernel@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        linux-amlogic@...ts.infradead.org
Subject: Re: [PATCH v11 1/3] perf/amlogic: Add support for Amlogic meson G12
 SoC DDR PMU driver

On Thu, Nov 17, 2022 at 04:34:15PM +0800, Jiucheng Xu wrote:
> Add support for Amlogic Meson G12 Series SOC - DDR bandwidth PMU driver
> framework and interfaces. The PMU can not only monitor the total DDR
> bandwidth, but also individual IP module bandwidth.
> 
> Signed-off-by: Jiucheng Xu <jiucheng.xu@...ogic.com>
> Tested-by: Chris Healy <healych@...on.com>

amzon.com?

> +static umode_t meson_ddr_perf_format_attr_visible(struct kobject *kobj,
> +						  struct attribute *attr,
> +						  int n)
> +{
> +	struct pmu *pmu = dev_get_drvdata(kobj_to_dev(kobj));
> +	struct ddr_pmu *ddr_pmu = to_ddr_pmu(pmu);
> +	const u64 *capability = ddr_pmu->info.hw_info->capability;
> +	struct device_attribute *dev_attr;
> +	int id;
> +	char value[20]; // config1:xxx, 20 is enough
> +
> +	dev_attr = container_of(attr, struct device_attribute, attr);
> +	dev_attr->show(NULL, NULL, value);
> +
> +	if (sscanf(value, "config1:%d", &id) == 1)
> +		return capability[0] & (1 << id) ? attr->mode : 0;
> +
> +	if (sscanf(value, "config2:%d", &id) == 1)
> +		return capability[1] & (1 << id) ? attr->mode : 0;

Should these be '(1ULL << id)' to avoid shifting beyond the side of the
32-bit type?

Will

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ