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: <Y/uYrf1M0R4lZZb1@ubun2204.myguest.virtualbox.org>
Date:   Sun, 26 Feb 2023 23:06:45 +0530
From:   Deepak R Varma <drv@...lo.com>
To:     Peter Zijlstra <peterz@...radead.org>
Cc:     Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        Mark Rutland <mark.rutland@....com>,
        Alexander Shishkin <alexander.shishkin@...ux.intel.com>,
        Jiri Olsa <jolsa@...nel.org>,
        Namhyung Kim <namhyung@...nel.org>,
        Thomas Gleixner <tglx@...utronix.de>,
        Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>, x86@...nel.org,
        "H. Peter Anvin" <hpa@...or.com>, linux-perf-users@...r.kernel.org,
        linux-kernel@...r.kernel.org,
        Saurabh Singh Sengar <ssengar@...rosoft.com>,
        Praveen Kumar <kumarpraveen@...ux.microsoft.com>,
        Deepak R Varma <drv@...lo.com>
Subject: Re: [PATCH v2 1/3] perf/x86/core: Use sysfs_emit() in show()
 callback function

On Thu, Feb 23, 2023 at 10:25:45AM +0530, Deepak R Varma wrote:
> On Wed, Feb 22, 2023 at 09:35:53PM +0100, Peter Zijlstra wrote:
> > On Tue, Feb 21, 2023 at 07:36:12PM +0530, Deepak R Varma wrote:
> > > diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c
> > > index 85a63a41c471..27c03e6dcb5d 100644
> > > --- a/arch/x86/events/core.c
> > > +++ b/arch/x86/events/core.c
> > > @@ -1896,9 +1896,7 @@ ssize_t events_hybrid_sysfs_show(struct device *dev,
> > >  		if (x86_pmu.hybrid_pmu[i].cpu_type & pmu->cpu_type) {
> > >  			next_str = strchr(str, ';');
> > >  			if (next_str)
> > > -				return snprintf(page, next_str - str + 1, "%s", str);
> > > -			else
> > > -				return sprintf(page, "%s", str);
> > > +				return sysfs_emit(page, "%s", str);
> > >  		}
> > >  		str = strchr(str, ';');
> > >  		str++;
> > 
> > How is this correct ?!?
> 
> oops.. that is bad on my part. My apologies for the wrong code.
> I will correct it and send in v3.

Hello Peter,
I reviewed the code more closely and concluded that the current implementation
is better as is. I sent in a v3 with necessary correction for your review.

I do have another observation from this area that I will send in as a separate
patch soon.

Thank you again.
./drv


> 
> Thank you Peter.
> 
> Regards,
> ./drv


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ