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: <A78C989F6D9628469189715575E55B236B3308EE@IRSMSX104.ger.corp.intel.com>
Date:   Fri, 13 Jul 2018 10:06:38 +0000
From:   "Metzger, Markus T" <markus.t.metzger@...el.com>
To:     Hugh Dickins <hughd@...gle.com>
CC:     Peter Zijlstra <peterz@...radead.org>,
        Ingo Molnar <mingo@...hat.com>,
        Arnaldo Carvalho de Melo <acme@...nel.org>,
        "Shishkin, Alexander" <alexander.shishkin@...el.com>,
        "Kleen, Andi" <andi.kleen@...el.com>,
        "Hansen, Dave" <dave.hansen@...el.com>,
        Thomas Gleixner <tglx@...utronix.de>,
        Stephane Eranian <eranian@...gle.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: RE: [bug] kpti, perf_event, bts: sporadic truncated trace

Hello Hugh,

> A little "optimization" crept into alloc_bts_buffer() along the way, which now
> places bts_interrupt_threshold not on a record boundary.
> And Stephane has shown me the sentence in Vol 3B, 17.4.9, which says "This
> address must point to an offset from the BTS buffer base that is a multiple of the
> BTS record size."
> 
> Please give the patch below a try, and let us know if it helps (if it does not, then I
> think we'll need perfier expertise than I can give).
> 
> Hugh
> 
> --- 4.18-rc4/arch/x86/events/intel/ds.c	2018-06-03 14:15:21.000000000 -0700
> +++ linux/arch/x86/events/intel/ds.c	2018-07-12 17:38:28.471378616 -0700
> @@ -408,9 +408,11 @@ static int alloc_bts_buffer(int cpu)
>  	ds->bts_buffer_base = (unsigned long) cea;
>  	ds_update_cea(cea, buffer, BTS_BUFFER_SIZE, PAGE_KERNEL);
>  	ds->bts_index = ds->bts_buffer_base;
> -	max = BTS_RECORD_SIZE * (BTS_BUFFER_SIZE / BTS_RECORD_SIZE);
> -	ds->bts_absolute_maximum = ds->bts_buffer_base + max;
> -	ds->bts_interrupt_threshold = ds->bts_absolute_maximum - (max / 16);
> +	max = BTS_BUFFER_SIZE / BTS_RECORD_SIZE;
> +	ds->bts_absolute_maximum = ds->bts_buffer_base +
> +					max * BTS_RECORD_SIZE;
> +	ds->bts_interrupt_threshold = ds->bts_absolute_maximum -
> +					(max / 16) * BTS_RECORD_SIZE;
>  	return 0;
>  }
> 

Your patch fixes it.

Will you send it to the list for inclusion?  I'd appreciate if it could also be backported
to 4.15, 4.16, and 4.17.

Thanks,
Markus.

Intel Deutschland GmbH
Registered Address: Am Campeon 10-12, 85579 Neubiberg, Germany
Tel: +49 89 99 8853-0, www.intel.de
Managing Directors: Christin Eisenschmid, Christian Lamprechter
Chairperson of the Supervisory Board: Nicole Lau
Registered Office: Munich
Commercial Register: Amtsgericht Muenchen HRB 186928

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ