Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp599529imm; Fri, 13 Jul 2018 03:08:04 -0700 (PDT) X-Google-Smtp-Source: AAOMgpevNwNgniB3V2+Ji23IPN8XvNAic3jfdclJF1rb0o7/e0bGbkqjEZocCd2o419wJnjlV1LF X-Received: by 2002:a62:2352:: with SMTP id j79-v6mr6251120pfj.221.1531476484772; Fri, 13 Jul 2018 03:08:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531476484; cv=none; d=google.com; s=arc-20160816; b=E5M2hvI548NlGYjG5niGsXFrOGpkf6pt0MVT8DqkwF96ohaToKMN8uqyf/BLGn3D5C itLes6Di1yOhClolfqjBU2YwRDxK3ivuqeVnpqTjtFvDIe+oFKSzmPrCa+O8txHey3H/ mM3cGGJuuhv6rBLyLyRtp3kgnYQ3Vmwnm1bve9DexWmPSv+EKdm3KjbGc0lAaCbAyUqp 62HTZxic2eTmgJcQTROFCKrmCpopdzMHUFWahVNqc6mvepyTPkVpXWSm9EasszdKjBKQ vXP0S85MzhHVeYpifjpf6EWUXqO0l4zquzNlwa+fEyzldBpuyPi8OUX1LG+P+4wl0lX+ 4gcg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :dlp-reaction:dlp-version:dlp-product:content-language :accept-language:in-reply-to:references:message-id:date:thread-index :thread-topic:subject:cc:to:from:arc-authentication-results; bh=brDgSsTJP2vjYKZaeG8aJbvn74iLEdxrX5VR8oWeqKI=; b=SRYvpeijUekXbznRGg1fme6OqCYz0D0aIBRsGnA2QXr4Qhw/G7ozMWnt4HjGKuVahd IWgdrdtlNJdbfk8lVchpSFtBRHhxb7ampNIPQPo1zcOnMga8MqFqfGEGHId/MaK4Bn7X AassfohiUJ7XPz/q5Ee/EgGAg6VLscCy5BK/DuG52zdcbSaOy0GNgCijDpYIqInbTTCf AsJx6p/6uBEUKyx9G6P2qAt7w0eHyZzhqtBZc76t4RQB/RY90aurW4AxOSyYbbcLQVkg F5YY5kAdOI8XtaaSrALK8DOddZtltR4Tt8Q5TS68DGWmbrKPzsqxMKBNebGGaJSR5yQ+ ncqQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w21-v6si22953312plp.199.2018.07.13.03.07.49; Fri, 13 Jul 2018 03:08:04 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728042AbeGMKVF convert rfc822-to-8bit (ORCPT + 99 others); Fri, 13 Jul 2018 06:21:05 -0400 Received: from mga04.intel.com ([192.55.52.120]:63220 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727040AbeGMKVF (ORCPT ); Fri, 13 Jul 2018 06:21:05 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Jul 2018 03:07:06 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,347,1526367600"; d="scan'208";a="64424440" Received: from irsmsx109.ger.corp.intel.com ([163.33.3.23]) by FMSMGA003.fm.intel.com with ESMTP; 13 Jul 2018 03:07:02 -0700 Received: from irsmsx104.ger.corp.intel.com ([169.254.5.225]) by IRSMSX109.ger.corp.intel.com ([169.254.13.124]) with mapi id 14.03.0319.002; Fri, 13 Jul 2018 11:06:39 +0100 From: "Metzger, Markus T" To: Hugh Dickins CC: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , "Shishkin, Alexander" , "Kleen, Andi" , "Hansen, Dave" , Thomas Gleixner , Stephane Eranian , Linux Kernel Mailing List Subject: RE: [bug] kpti, perf_event, bts: sporadic truncated trace Thread-Topic: [bug] kpti, perf_event, bts: sporadic truncated trace Thread-Index: AdQZxQrLJqR+Gl12Q6mi7nedU16ktAAeoDuAABQtLrA= Date: Fri, 13 Jul 2018 10:06:38 +0000 Message-ID: References: In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ctpclassification: CTP_NT x-titus-metadata-40: eyJDYXRlZ29yeUxhYmVscyI6IiIsIk1ldGFkYXRhIjp7Im5zIjoiaHR0cDpcL1wvd3d3LnRpdHVzLmNvbVwvbnNcL0ludGVsMyIsImlkIjoiOGM5YmZkZTQtN2RlOS00NzhkLThmNjMtNTEzMjFkNTI1ZDcwIiwicHJvcHMiOlt7Im4iOiJDVFBDbGFzc2lmaWNhdGlvbiIsInZhbHMiOlt7InZhbHVlIjoiQ1RQX05UIn1dfV19LCJTdWJqZWN0TGFiZWxzIjpbXSwiVE1DVmVyc2lvbiI6IjE3LjEwLjE4MDQuNDkiLCJUcnVzdGVkTGFiZWxIYXNoIjoiRmVGZTBcL3RqR0l5YThnZnpmTDlWaDdYaE1MRzNrWmVjUkJMa3c2TGZ1Q2MxWTV5OG1JcE5Oc2lTK3d6R1oxN3oifQ== dlp-product: dlpe-windows dlp-version: 11.0.200.100 dlp-reaction: no-action x-originating-ip: [163.33.239.180] Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 8BIT Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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