From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 5B224C28CF5 for ; Wed, 26 Jan 2022 17:40:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=IGv/RGrhuGpuiz4vdXUXHnEjs3c8MSp925VWAkCJlC0=; b=tkAPGaumqpxWfr b5KcTsJee7vCIifqJrt3Pqn0uvvU3s5Zi/yrWUDPkyfTLjoSvqE136kw2qckoX6Obl4yAY78eQQeB cr70e54CaiRbPgkzkY7oMvrtFHQ7E3DwXC95pgpxOokPu06iTWNz4b3CMumFGjywEmNU2/BZQdn7X 7eiZYzTzHHK5urigQaePgIP1J5uov3e3vP5BjmRRuQ8E7ufVG3CP4las5gF07ZFx2iLWF8Y2S4mV+ X9CTRecwPKVS2relhfp3ujp6OoPa5ELz5J4xkUOSLBXF57jlQdinRMSSlqEEVU2CyiYtXCudZJOfq wPgA1UGnZrCfSsUZebUw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nCmG6-00D3zo-3K; Wed, 26 Jan 2022 17:39:02 +0000 Received: from mail-oo1-f45.google.com ([209.85.161.45]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nClwk-00CwrO-TB for linux-arm-kernel@lists.infradead.org; Wed, 26 Jan 2022 17:19:04 +0000 Received: by mail-oo1-f45.google.com with SMTP id w15-20020a4a9d0f000000b002c5cfa80e84so69242ooj.5 for ; Wed, 26 Jan 2022 09:19:02 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=6Mpzlir6SdqG4dmvTdqzzIWhZy40hzNNvzFlysAcgEo=; b=PrcbZkrTxLRX3s50IPaqpTU7x/T6Eb14VQQISMk5NpWF+WWhd11eg52VpHxBCOjzAE nkv/Qhypsv2VlHjHN61TW7T61QPlAgOBiryzYm/esmfWNuyBbL5+tu6VC6zk7C7Xxbt5 CNbs4MRB+KGVgFQK/hlr0sU230xYsYmOc12AR/JS5k7RNtLx/7B29G7Uq+VW/CN35IMh BvqnvAB5luLknwGULjRTeXKij9qvMqsMSfyKSppjXeIrYb5rEYhlm1zVAYMZyA6LaoFy yuyEgq5/IL/qW67p23AOpsojCyrxnvNfxcGQqM3pzPM/xrXklR37kFpfDnZ9XaTEiN25 M2zg== X-Gm-Message-State: AOAM5310caH9XgVMqJQQVJsnGyQKjp8wgXgJjFu4sBoxLom1h9kicOce DfqEygFz1dLp1zPE1eG5/A== X-Google-Smtp-Source: ABdhPJyG2I4hTLw+49PdCXukWfcyYMXxvipT317bX9TkHxSH1ngsOdYI+seGe7/TEKrCnlLtNRkF6w== X-Received: by 2002:a4a:9866:: with SMTP id z35mr6372ooi.61.1643217541497; Wed, 26 Jan 2022 09:19:01 -0800 (PST) Received: from robh.at.kernel.org (66-90-148-213.dyn.grandenetworks.net. [66.90.148.213]) by smtp.gmail.com with ESMTPSA id p26sm5677731oth.14.2022.01.26.09.19.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 26 Jan 2022 09:19:00 -0800 (PST) Received: (nullmailer pid 994404 invoked by uid 1000); Wed, 26 Jan 2022 17:18:59 -0000 Date: Wed, 26 Jan 2022 11:18:59 -0600 From: Rob Herring To: Anshuman Khandual Cc: linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , Mark Rutland , Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , linux-perf-users@vger.kernel.org Subject: Re: [RFC V1 05/11] arm64/perf: Detect support for BRBE Message-ID: References: <1642998653-21377-1-git-send-email-anshuman.khandual@arm.com> <1642998653-21377-6-git-send-email-anshuman.khandual@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1642998653-21377-6-git-send-email-anshuman.khandual@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220126_091903_009648_0B63F42E X-CRM114-Status: GOOD ( 25.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Jan 24, 2022 at 10:00:47AM +0530, Anshuman Khandual wrote: > CPU specific BRBE entries, cycle count, format support gets detected during > PMU init. This information gets saved in per-cpu struct pmu_hw_events which > later helps in operating BRBE during a perf event context. Another NOP commit. The subject says 'arm64' and that we detect BRBE support. This patch neither touches arm64 code nor detects anything. > > Cc: Will Deacon > Cc: Mark Rutland > Cc: linux-arm-kernel@lists.infradead.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Anshuman Khandual > --- > drivers/perf/arm_pmu_platform.c | 34 +++++++++++++++++++++++++++++++++ > 1 file changed, 34 insertions(+) > > diff --git a/drivers/perf/arm_pmu_platform.c b/drivers/perf/arm_pmu_platform.c > index 513de1f54e2d..800e4a6e8bc3 100644 > --- a/drivers/perf/arm_pmu_platform.c > +++ b/drivers/perf/arm_pmu_platform.c > @@ -172,6 +172,36 @@ static int armpmu_request_irqs(struct arm_pmu *armpmu) > return err; > } > > +static void arm_brbe_probe_cpu(void *info) > +{ > + struct pmu_hw_events *hw_events; > + struct arm_pmu *armpmu = info; > + > + /* > + * Return from here, if BRBE driver has not been > + * implemented for this PMU. This helps prevent > + * kernel crash later when brbe_probe() will be > + * called on the PMU. > + */ > + if (!armpmu->brbe_probe) > + return; > + > + hw_events = per_cpu_ptr(armpmu->hw_events, smp_processor_id()); > + armpmu->brbe_probe(hw_events); > +} > + > +static int armpmu_request_brbe(struct arm_pmu *armpmu) > +{ > + int cpu, err = 0; > + > + for_each_cpu(cpu, &armpmu->supported_cpus) { > + err = smp_call_function_single(cpu, arm_brbe_probe_cpu, armpmu, 1); > + if (err) > + return err; > + } > + return err; > +} > + > static void armpmu_free_irqs(struct arm_pmu *armpmu) > { > int cpu; > @@ -229,6 +259,10 @@ int arm_pmu_device_probe(struct platform_device *pdev, > if (ret) > goto out_free_irqs; > > + ret = armpmu_request_brbe(pmu); > + if (ret) > + goto out_free_irqs; > + > ret = armpmu_register(pmu); > if (ret) { > dev_err(dev, "failed to register PMU devices!\n"); > -- > 2.25.1 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel