Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp33872rwr; Wed, 26 Apr 2023 20:06:24 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ7mp8uHgauVW8Zx7f3Ue4ebYcPhqr0mUCB4W1TV7ytLnPKq+zQxcBAnbP2jD3FL5Jd2BHX+ X-Received: by 2002:a05:6a20:6a0b:b0:f5:9f72:1aa9 with SMTP id p11-20020a056a206a0b00b000f59f721aa9mr94130pzk.14.1682564784603; Wed, 26 Apr 2023 20:06:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682564784; cv=none; d=google.com; s=arc-20160816; b=Zwf6VFV+2pJ62CT3Bo8pQGyEwTj+A3RElEzHc7QQDYeGqg31Wp40kPxTVK87QqF9lu sPgwVKfHZ2JLuYcYHzFE4l1KETiZKZc+1xukKOghkbn3oQwh+HEvjH4AfGGYNT3CCkT7 e3V36py0LB8Ai2XQFWU9NfUtEZjgPLR7todrNNAXujxdYiRQJxQb2TVDBrdWE6SXy9Vp fJ3NagLZX1TiKAY8PikgdZyHSSFJ/yAYdQhWgTnq9knpakrS6p7Hrr5wYmn5YbxZ4jTx wUvJaRENlKx1CXmB57cn7U7cbpyk1dN/pcImEsvxqpFzE/Rlyq4ycPvjWkkMTQzqFq9D bNQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:sender:dkim-signature; bh=Ove/sTJ8+x/q60am/+KMhPIYHnt+EFjkrJyhwIn48Nk=; b=eKkvoZ11VhC5y3pa8/61KIN+wToHId1IGZrVLYj1jdgC7120rjW76LvrkPD8755Ne0 eGqVBWfSnN1ItboUgIlpCJgr6JlFwEsQUHcgN8WGdF0XU2y+Z28v1ug+dTbFwcLB5Nw1 2YjqRs5vt6wG82VnwErr3Ebkqam7lZGIRtki3XkABQgQi8G/4gmnSwxTSQ0xBQWsgZBh WVLG+HovOlakyS1cYccMjHreSh8/FN2GZE5jD2CC/DLWWb2mtIb/fqyBB348+DqWRRKU aasqP5j7OCgzkRE6KutuFeVAqvjUONVV5rDp8wnLgv6qvC/XaPAOLsUk/1pFaDlOmd30 9ChA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b=raTJxDo6; 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=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b5-20020a63d805000000b0050f692470fasi17490503pgh.301.2023.04.26.20.06.13; Wed, 26 Apr 2023 20:06:24 -0700 (PDT) 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=@gmail.com header.s=20221208 header.b=raTJxDo6; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242818AbjD0DFd (ORCPT + 99 others); Wed, 26 Apr 2023 23:05:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233414AbjD0DFb (ORCPT ); Wed, 26 Apr 2023 23:05:31 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 58B3635B3; Wed, 26 Apr 2023 20:05:30 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id 41be03b00d2f7-51b0f9d7d70so7931826a12.1; Wed, 26 Apr 2023 20:05:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1682564730; x=1685156730; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:from:to:cc:subject:date:message-id:reply-to; bh=Ove/sTJ8+x/q60am/+KMhPIYHnt+EFjkrJyhwIn48Nk=; b=raTJxDo6NHuN1i4W6/Vl6x/jV++XY9DomGczVyWxak/EnC5sunEIIoypQnfdLjlp+d 5aSIfjwfILrNgKOrVO6x+ouEJdYq/+sH5GFzTf/25xH2Lelrq2ddHWX+tx6Rcvz4oGmR +YU5ahqcI51YXd0SugsrUxSkAyAomhKk748mTe+LgiCxkO0Wvcq/nc5ObiSQDR3eOD6m g3tFs2Sufh+im2umEEC8LqY4IdCRz0H8ZG9QxThAaWZI187ZE08VaxXozT0waT7iRumz ugc61A69a53XjCCVoyQyVXhaxHT82PMp5Lkw/WP72Oc6X/unmUsmI6PcqUxscrEtUUfr FAvA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1682564730; x=1685156730; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:sender:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=Ove/sTJ8+x/q60am/+KMhPIYHnt+EFjkrJyhwIn48Nk=; b=TOZzqypjL8ykUstXct4D3iQuHxPWIQoZlrcAqWQW7k/gZm5mdtdh3kpMkbyI5nMYWy DVI1Vtuw1l7AVRfH4Q3U6YZd2jGa7p3pyY4aljp/vcUvoRS+AvojIAHw7+XWvnu4Je8T cFBd3JYYLTjQNWuHqFrY+AfswXVO9UlkiZfNlj2l/EuewoZShjsCO7MJdURS1pexX0ED J2bqhLbJNYhjxRGgAjzOGw0Lhx2DfVqcvirql0MeU+QZzbbUNQFzDHRIezT1NZqeSDc7 /imFMofp/2ZSJ1+SD3HCZWWN5ULWUzorImWG6plTdg/AOTVEsZ56KTkn/O1/OYTnGFk5 qWcw== X-Gm-Message-State: AC+VfDy+u28AUmCORSShuBIiiRoyakQjNZEIQuEIBs3NX0XhZoZ1G/V9 ccYRel9byAGIR5N/ZsWaSb4= X-Received: by 2002:a17:90b:3585:b0:247:1e13:90ef with SMTP id mm5-20020a17090b358500b002471e1390efmr348505pjb.20.1682564729636; Wed, 26 Apr 2023 20:05:29 -0700 (PDT) Received: from bangji.hsd1.ca.comcast.net ([2601:647:6700:7f00:6ebf:37fc:fc60:b353]) by smtp.gmail.com with ESMTPSA id f12-20020a170902684c00b001a6d08eb054sm10575168pln.78.2023.04.26.20.05.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Apr 2023 20:05:29 -0700 (PDT) Sender: Namhyung Kim From: Namhyung Kim To: Peter Zijlstra , Ingo Molnar Cc: Arnaldo Carvalho de Melo , Jiri Olsa , Ian Rogers , Adrian Hunter , LKML , Stephane Eranian , Ravi Bangoria , Sandipan Das , stable@vger.kernel.org Subject: [PATCH] perf/x86: Fix missing sample size update on AMD BRS Date: Wed, 26 Apr 2023 20:05:27 -0700 Message-ID: <20230427030527.580841-1-namhyung@kernel.org> X-Mailer: git-send-email 2.40.1.495.gc816e09b53d-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.5 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=no 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 It missed to convert a PERF_SAMPLE_BRANCH_STACK user to call the new perf_sample_save_brstack() helper in order to update the dyn_size. This affects AMD Zen3 machines with the branch-brs event. Fixes: eb55b455ef9c ("perf/core: Add perf_sample_save_brstack() helper") Cc: stable@vger.kernel.org Signed-off-by: Namhyung Kim --- arch/x86/events/core.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/arch/x86/events/core.c b/arch/x86/events/core.c index d096b04bf80e..9d248703cbdd 100644 --- a/arch/x86/events/core.c +++ b/arch/x86/events/core.c @@ -1703,10 +1703,8 @@ int x86_pmu_handle_irq(struct pt_regs *regs) perf_sample_data_init(&data, 0, event->hw.last_period); - if (has_branch_stack(event)) { - data.br_stack = &cpuc->lbr_stack; - data.sample_flags |= PERF_SAMPLE_BRANCH_STACK; - } + if (has_branch_stack(event)) + perf_sample_save_brstack(&data, event, &cpuc->lbr_stack); if (perf_event_overflow(event, &data, regs)) x86_pmu_stop(event, 0); -- 2.40.1.495.gc816e09b53d-goog