Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp2665305rdb; Fri, 8 Dec 2023 15:33:51 -0800 (PST) X-Google-Smtp-Source: AGHT+IF7auN9ioLjjUOyGuRR4Z717ZAlphzUpz890vEq5RAaakrs7pqDah3crhD1xsKzJkaSpdDF X-Received: by 2002:a05:6a20:9711:b0:18a:db41:bd0a with SMTP id hr17-20020a056a20971100b0018adb41bd0amr927030pzc.39.1702078430828; Fri, 08 Dec 2023 15:33:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1702078430; cv=none; d=google.com; s=arc-20160816; b=PU18cvfWSLQMzwlRS+VkfuhzrCjBfsbE9lWllQBEswXujUPh9LuTDomauHwSzvWyd8 JWhWjHost8u0EyAqYMGGWvA7ukJGpAs9Fnqr3Zxo5Mn3SqmTAWfx8ExCmcaruYXytfBt bU3tFRg538xX+SISPxyOWsaTrHuJz9I0WbT7Pp+U1yJuKJ8jCAm4A5c4pwHJvZhGqGOJ 0cahMXOAmDe2+ya4o/SyMKtAzlOmt17TzYWa629m8cerGjbdRT0np7Ybg7tg2Bv2blvv mHBfghpAwufs7qfapnbo1z6OtNqtZhNMnjBZ5Dm4//C5zC2jKtg2tdnGMoz0n51yixfW yvcQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=xwTV49QroXgfoyoqzu9RbO5GR0QxhelFYJNA0S2OG9k=; fh=LS3Waojm+odtyAmTz7hf1JGpgblc4o4LTFxz4R4sPUc=; b=ldTN5AhIw8+Y6qBRV2woVY/T5bNE02o8olmWiHESMKCM3hv1gitS4wmKBBKKFsBXnC Ttk6Xg5kliO4BtPSbpRbNWlyoP8AvVVmFtH+6z0/fy+9sEvAJmKP/ph0doNgtjOxNWrV SC/kVdhP756B411R78jiDpn8hm4mK1EYW/KJ/dbk1+MgRPukzIHrm9cUvmeGvDyHgpGa YAvptQUJd959hEb6b8QpCqb0enVYNWm2UIr7vJ6JriluD4wpUSwSa584XIPFhYgf2UDN HzEW26+YHbzYPz4uPgWEGNfQaPiaCt5XxeHrceFKi/E+pFaU3IjhPaGIcWlVDhWXFMRe 02xQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 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 howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id t13-20020aa7938d000000b006cbb7b7bed0si2180735pfe.201.2023.12.08.15.33.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Dec 2023 15:33:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 71B0982A3973; Fri, 8 Dec 2023 15:33:48 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229884AbjLHXdd convert rfc822-to-8bit (ORCPT + 99 others); Fri, 8 Dec 2023 18:33:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229525AbjLHXdc (ORCPT ); Fri, 8 Dec 2023 18:33:32 -0500 Received: from mail-pj1-f53.google.com (mail-pj1-f53.google.com [209.85.216.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 24C8F137; Fri, 8 Dec 2023 15:33:39 -0800 (PST) Received: by mail-pj1-f53.google.com with SMTP id 98e67ed59e1d1-28694702c18so2622843a91.3; Fri, 08 Dec 2023 15:33:39 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1702078418; x=1702683218; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eEXP4rqwUrtF27vNtvXQpGVAmBWWtDoL7HKm4QVLjsU=; b=KgLCyzCDV0gLuN4SFy+phz5Qd5Z/O2eOPlereqq/t8BfYJJoQGUJqsUI4knHE5Ij/R sFQsy60gijQJUyuyvxm9xIJ+dGKZylCQmBfNlKDNn1jiTgfRgyOgHp3V3IFTnHCXQjQw 9YtO6F+fc9mRi3w0MRzXdM/+1xOB7EhI6sF3SkLoc7qC3ct5W32jPc0tiPR/veDXIjEc A6O9N9lUN2chMAaCZG5uuIalSQzZGZwCttLXDBQd7vo9wV51GzrdgA7vuybJ5USDSN5s bbLrF09KOMWs1MT4IdOI9lof9N/Pp6kdwuBjM5gChftIBPYamxB/c9/lZR0ixOjpxt1v 1tBg== X-Gm-Message-State: AOJu0YwAeOJv4zH+bCDH90oGkj8w9Y0r0x96JO/9CFQUH3VX3PJjHzOX Sxugeeu9dJPiJrCu8iYRJMHmq7XkBs9az6d9g0I= X-Received: by 2002:a17:90a:e50e:b0:286:ca3e:be8c with SMTP id t14-20020a17090ae50e00b00286ca3ebe8cmr815098pjy.90.1702078417649; Fri, 08 Dec 2023 15:33:37 -0800 (PST) MIME-Version: 1.0 References: <20231107083331.901-1-ravi.bangoria@amd.com> In-Reply-To: From: Namhyung Kim Date: Fri, 8 Dec 2023 15:33:26 -0800 Message-ID: Subject: Re: [PATCH 1/2] perf tool AMD: Use non-precise cycles as default event on certain Zen2 processors To: Ravi Bangoria Cc: acme@kernel.org, kim.phillips@amd.com, peterz@infradead.org, mingo@redhat.com, mark.rutland@arm.com, alexander.shishkin@linux.intel.com, jolsa@kernel.org, irogers@google.com, adrian.hunter@intel.com, kan.liang@linux.intel.com, changbin.du@huawei.com, yangjihong1@huawei.com, zwisler@chromium.org, wangming01@loongson.cn, chenhuacai@kernel.org, kprateek.nayak@amd.com, linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, sandipan.das@amd.com, ananth.narayan@amd.com, santosh.shukla@amd.com Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Fri, 08 Dec 2023 15:33:48 -0800 (PST) Hi Ravi, On Fri, Nov 10, 2023 at 1:46 AM Ravi Bangoria wrote: > > Hi Namhyung, > > >> By default, Perf uses precise cycles event when no explicit event is > >> specified by user. Precise cycles event is forwarded to ibs_op// pmu > >> on AMD. However, IBS has hw issue on certain Zen2 processors where > >> it might raise NMI without sample_valid bit set, which causes Unknown > >> NMI warnings. (Erratum #1215: IBS (Instruction Based Sampling) Counter > >> Valid Value May be Incorrect After Exit From Core C6 (CC6) State.) So, > >> use non-precise cycles as default event on affected processors. > > > > It seems like a kernel issue, do we have a kernel patch not to forward > > precise cycles or instructions events to IBS on the affected CPUs? > > I'm not sure how it's a kernel issue. User can use ibs_op// pmu directly > and might hit the hw bug. Sorry for the late reply. I know it's the user's fault when using ibs_op// directly but I think the kernel should not forward cycles:pp to IBS. Thanks, Namhyung