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: <20130128220810.GV30577@one.firstfloor.org>
Date:	Mon, 28 Jan 2013 23:08:10 +0100
From:	Andi Kleen <andi@...stfloor.org>
To:	Stephane Eranian <eranian@...gle.com>
Cc:	Andi Kleen <andi@...stfloor.org>, Ingo Molnar <mingo@...nel.org>,
	LKML <linux-kernel@...r.kernel.org>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Arnaldo Carvalho de Melo <acme@...hat.com>,
	Jiri Olsa <jolsa@...hat.com>,
	Namhyung Kim <namhyung@...nel.org>,
	Andi Kleen <ak@...ux.intel.com>
Subject: Re: [PATCH 05/12] perf, x86: Support Haswell v4 LBR format

> > -               if (lbr_format == LBR_FORMAT_EIP_FLAGS) {
> > +               if (lbr_format == LBR_FORMAT_EIP_FLAGS ||
> > +                   lbr_format == LBR_FORMAT_EIP_FLAGS2) {
> >                         mis = !!(from & LBR_FROM_FLAG_MISPRED);
> >                         pred = !mis;
> > -                       from = (u64)((((s64)from) << 1) >> 1);
> > +                       if (lbr_format == LBR_FORMAT_EIP_FLAGS)
> > +                               from = (u64)((((s64)from) << 1) >> 1);
> > +                       else if (lbr_format == LBR_FORMAT_EIP_FLAGS2) {
> > +                               intx = !!(from & LBR_FROM_FLAG_INTX);
> > +                               abort = !!(from & LBR_FROM_FLAG_ABORT);
> > +                               from = (u64)((((s64)from) << 3) >> 3);
> > +                       }
> >                 }
> >
> Wouldn't all that be more readable with a switch-case, especially given
> that lbr_format could be extended.

The current version works for me.

-Andi
--
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