Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge tag 'riscv-for-linus-6.11-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux

Pull RISC-V fixes from Palmer Dabbelt:

- Two fixes for smp_processor_id() calls in preemptible sections: one
if the perf driver, and one in the fence.i prctl.

* tag 'riscv-for-linus-6.11-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
riscv: Disable preemption while handling PR_RISCV_CTX_SW_FENCEI_OFF
drivers: perf: Fix smp_processor_id() use in preemptible code

+12 -7
+6 -6
arch/riscv/mm/cacheflush.c
··· 158 158 #ifdef CONFIG_SMP 159 159 static void set_icache_stale_mask(void) 160 160 { 161 + int cpu = get_cpu(); 161 162 cpumask_t *mask; 162 163 bool stale_cpu; 163 164 ··· 169 168 * concurrently on different harts. 170 169 */ 171 170 mask = &current->mm->context.icache_stale_mask; 172 - stale_cpu = cpumask_test_cpu(smp_processor_id(), mask); 171 + stale_cpu = cpumask_test_cpu(cpu, mask); 173 172 174 173 cpumask_setall(mask); 175 - cpumask_assign_cpu(smp_processor_id(), mask, stale_cpu); 174 + cpumask_assign_cpu(cpu, mask, stale_cpu); 175 + put_cpu(); 176 176 } 177 177 #endif 178 178 ··· 241 239 case PR_RISCV_CTX_SW_FENCEI_OFF: 242 240 switch (scope) { 243 241 case PR_RISCV_SCOPE_PER_PROCESS: 244 - current->mm->context.force_icache_flush = false; 245 - 246 242 set_icache_stale_mask(); 243 + current->mm->context.force_icache_flush = false; 247 244 break; 248 245 case PR_RISCV_SCOPE_PER_THREAD: 249 - current->thread.force_icache_flush = false; 250 - 251 246 set_icache_stale_mask(); 247 + current->thread.force_icache_flush = false; 252 248 break; 253 249 default: 254 250 return -EINVAL;
+6 -1
drivers/perf/riscv_pmu_sbi.c
··· 1373 1373 1374 1374 /* SBI PMU Snapsphot is only available in SBI v2.0 */ 1375 1375 if (sbi_v2_available) { 1376 + int cpu; 1377 + 1376 1378 ret = pmu_sbi_snapshot_alloc(pmu); 1377 1379 if (ret) 1378 1380 goto out_unregister; 1379 1381 1380 - ret = pmu_sbi_snapshot_setup(pmu, smp_processor_id()); 1382 + cpu = get_cpu(); 1383 + 1384 + ret = pmu_sbi_snapshot_setup(pmu, cpu); 1381 1385 if (ret) { 1382 1386 /* Snapshot is an optional feature. Continue if not available */ 1383 1387 pmu_sbi_snapshot_free(pmu); ··· 1395 1391 */ 1396 1392 static_branch_enable(&sbi_pmu_snapshot_available); 1397 1393 } 1394 + put_cpu(); 1398 1395 } 1399 1396 1400 1397 register_sysctl("kernel", sbi_pmu_sysctl_table);