Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A45D844062A; Thu, 20 Aug 2026 17:47:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787248062; cv=none; b=dEDOFP7PUKsciIkAoJXqYhr+PnoMLQdb8SovGtwtt0ZwYPWTCTLqnO27QTlj+wcNwBqkjT6u0xm6EdK8DRfPbVGaRjpoUCXwAquVfUwPxr7R5wdPKdoBdBqUOQjtgLwzMELRx6MaHvpe4AOFf++7QV/fcE7m9ImuvA5kb3IcQfY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787248062; c=relaxed/simple; bh=aE4zcxgIjPPvAfJkfbP61fhyU11jhD3s40NCWLmArVM=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FXNgblP3w8tRXECZxW9mwWWPRGoaN8In0i2cPWxCInLLxHnrdQ2LMD0wdJxwGn2aS1QCJU22CJYaQo1mJypCOyKi3IPv1V35lNUR4W5LzYeCLEMrwErAaOdEdKfUHqru1VTp6aA/1nDzKkIaXeeMrFQKc1feOW+YSANWBCI3z6c= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=RtugcPlV; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="RtugcPlV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0BFF11F000E9; Thu, 20 Aug 2026 17:47:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1787248061; bh=1UP7aOzw+ezdoJPZiawWxntX7PxzCcKmRx25qwWhfl4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=RtugcPlVCp+j98b3d1yDCLaHtO+DpQ0cbePod6/ZlvOUWZM4y9pBRJdRL4tj+Pjpl bR2foi60aEz7tN0wQa7p1W/XqkgKi8s7TXvqLwTW4AnPWt1Vspk4aT4ehVF6ZHwNu4 sRhJR9JFIz3KprpVWbXiTEKSy0mcZ8xkDb8KZhi0= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Thomas Richter , Heiko Carstens , Sasha Levin Subject: [PATCH 6.1 096/303] s390/cpum_cf: remove in-kernel counting facility interface Date: Thu, 20 Aug 2026 16:53:52 +0200 Message-ID: <20260820145256.178986174@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260820145253.200766705@linuxfoundation.org> References: <20260820145253.200766705@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.1-stable review patch. If anyone has any objections, please let me know. ------------------ From: Thomas Richter [ Upstream commit ea53e6995f45e857fd34e4fbfbd436b5457da5f7 ] Commit 17bebcc68eee ("s390/cpum_cf: Add minimal in-kernel interface for counter measurements") introduced a small in-kernel interface for CPU Measurement counter facility. There are no users of this interface, therefore remove it. The following functions are removed: kernel_cpumcf_alert(), kernel_cpumcf_begin(), kernel_cpumcf_end(), kernel_cpumcf_avail() there is no need for them anymore. With the removal of function kernel_cpumcf_alert(), also remove member alert in struct cpu_cf_events. Its purpose was to counter measurement alert interrupts for the in-kernel interface. Signed-off-by: Thomas Richter Signed-off-by: Heiko Carstens Stable-dep-of: 49145bce5391 ("s390/perf_cpum_cf: Add missing array_index_nospec() to __hw_perf_event_init()") Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/s390/include/asm/cpu_mcf.h | 17 ----------------- arch/s390/kernel/perf_cpum_cf.c | 2 +- arch/s390/kernel/perf_cpum_cf_common.c | 24 ------------------------ 3 files changed, 1 insertion(+), 42 deletions(-) --- a/arch/s390/include/asm/cpu_mcf.h +++ b/arch/s390/include/asm/cpu_mcf.h @@ -67,7 +67,6 @@ static inline int ctr_stcctm(enum cpumf_ struct cpu_cf_events { struct cpumf_ctr_info info; atomic_t ctr_set[CPUMF_CTR_SET_MAX]; - atomic64_t alert; u64 state; /* For perf_event_open SVC */ u64 dev_state; /* For /dev/hwctr */ unsigned int flags; @@ -80,25 +79,9 @@ struct cpu_cf_events { }; DECLARE_PER_CPU(struct cpu_cf_events, cpu_cf_events); -bool kernel_cpumcf_avail(void); int __kernel_cpumcf_begin(void); -unsigned long kernel_cpumcf_alert(int clear); void __kernel_cpumcf_end(void); -static inline int kernel_cpumcf_begin(void) -{ - if (!cpum_cf_avail()) - return -ENODEV; - - preempt_disable(); - return __kernel_cpumcf_begin(); -} -static inline void kernel_cpumcf_end(void) -{ - __kernel_cpumcf_end(); - preempt_enable(); -} - int cfset_online_cpu(unsigned int cpu); int cfset_offline_cpu(unsigned int cpu); #endif /* _ASM_S390_CPU_MCF_H */ --- a/arch/s390/kernel/perf_cpum_cf.c +++ b/arch/s390/kernel/perf_cpum_cf.c @@ -832,7 +832,7 @@ static int __init cpumf_pmu_init(void) { int rc; - if (!kernel_cpumcf_avail()) + if (!cpum_cf_avail()) return -ENODEV; /* Setup s390dbf facility */ --- a/arch/s390/kernel/perf_cpum_cf_common.c +++ b/arch/s390/kernel/perf_cpum_cf_common.c @@ -27,7 +27,6 @@ DEFINE_PER_CPU(struct cpu_cf_events, cpu [CPUMF_CTR_SET_EXT] = ATOMIC_INIT(0), [CPUMF_CTR_SET_MT_DIAG] = ATOMIC_INIT(0), }, - .alert = ATOMIC64_INIT(0), .state = 0, .dev_state = 0, .flags = 0, @@ -67,9 +66,6 @@ static void cpumf_measurement_alert(stru if (alert & CPU_MF_INT_CF_MTDA) pr_warn("CPU[%i] MT counter data was lost\n", smp_processor_id()); - - /* store alert for special handling by in-kernel users */ - atomic64_or(alert, &cpuhw->alert); } #define PMC_INIT 0 @@ -94,12 +90,6 @@ static void cpum_cf_setup_cpu(void *flag lcctl(0); } -bool kernel_cpumcf_avail(void) -{ - return cpum_cf_initalized; -} -EXPORT_SYMBOL(kernel_cpumcf_avail); - /* Initialize the CPU-measurement counter facility */ int __kernel_cpumcf_begin(void) { @@ -112,20 +102,6 @@ int __kernel_cpumcf_begin(void) } EXPORT_SYMBOL(__kernel_cpumcf_begin); -/* Obtain the CPU-measurement alerts for the counter facility */ -unsigned long kernel_cpumcf_alert(int clear) -{ - struct cpu_cf_events *cpuhw = this_cpu_ptr(&cpu_cf_events); - unsigned long alert; - - alert = atomic64_read(&cpuhw->alert); - if (clear) - atomic64_set(&cpuhw->alert, 0); - - return alert; -} -EXPORT_SYMBOL(kernel_cpumcf_alert); - /* Release the CPU-measurement counter facility */ void __kernel_cpumcf_end(void) {