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: <CABPqkBQaxy=dnh__bEgy6ib9PubDhDkNoXAf3iD6Cb5sHnyRBg@mail.gmail.com>
Date:	Thu, 21 May 2015 06:24:32 -0700
From:	Stephane Eranian <eranian@...gle.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	Ingo Molnar <mingo@...nel.org>,
	Vince Weaver <vincent.weaver@...ne.edu>,
	Jiri Olsa <jolsa@...hat.com>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 08/10] perf/x86: Remove pointless tests

On Thu, May 21, 2015 at 4:17 AM, Peter Zijlstra <peterz@...radead.org> wrote:
> Both intel_commit_scheduling() and intel_get_excl_contraints() test
> for cntr < 0.
>
> The only way that can happen (aside from a bug) is through
> validate_event(), however that is already captured by the
> cpuc->is_fake test.
>
You are saying that we can never get called with assign[i] = -1.
I believe this is correct. The test was leftover from debugging.

> So remove these test and simplify the code.
>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>
> ---
>  arch/x86/kernel/cpu/perf_event_intel.c |   14 ++++----------
>  1 file changed, 4 insertions(+), 10 deletions(-)
>
> --- a/arch/x86/kernel/cpu/perf_event_intel.c
> +++ b/arch/x86/kernel/cpu/perf_event_intel.c
> @@ -1955,12 +1955,10 @@ static void intel_commit_scheduling(stru
>
>         lockdep_assert_held(&excl_cntrs->lock);
>
> -       if (cntr >= 0) {
> -               if (c->flags & PERF_X86_EVENT_EXCL)
> -                       xl->init_state[cntr] = INTEL_EXCL_EXCLUSIVE;
> -               else
> -                       xl->init_state[cntr] = INTEL_EXCL_SHARED;
> -       }
> +       if (c->flags & PERF_X86_EVENT_EXCL)
> +               xl->init_state[cntr] = INTEL_EXCL_EXCLUSIVE;
> +       else
> +               xl->init_state[cntr] = INTEL_EXCL_SHARED;
>  }
>
>  static void
> @@ -2028,10 +2026,6 @@ intel_get_excl_constraints(struct cpu_hw
>         if (!(c->flags & PERF_X86_EVENT_DYNAMIC)) {
>                 struct event_constraint *cx;
>
> -               /* sanity check */
> -               if (idx < 0)
> -                       return &emptyconstraint;
> -
>                 /*
>                  * grab pre-allocated constraint entry
>                  */
>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ