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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <7e979311cb5199c4ba9dbf1b0aad027e25563614.camel@ndufresne.ca>
Date:   Fri, 25 Nov 2022 15:18:16 -0500
From:   Nicolas Dufresne <nicolas@...fresne.ca>
To:     Will Deacon <will@...nel.org>,
        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

Le vendredi 18 novembre 2022 à 16:41 +0000, Will Deacon a écrit :
> 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?

Found:
  typedef unsigned short		umode_t;

I'd suggest the BIT() macro then, very easy to read and should work for this
case.

> 
> Will
> 
> _______________________________________________
> linux-amlogic mailing list
> linux-amlogic@...ts.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-amlogic

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ