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: <CANLsYkzyb0Lmb3DNomVuK-Bon2gfS7jGYRnX4F7LQghR-aMZCw@mail.gmail.com>
Date:   Wed, 1 Aug 2018 13:23:04 -0600
From:   Mathieu Poirier <mathieu.poirier@...aro.org>
To:     "Suzuki K. Poulose" <suzuki.poulose@....com>
Cc:     linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Mike Leach <mike.leach@...aro.org>,
        Robert Walker <robert.walker@....com>,
        coresight@...ts.linaro.org
Subject: Re: [PATCH v3 02/13] coresight: etb10: Fix handling of perf mode

On Tue, 31 Jul 2018 at 15:32, Suzuki K Poulose <suzuki.poulose@....com> wrote:
>
> On 07/31/2018 06:07 PM, Mathieu Poirier wrote:
> > Hello,
> >
> > On Thu, Jul 26, 2018 at 01:54:40PM +0100, Suzuki K Poulose wrote:
> >> If the ETB is already enabled in sysfs mode, the ETB reports
> >> success even if a perf mode is requested. Fix this by checking
> >> the requested mode.
> >>
> >> Cc: Mathieu Poirier <mathieu.poirier@...aro.org>
> >> Signed-off-by: Suzuki K Poulose <suzuki.poulose@....com>
> >> ---
> >>   drivers/hwtracing/coresight/coresight-etb10.c | 8 ++++++--
> >>   1 file changed, 6 insertions(+), 2 deletions(-)
> >>
> >> diff --git a/drivers/hwtracing/coresight/coresight-etb10.c b/drivers/hwtracing/coresight/coresight-etb10.c
> >> index 306119e..e5808fd 100644
> >> --- a/drivers/hwtracing/coresight/coresight-etb10.c
> >> +++ b/drivers/hwtracing/coresight/coresight-etb10.c
> >> @@ -148,8 +148,12 @@ static int etb_enable(struct coresight_device *csdev, u32 mode)
> >>              return -EBUSY;
> >>
> >>      /* Nothing to do, the tracer is already enabled. */
> >> -    if (val == CS_MODE_SYSFS)
> >> -            goto out;
> >> +    if (val == CS_MODE_SYSFS) {
> >> +            if (mode == CS_MODE_SYSFS)
> >> +                    goto out;
> >> +            else
> >> +                    return -EBUSY;
> >> +    }
> >
> > How about:
> >
> >          if (val == CS_MODE_PERF)
> >                  return -EBUSY;
> >
> > +       /* Don't let perf disturb sysFS sessions */
> > +       if (val == CS_MODE_SYSFS && mode = CS_MODE_PERF)
> > +               return -EBUSY;
> > +
> >          /* Nothing to do, the tracer is already enabled. */
> >          if (val == CS_MODE_SYSFS)
> >                  goto out;
> >
> >
> > I just find it more readable that way.
>
> Sure, thats fine by me.

Ok good.  Doing another round just to address this is cumbersome so I
just fixed it in my tree.  Also, I still think the WARN_ON() in patch
5/13 is superfluous but once again not important enough to make a big
deal out of it.  I have applied this set.

Thanks,
Mathieu

>
> Cheers
> Suzuki
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ