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: <CABPqkBQSSsSFMfq=Wb7pZZD_gjCvqh4mTt88FL3Eq-fgduEriQ@mail.gmail.com>
Date:	Wed, 22 Oct 2014 23:04:31 +0200
From:	Stephane Eranian <eranian@...gle.com>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	LKML <linux-kernel@...r.kernel.org>,
	"mingo@...e.hu" <mingo@...e.hu>,
	"ak@...ux.intel.com" <ak@...ux.intel.com>,
	Jiri Olsa <jolsa@...hat.com>,
	"Liang, Kan" <kan.liang@...el.com>, Borislav Petkov <bp@...en8.de>,
	Maria Dimakopoulou <maria.n.dimakopoulou@...il.com>
Subject: Re: [PATCH v2 0/12] perf/x86: implement HT leak workaround for SNB/IVB/HSW

On Wed, Oct 22, 2014 at 11:12 AM, Peter Zijlstra <peterz@...radead.org> wrote:
> On Tue, Oct 21, 2014 at 03:08:32PM +0200, Stephane Eranian wrote:
>> On Tue, Oct 21, 2014 at 3:03 PM, Peter Zijlstra <peterz@...radead.org> wrote:
>> > On Tue, Oct 21, 2014 at 02:28:06PM +0200, Stephane Eranian wrote:
>> >> Peter,
>> >>
>> >> On Tue, Oct 21, 2014 at 1:25 PM, Peter Zijlstra <peterz@...radead.org> wrote:
>> >> >
>> >> >
>> >> > lkml.kernel.org/r/CABPqkBRbst4sgpgE5O_VXt-CSC0VD=aP2KWA0e3Uy64tw7df3A@...l.gmail.com
>> >> >
>> >> > I missed that 3 lines if they were in here.
>> >> >
>> >> I did not put them in there because there is another problem.
>> >> If you partition the generic counters 2 and 2, then some CPUs will not
>> >> be able to measure some events.
>> >> Unfortunately, there is no way to partition the 4 counters such that
>> >> all the events can be measured by
>> >> each CPU. Some events or precise sampling requires counter 2 for
>> >> instance (like prec_dist).
>> >> That's why I did not put this fix in.
>> >
>> > Ah, I wasn't thinking about a hard partition, just a limit on the number
>> > of exclusive counters any one CPU can claim such as to not starve. Or is
>> > that what you were talking about? I feel not being able to starve
>> > another CPU is more important than a better utilization bound for
>> > counter scheduling.
>>
>> So you're saying, just limit number of used counters to 2 regardless
>> of which one they are.
>
> used as in marked exclusive and forced empty on the other side.
>
>> So sometimes, this will avoid the problem aforementioned and sometimes
>> not. We can try that.
>
> How will this sometimes not avoid the starvation issue?

Here is a simple case:
Limiting each HT to only 2 counters, can be any, 2 out of 4 possible.

HT0: you measure a MEM* in ctr2, it is started first, and it keeps running
HT1: you measure PREC_DIST with PEBS (it requires ctr2)

HT0 is measuring a corrupting event on ctr2, this prevents ctr2 on HT1
from being used.
HT1 is starved, it cannot measure PREC_DIST

Yes you have a quota of 2 out of 4 counters.

The quota dynamic or static can help mitigate the starvation. The only
way to eliminate
it is to force multiplexing even though you are using fewer counters
than actually avail.
--
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