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 X-Spam-Level: X-Spam-Status: No, score=-15.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CBFDFC432BE for ; Tue, 3 Aug 2021 14:17:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A1E4C60E97 for ; Tue, 3 Aug 2021 14:17:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236768AbhHCORt (ORCPT ); Tue, 3 Aug 2021 10:17:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54978 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236539AbhHCORU (ORCPT ); Tue, 3 Aug 2021 10:17:20 -0400 Received: from galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 28708C06175F for ; Tue, 3 Aug 2021 07:17:09 -0700 (PDT) From: Sebastian Andrzej Siewior DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1628000227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o1+QaFT3UycYD/xp/akolBv+hh3k13vcfDdpl0mYK1Q=; b=xn8G2QHbby2dNo8w6b8BKYnFSmh29C0l+HudmlgY5H6MscbucWT18raRMeW0lgGX/NuNyg 1pDUrYsNa3gDI0q4+snfEtvwu8T7cjQtu2H0lSi6vzKzz/cXIySS5dOO2iMyox368mPfeJ sf5YqEJnjba3hph4vI+OFQyp0HYh0NpMBocq00ujUpzuG2p2OFluNnnUdi27LN2Zwqj3xv pXQ/C412Yk4/8jggAZV8JcrZXZB5buXlnAcKsOve15VQNSoqr1aAXfLGkkLOeJezD1rthp FkEP2qrolSu0faXwY1i19KcLn6VBrxaBjb2QkuEA4jZ1y7ZDe5Yc0vifhOsCUw== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1628000227; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=o1+QaFT3UycYD/xp/akolBv+hh3k13vcfDdpl0mYK1Q=; b=B5o8NJrpMVLD5Xw+VhpAEecfD6ydU+ds51ILHnmNjiyPZOBm4GmGcdhj1UtqLHL2Ew4ieh Wk7drciCFDJM2NDg== To: linux-kernel@vger.kernel.org Cc: tglx@linutronix.de, Peter Zijlstra , Sebastian Andrzej Siewior , Ingo Molnar , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" Subject: [PATCH 10/38] perf/x86/intel: Replace deprecated CPU-hotplug functions. Date: Tue, 3 Aug 2021 16:15:53 +0200 Message-Id: <20210803141621.780504-11-bigeasy@linutronix.de> In-Reply-To: <20210803141621.780504-1-bigeasy@linutronix.de> References: <20210803141621.780504-1-bigeasy@linutronix.de> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The functions get_online_cpus() and put_online_cpus() have been deprecated during the CPU hotplug rework. They map directly to cpus_read_lock() and cpus_read_unlock(). Replace deprecated CPU-hotplug functions with the official version. The behavior remains unchanged. Cc: Peter Zijlstra Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Cc: Mark Rutland Cc: Alexander Shishkin Cc: Jiri Olsa Cc: Namhyung Kim Cc: Thomas Gleixner Cc: Borislav Petkov Cc: x86@kernel.org Cc: "H. Peter Anvin" Signed-off-by: Sebastian Andrzej Siewior --- arch/x86/events/intel/core.c | 8 ++++---- arch/x86/events/intel/pt.c | 4 ++-- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c index fca7a6e2242fe..a7b04c8ae4f69 100644 --- a/arch/x86/events/intel/core.c +++ b/arch/x86/events/intel/core.c @@ -5026,9 +5026,9 @@ static ssize_t freeze_on_smi_store(struct device *cde= v, =20 x86_pmu.attr_freeze_on_smi =3D val; =20 - get_online_cpus(); + cpus_read_lock(); on_each_cpu(flip_smm_bit, &val, 1); - put_online_cpus(); + cpus_read_unlock(); done: mutex_unlock(&freeze_on_smi_mutex); =20 @@ -5071,9 +5071,9 @@ static ssize_t set_sysctl_tfa(struct device *cdev, =20 allow_tsx_force_abort =3D val; =20 - get_online_cpus(); + cpus_read_lock(); on_each_cpu(update_tfa_sched, NULL, 1); - put_online_cpus(); + cpus_read_unlock(); =20 return count; } diff --git a/arch/x86/events/intel/pt.c b/arch/x86/events/intel/pt.c index 915847655c065..0369a238cdfb1 100644 --- a/arch/x86/events/intel/pt.c +++ b/arch/x86/events/intel/pt.c @@ -1708,7 +1708,7 @@ static __init int pt_init(void) if (!boot_cpu_has(X86_FEATURE_INTEL_PT)) return -ENODEV; =20 - get_online_cpus(); + cpus_read_lock(); for_each_online_cpu(cpu) { u64 ctl; =20 @@ -1716,7 +1716,7 @@ static __init int pt_init(void) if (!ret && (ctl & RTIT_CTL_TRACEEN)) prior_warn++; } - put_online_cpus(); + cpus_read_unlock(); =20 if (prior_warn) { x86_add_exclusive(x86_lbr_exclusive_pt); --=20 2.32.0