From patchwork Wed Nov 16 09:21:56 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: tip-bot2 for Thomas Gleixner X-Patchwork-Id: 20835 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp44561wru; Wed, 16 Nov 2022 01:31:09 -0800 (PST) X-Google-Smtp-Source: AA0mqf5z6lsJ+cyksViQqQnLCSPlNURhadTHGoM9FNPC6vMSfww7EfzsGZ6KnXW5CMyBuEEnNCih X-Received: by 2002:a62:442:0:b0:562:86a3:12fc with SMTP id 63-20020a620442000000b0056286a312fcmr22741256pfe.8.1668591069498; Wed, 16 Nov 2022 01:31:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668591069; cv=none; d=google.com; s=arc-20160816; b=IghViZztLO4TqwhGZazRT+1B0ycQv5W1pDTqtCRIHGaUjgpAkJpCFk6Ul3ILprwB1A OZTuJb1dWVI3eOzR9CrNnAa9HeMobNbz9NwGI6iQhslceo4d7NXm6RwDRXCYctcwaaBY USXaTX+zjSSkFEpGNcSq5XE1jDZrNK0lsG/gHA4kLv9DJkUUjaAc69gJPYViUovuRooS zxaOeDa+S4w4dlkOcLASILHjyEmHsgkJR3KQytMfuzlhYRAFZmhj8GWh4gg6w8jl97st SSCgaLTSXhpKwJ03MZuCGmxAxWuZ0NJa8SQ2bmIOkkK6SH2Xhu+jJqDWm4OvkWMw339g HhGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:robot-unsubscribe :robot-id:message-id:mime-version:references:in-reply-to:cc:subject :to:reply-to:sender:from:dkim-signature:dkim-signature:date; bh=YA4CPPTUVtYwpqhvtLMRcFwGP6fQVGdvDsF0bj73KSA=; b=VhKnD/RhxZYE4szSHECVIB3icXKsf0w/dXWMxU727Ks/VAGmLb5aGm6/v0QWsFVaIi hgJvlC4gJJeD+Yid+Rd0B7lwQvBAncQu0l5XNl6lRN1GyeiAxn2Pce5UI1lluwrDcndW p0JGCcISuQHhM89Se9X1Xn0k7m2t/zlV423FRvXSO2/c9CSbpA/1jiHRsCS+ewPaDP+X fss/tndFiQ4b84iIMYMiXfNYvQhH/oDbEAL2a8IkycTGVHpXcxVwADyRZQoedKpjWVZW XIFt/WSyPe9AAgBN/DMHMS0vu8gmVfw8NeYzL9/v6aJGLUAsGvviwPiMJbz++X580HbJ r2QQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=VxmlUt0R; dkim=neutral (no key) header.i=@linutronix.de header.b=mF5Ennni; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b22-20020a17090a101600b002137030b2basi1423034pja.54.2022.11.16.01.30.56; Wed, 16 Nov 2022 01:31:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=VxmlUt0R; dkim=neutral (no key) header.i=@linutronix.de header.b=mF5Ennni; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S238534AbiKPJWR (ORCPT + 99 others); Wed, 16 Nov 2022 04:22:17 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233652AbiKPJWA (ORCPT ); Wed, 16 Nov 2022 04:22:00 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28C7427146; Wed, 16 Nov 2022 01:21:59 -0800 (PST) Date: Wed, 16 Nov 2022 09:21:56 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1668590517; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YA4CPPTUVtYwpqhvtLMRcFwGP6fQVGdvDsF0bj73KSA=; b=VxmlUt0Rfc7jGSAI7OPLtXBB0F272IfyHu+aMj1kOvVlO84Fs6ubReh6wipUI8pjsWSOLk Ab+CPw8tiJJQLU30OYACyETBV4Ucpo1r5vpnZA1hqPImlOo/4tGMQ74MkF3EmAZx2/CYci pk/Hj1ztosTQQWfSv9uPp4x3/at5lFGZDc+osC0X6MT7/jDtvL5+U5rzvv6zFpl4B7BRrq TCly7rIImcCKaq7kmWxxzbgGwmQeNnVoy7tQSUmUQJ9RXF+6YDEpk8+892YszFBFH4BkGn hn1GOR6mD03KuMVILEsguEj0imM/xAtGuR8SJQe9puIWPCyGhpmbYa3oLECtCQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1668590517; h=from:from:sender:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=YA4CPPTUVtYwpqhvtLMRcFwGP6fQVGdvDsF0bj73KSA=; b=mF5Ennni/19N9fRtmA1MwQPUMpq6OZaTAFlrt9sC3R/jXGLd7sWCcVg4L2z/HbulXszbWe Ofoft4PSuldlt8CQ== From: "tip-bot2 for Adrian Hunter" Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: perf/urgent] perf/x86/intel/pt: Fix sampling using single range output Cc: Adrian Hunter , "Peter Zijlstra (Intel)" , stable@vger.kernel.org, x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20221112151508.13768-1-adrian.hunter@intel.com> References: <20221112151508.13768-1-adrian.hunter@intel.com> MIME-Version: 1.0 Message-ID: <166859051658.4906.7352282169801138446.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749304094754109622?= X-GMAIL-MSGID: =?utf-8?q?1749644548985751414?= The following commit has been merged into the perf/urgent branch of tip: Commit-ID: ce0d998be9274dd3a3d971cbeaa6fe28fd2c3062 Gitweb: https://git.kernel.org/tip/ce0d998be9274dd3a3d971cbeaa6fe28fd2c3062 Author: Adrian Hunter AuthorDate: Sat, 12 Nov 2022 17:15:08 +02:00 Committer: Peter Zijlstra CommitterDate: Wed, 16 Nov 2022 10:12:59 +01:00 perf/x86/intel/pt: Fix sampling using single range output Deal with errata TGL052, ADL037 and RPL017 "Trace May Contain Incorrect Data When Configured With Single Range Output Larger Than 4KB" by disabling single range output whenever larger than 4KB. Fixes: 670638477aed ("perf/x86/intel/pt: Opportunistically use single range output mode") Signed-off-by: Adrian Hunter Signed-off-by: Peter Zijlstra (Intel) Cc: stable@vger.kernel.org Link: https://lkml.kernel.org/r/20221112151508.13768-1-adrian.hunter@intel.com --- arch/x86/events/intel/pt.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/arch/x86/events/intel/pt.c b/arch/x86/events/intel/pt.c index 82ef87e..42a5579 100644 --- a/arch/x86/events/intel/pt.c +++ b/arch/x86/events/intel/pt.c @@ -1263,6 +1263,15 @@ static int pt_buffer_try_single(struct pt_buffer *buf, int nr_pages) if (1 << order != nr_pages) goto out; + /* + * Some processors cannot always support single range for more than + * 4KB - refer errata TGL052, ADL037 and RPL017. Future processors might + * also be affected, so for now rather than trying to keep track of + * which ones, just disable it for all. + */ + if (nr_pages > 1) + goto out; + buf->single = true; buf->nr_pages = nr_pages; ret = 0;