Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp939151pxb; Wed, 3 Mar 2021 21:49:52 -0800 (PST) X-Google-Smtp-Source: ABdhPJwwruQ8m3GqzD28XTycMTdPwNTCBlqt9OPHbQhbEfrPOMcOU4wpbkWIIFRbZm3HsxWsqpEi X-Received: by 2002:a05:6402:13ce:: with SMTP id a14mr2523634edx.365.1614836992397; Wed, 03 Mar 2021 21:49:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614836992; cv=none; d=google.com; s=arc-20160816; b=goGBr/2OY3OQvX+pmAVlkrHzsCobTl1Nr3Wsa5SBB0flVi7fJIYXXSS+lNuS8ebGu/ tborMXVcCAbh335hOeP9Xx5VMFK0Pu4v3YDEnQFQZf3tQtg6nZn9naxQyliqjr4EdnQ7 M7H5tPN3qHmuWGyyxpGrRY5ZVuGNNrqlTVIr2p7KH37ND362TsBlJpleZkeKZ8lbErjl BXdTKPBkWgUnsNApH2S4lrMDvSFXgKxZCuzsYqd2uNv4J4+zBgyxxdl08k1+DM9NKIJR WhZFA6HyyX9urUbIWRzcFfV+jEL7HH++4jhouqquhyFJ3YCpy67dVd62+KSe4nSU8CMc h5rw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:date:from:dkim-signature; bh=N1mhTziR/Fv3ciKYiN8cwOfkgc4AF06adljZoGJan/o=; b=oWa+pOQQIAdo+5c9WIYAln5Lt+cYdiv8ji0QO3vPrGAqH8z1BB8IdbjECN/jno49y9 di48gGnwTigsNFBghk0+2Ry8Bg16N8xW1N3xwkS/7GgfiQ2KpMiQ9h3GpjlKlXCOVz3B aneMl7+uKAEG7+ydeAlov7UBPueq+0cxV4EWEcxm+t9LUHyQU/ugRFvQ23HHCJnA4tdq 7A69Qot3LMh4xXEB9fd51cqgkRvMTjdeOrASzR6daVJuIBa3TR8iQPT7iWekUD8Q479t Mr6P3OJnPs8jj7aFSNEAJ66yD9abWMyII4oEJo4p3mP41DfKrru1d6NFUAg0X8OiHk24 Hmog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@maine.edu header.s=google header.b="PZYYS1/0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e1si3428820edr.103.2021.03.03.21.49.29; Wed, 03 Mar 2021 21:49:52 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@maine.edu header.s=google header.b="PZYYS1/0"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1836255AbhCBG7t (ORCPT + 99 others); Tue, 2 Mar 2021 01:59:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37308 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1577069AbhCBFlD (ORCPT ); Tue, 2 Mar 2021 00:41:03 -0500 Received: from mail-qk1-x734.google.com (mail-qk1-x734.google.com [IPv6:2607:f8b0:4864:20::734]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 46C64C061756 for ; Mon, 1 Mar 2021 21:29:47 -0800 (PST) Received: by mail-qk1-x734.google.com with SMTP id z128so19140594qkc.12 for ; Mon, 01 Mar 2021 21:29:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=maine.edu; s=google; h=from:date:to:cc:subject:in-reply-to:message-id:references :mime-version; bh=N1mhTziR/Fv3ciKYiN8cwOfkgc4AF06adljZoGJan/o=; b=PZYYS1/0gcD51P2V0wWx3V23xsHFKnN7WQELz25uu/eD8plH/lA+Ev1Cw4Zg8q5EaX ilLeGw6tumS5BoCgp1SQCE9iNceG+ts9tjEXZNrPLgFY406wVZlVD4hDRro5JR/ZnKzo cTM54LHGFtsCxsq93cpw2rjZvrIVbv4JBdjv4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:date:to:cc:subject:in-reply-to:message-id :references:mime-version; bh=N1mhTziR/Fv3ciKYiN8cwOfkgc4AF06adljZoGJan/o=; b=TB7Lw6y5j3QstNgpB6iU9JmWqqU697ABjGKVtLRVazhKV/bBFaO+ONCLDmzeW7FJHc 799XpQs749oNpgr0NnhBFRjQNGJ97C1LN8Y2pSCBXR7e6agvzxRlL2d31/iZo2TzyJuZ VAnXrdxPIm+HRYujadtByhQouuTQtNqaK9S2KFXRqZiH4ni60C3/xvdHrPZaNkVVPOLF yNdEtoieP/dKCGAFEAHyPCXPbLipQwAwlthC1DsuwTQgq95dZMRpGd9GQAqLvCZeU0QQ swT5ZKzQrZR7CCmz7BOYVptWVmUfYxzlE/AXyrsVWIOptdU2WIMPnvTEiNQhTXbepJCQ kaJQ== X-Gm-Message-State: AOAM531qtEZMiP3rDy79lkWcjUDRxYFruFy/3Ph7ctgak/KhMPVeQm2X Y4LgBmg0a/cp5xWH3jsGjen9t85mjyvS6Q== X-Received: by 2002:a37:a48c:: with SMTP id n134mr18652455qke.490.1614662986458; Mon, 01 Mar 2021 21:29:46 -0800 (PST) Received: from macbook-air.local (weaver.eece.maine.edu. [130.111.218.23]) by smtp.gmail.com with ESMTPSA id z2sm12967194qkg.22.2021.03.01.21.29.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 01 Mar 2021 21:29:45 -0800 (PST) From: Vince Weaver X-Google-Original-From: Vince Weaver Date: Tue, 2 Mar 2021 00:29:44 -0500 (EST) To: "Liang, Kan" cc: Peter Zijlstra , Vince Weaver , linux-kernel@vger.kernel.org, Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Stephane Eranian Subject: Re: [perf] perf_fuzzer causes crash in intel_pmu_drain_pebs_nhm() In-Reply-To: <32888c33-c286-c600-66cb-8b1b03beeb8b@linux.intel.com> Message-ID: References: <61a56699-aab4-ef6-ed8d-a22b6bf532d@maine.edu> <7170d3b-c17f-1ded-52aa-cc6d9ae999f4@maine.edu> <32888c33-c286-c600-66cb-8b1b03beeb8b@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 1 Mar 2021, Liang, Kan wrote: > https://lore.kernel.org/lkml/tip-01330d7288e0050c5aaabc558059ff91589e67cd@git.kernel.org/ > The patch is an SW workaround for some old CPUs (HSW and earlier), which may > set 0 to the PEBS status. It adds a check in the intel_pmu_drain_pebs_nhm(). > It tries to minimize the impact of the defect by avoiding dropping the PEBS > records which have PEBS status 0. > But, it doesn't correct the PEBS status, which may bring problems, > especially for the large PEBS. > It's possible that all the PEBS records in a large PEBS have the PEBS status > 0. If so, the first get_next_pebs_record_by_bit() in the > __intel_pmu_pebs_event() returns NULL. The at = NULL. Since it's a large PEBS, > the 'count' parameter must > 1. The second get_next_pebs_record_by_bit() will > crash. > > Could you please revert the patch and check whether it fixes your issue? I've reverted that patch and my test-case no longer triggers the issue. I'll restart a longer fuzzing run to see if any other issues turn up. Thanks, Vince