From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) (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 B69431DFE12 for ; Sat, 21 Feb 2026 19:49:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=216.40.44.12 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771703360; cv=none; b=meQXvEtTPHcTQsA9aimARNuN0HBV/pN2nxPjUcxiXeCDJb03oWq+UfR0AOmWV9hCsgeTimMBDspd1V9ozyhKLaGrVoOd+f/p/PNm1vnW7Iin8HXhDUsc/T0ydKxGreSoolkq0ze0uXdMlFrziyGKoS7/T4UTmXHEhQQ9qBXSiVg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771703360; c=relaxed/simple; bh=YYozKTnyJ3jhguEURCKvnoNQOcAOOXxfKKi7uEynQNI=; h=Date:From:To:Cc:Subject:Message-ID:MIME-Version:Content-Type; b=m+xFcyjeue1Sav93SHJFKQa2z/FI/L6T3h/nog1fpigtdtofIEw8x4sTS+tcXWrKp+ZKzQaNkkkd4wsLzF3p/GVNLiFCAtlFgk/g6WRNEtn+MXh8mfZ5jVnOs/BWqdrnAvSP3u01lRcoO7kvEJrOZ6QfoQOltwvPPwKkPoqg8P4= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=goodmis.org; spf=pass smtp.mailfrom=goodmis.org; arc=none smtp.client-ip=216.40.44.12 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=goodmis.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=goodmis.org Received: from omf08.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay04.hostedemail.com (Postfix) with ESMTP id AA74A1A04F0; Sat, 21 Feb 2026 19:49:11 +0000 (UTC) Received: from [HIDDEN] (Authenticated sender: rostedt@goodmis.org) by omf08.hostedemail.com (Postfix) with ESMTPA id 2D2BE20029; Sat, 21 Feb 2026 19:49:10 +0000 (UTC) Date: Sat, 21 Feb 2026 14:49:01 -0500 From: Steven Rostedt To: Linus Torvalds Cc: LKML , Gabriele Monaco , Mikhail Gavrilov Subject: [GIT PULL] rv: Fix for v7.0 Message-ID: <20260221144901.32df319e@fedora> X-Mailer: Claws Mail 4.3.1 (GTK 3.24.51; x86_64-redhat-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Stat-Signature: cqyxmyhgdat5jf78onwezre8xugb86y3 X-Rspamd-Server: rspamout01 X-Rspamd-Queue-Id: 2D2BE20029 X-Session-Marker: 726F737465647440676F6F646D69732E6F7267 X-Session-ID: U2FsdGVkX19KQF01fPbMsyfnEaDO9mXIkZOklBx+rrM= X-HE-Tag: 1771703350-129804 X-HE-Meta: U2FsdGVkX19DApdqnKZn4ZTAyYtlty+X+xTvBazRiT/0SDEDta1AQ3P6DExhpUyNEREI71TgqNTDVix4iIjuM0B8oDcnUXVegJGRgmBeKS1dm/XTeoILXBj9AkaOO0Wgbj8GUiCY1KsVBPRy07dtRfP20AIG0jChQfDSiNu5PI4YwoTilwUGjMR9J9yqSi5oOMH5nAaxlb8fcTRK+loYgH24GdQoKnFn/U9eAnJldTRZxptltAEkMDKJFQEchxINxbi0EfrWYDtxEFMTtYFdvVvQwGBbnykRalJBCxYHUR4G27EGGXL9j+QH0jyUbe5T4m/dDkSOP+hqORj3j+bcXQHsSFpDBLtqKDav1tWI6nv3Gki2dGaeCd90x2Oc4S3YsKy9IvAhNGo0+6lj3jTrxSPaMSSd4bo1nGfzEPaOXMzO2/EXncVFeQ== Linus, rv fixes for v7.0 Summary of changes: - Fix multiple definition of __pcpu_unique_da_mon_this After refactoring monitors, we used static per-cpu variables with the same names across different per-cpu monitors. This is explicitly disallowed for modules on some architectures (alpha) or if CONFIG_DEBUG_FORCE_WEAK_PER_CPU is enabled (e.g. Fedora's debug kernel). Make sure all those variables have different names to avoid compilation issues. Please pull the latest trace-rv-7.0-2 tree, which can be found at: git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace.git trace-rv-7.0-2 Tag SHA1: a51eb54ed35fd31ef6f245e8d3a9c99dd2b2d3eb Head SHA1: 75f3cf0d1561b0a1cfa97ee35d78ca0118e584d5 Mikhail Gavrilov (1): rv: Fix multiple definition of __pcpu_unique_da_mon_this ---- include/rv/da_monitor.h | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) --------------------------- commit 75f3cf0d1561b0a1cfa97ee35d78ca0118e584d5 Author: Mikhail Gavrilov Date: Mon Feb 16 22:27:07 2026 +0500 rv: Fix multiple definition of __pcpu_unique_da_mon_this The refactoring in commit 30984ccf31b7 ("rv: Refactor da_monitor to minimise macros") replaced per-monitor unique variable names (da_mon_##name) with a fixed name (da_mon_this). While this works for 'static' variables (each translation unit gets its own copy), DEFINE_PER_CPU internally generates a non-static dummy variable __pcpu_unique_ for each per-cpu definition. The requirement for this variable to be unique although static exists for modules on specific architectures (alpha) and if the kernel is built with CONFIG_DEBUG_FORCE_WEAK_PER_CPU (e.g. Fedora's debug kernel). When multiple per-cpu monitors (e.g. sco and sts) are built-in simultaneously, they all produce the same __pcpu_unique_da_mon_this symbol, causing a link error: ld: kernel/trace/rv/monitors/sts/sts.o: multiple definition of `__pcpu_unique_da_mon_this'; kernel/trace/rv/monitors/sco/sco.o: first defined here Fix this by introducing a DA_MON_NAME macro that expands to a per-monitor unique name (da_mon_) via the existing CONCATENATE helper. This restores the uniqueness that was present before the refactoring. Fixes: 30984ccf31b7 ("rv: Refactor da_monitor to minimise macros") Reviewed-by: Gabriele Monaco Signed-off-by: Mikhail Gavrilov Link: https://lore.kernel.org/r/20260216172707.1441516-1-mikhail.v.gavrilov@gmail.com Signed-off-by: Gabriele Monaco diff --git a/include/rv/da_monitor.h b/include/rv/da_monitor.h index db11d41bb438..7511f5464c48 100644 --- a/include/rv/da_monitor.h +++ b/include/rv/da_monitor.h @@ -20,6 +20,12 @@ #include #include +/* + * Per-cpu variables require a unique name although static in some + * configurations (e.g. CONFIG_DEBUG_FORCE_WEAK_PER_CPU or alpha modules). + */ +#define DA_MON_NAME CONCATENATE(da_mon_, MONITOR_NAME) + static struct rv_monitor rv_this; static void react(enum states curr_state, enum events event) @@ -183,14 +189,14 @@ static inline bool da_event(struct da_monitor *da_mon, struct task_struct *tsk, /* * global monitor (a single variable) */ -static struct da_monitor da_mon_this; +static struct da_monitor DA_MON_NAME; /* * da_get_monitor - return the global monitor address */ static struct da_monitor *da_get_monitor(void) { - return &da_mon_this; + return &DA_MON_NAME; } /* @@ -223,14 +229,14 @@ static inline void da_monitor_destroy(void) { } /* * per-cpu monitor variables */ -static DEFINE_PER_CPU(struct da_monitor, da_mon_this); +static DEFINE_PER_CPU(struct da_monitor, DA_MON_NAME); /* * da_get_monitor - return current CPU monitor address */ static struct da_monitor *da_get_monitor(void) { - return this_cpu_ptr(&da_mon_this); + return this_cpu_ptr(&DA_MON_NAME); } /* @@ -242,7 +248,7 @@ static void da_monitor_reset_all(void) int cpu; for_each_cpu(cpu, cpu_online_mask) { - da_mon = per_cpu_ptr(&da_mon_this, cpu); + da_mon = per_cpu_ptr(&DA_MON_NAME, cpu); da_monitor_reset(da_mon); } }