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: <20190730114232.GC51922@lakrids.cambridge.arm.com>
Date:   Tue, 30 Jul 2019 12:42:32 +0100
From:   Mark Rutland <mark.rutland@....com>
To:     Will Deacon <will@...nel.org>
Cc:     Lorenzo Pieralisi <lorenzo.pieralisi@....com>,
        Anders Roxell <anders.roxell@...aro.org>,
        linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] arm_pmu: Mark expected switch fall-through

On Tue, Jul 30, 2019 at 12:27:59PM +0100, Will Deacon wrote:
> On Tue, Jul 30, 2019 at 12:24:15PM +0100, Mark Rutland wrote:
> > On Fri, Jul 26, 2019 at 04:18:25PM +0100, Lorenzo Pieralisi wrote:
> > > On Fri, Jul 26, 2019 at 01:29:56PM +0100, Mark Rutland wrote:
> > > > On Fri, Jul 26, 2019 at 01:27:37PM +0200, Anders Roxell wrote:
> > > > > When fall-through warnings was enabled by default the following warning
> > > > > was starting to show up:
> > > > > 
> > > > > ../drivers/perf/arm_pmu.c: In function ‘cpu_pm_pmu_notify’:
> > > > > ../drivers/perf/arm_pmu.c:726:3: warning: this statement may fall
> > > > >  through [-Wimplicit-fallthrough=]
> > > > >    cpu_pm_pmu_setup(armpmu, cmd);
> > > > >    ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > > > > ../drivers/perf/arm_pmu.c:727:2: note: here
> > > > >   case CPU_PM_ENTER_FAILED:
> > > > >   ^~~~
> > > > > 
> > > > > Rework so that the compiler doesn't warn about fall-through.
> > > > > 
> > > > > Fixes: d93512ef0f0e ("Makefile: Globally enable fall-through warning")
> > > > > Signed-off-by: Anders Roxell <anders.roxell@...aro.org>
> > > > > ---
> > > > > 
> > > > > I'm not convinced that this is the correct patch to fix this issue.
> > > > > However, I can't see why we do 'armpmu->start(armpmu);' only in 'case
> > > > > CPU_PM_ENTER_FAILED' and why we not call function cpu_pm_pmu_setup()
> > > > > there also, since in cpu_pm_pmu_setup() has a case prepared for
> > > > > CPU_PM_ENTER_FAILED.
> > > > 
> > > > I agree, think that should be:
> > > > 
> > > > 	case CPU_PM_EXIT:
> > > > 	case CPU_PM_ENTER_FAILED:
> > > > 		cpu_pm_pmu_setup(armpmu, cmd);
> > > > 		armpmu->start(armpmu);
> > > > 		break;
> > > > 
> > > > ... so that we re-start the events before we start the PMU.
> > > > 
> > > > That would be a fix for commit:
> > > > 
> > > >   da4e4f18afe0f372 ("drivers/perf: arm_pmu: implement CPU_PM notifier")
> > > 
> > > Yes that's correct, apologies. Probably we did not hit it because CPU PM
> > > notifier entry failures are a pretty rare event; regardless:
> > > 
> > > Acked-by: Lorenzo Pieralisi <lorenzo.pieralisi@....com>
> > > 
> > > I can send the updated fix, just let me know.
> > 
> > I'm not sure what Will wants, but assuming you do so:
> > 
> > Acked-by: Mark Rutland <mark.rutland@....com>
> 
> I gave up waiting, so it's already queued here:
> 
> https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/commit/?h=for-next/fixes&id=0d7fd70f26039bd4b33444ca47f0e69ce3ae0354

Great; I'll mark this thread as done, then. :)

Mark.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ