Merge tag 'trace-rv-7.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace

Pull runtime verifier fix from Steven Rostedt:

- 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.

* tag 'trace-rv-7.0-2' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
rv: Fix multiple definition of __pcpu_unique_da_mon_this

+11 -5
+11 -5
include/rv/da_monitor.h
··· 20 #include <linux/bug.h> 21 #include <linux/sched.h> 22 23 static struct rv_monitor rv_this; 24 25 static void react(enum states curr_state, enum events event) ··· 189 /* 190 * global monitor (a single variable) 191 */ 192 - static struct da_monitor da_mon_this; 193 194 /* 195 * da_get_monitor - return the global monitor address 196 */ 197 static struct da_monitor *da_get_monitor(void) 198 { 199 - return &da_mon_this; 200 } 201 202 /* ··· 229 /* 230 * per-cpu monitor variables 231 */ 232 - static DEFINE_PER_CPU(struct da_monitor, da_mon_this); 233 234 /* 235 * da_get_monitor - return current CPU monitor address 236 */ 237 static struct da_monitor *da_get_monitor(void) 238 { 239 - return this_cpu_ptr(&da_mon_this); 240 } 241 242 /* ··· 248 int cpu; 249 250 for_each_cpu(cpu, cpu_online_mask) { 251 - da_mon = per_cpu_ptr(&da_mon_this, cpu); 252 da_monitor_reset(da_mon); 253 } 254 }
··· 20 #include <linux/bug.h> 21 #include <linux/sched.h> 22 23 + /* 24 + * Per-cpu variables require a unique name although static in some 25 + * configurations (e.g. CONFIG_DEBUG_FORCE_WEAK_PER_CPU or alpha modules). 26 + */ 27 + #define DA_MON_NAME CONCATENATE(da_mon_, MONITOR_NAME) 28 + 29 static struct rv_monitor rv_this; 30 31 static void react(enum states curr_state, enum events event) ··· 183 /* 184 * global monitor (a single variable) 185 */ 186 + static struct da_monitor DA_MON_NAME; 187 188 /* 189 * da_get_monitor - return the global monitor address 190 */ 191 static struct da_monitor *da_get_monitor(void) 192 { 193 + return &DA_MON_NAME; 194 } 195 196 /* ··· 223 /* 224 * per-cpu monitor variables 225 */ 226 + static DEFINE_PER_CPU(struct da_monitor, DA_MON_NAME); 227 228 /* 229 * da_get_monitor - return current CPU monitor address 230 */ 231 static struct da_monitor *da_get_monitor(void) 232 { 233 + return this_cpu_ptr(&DA_MON_NAME); 234 } 235 236 /* ··· 242 int cpu; 243 244 for_each_cpu(cpu, cpu_online_mask) { 245 + da_mon = per_cpu_ptr(&DA_MON_NAME, cpu); 246 da_monitor_reset(da_mon); 247 } 248 }