History

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

Pull RISC-V updates from Palmer Dabbelt: - Support for various vector-accelerated crypto routines - Hibernation is now enabled for portable kernel builds - mmap_rnd_bits_max is larger on systems with larger VAs - Support for fast GUP - Support for membarrier-based instruction cache synchronization - Support for the Andes hart-level interrupt controller and PMU - Some cleanups around unaligned access speed probing and Kconfig settings - Support for ACPI LPI and CPPC - Various cleanus related to barriers - A handful of fixes * tag 'riscv-for-linus-6.9-mw2' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (66 commits) riscv: Fix syscall wrapper for >word-size arguments crypto: riscv - add vector crypto accelerated AES-CBC-CTS crypto: riscv - parallelize AES-CBC decryption riscv: Only flush the mm icache when setting an exec pte riscv: Use kcalloc() instead of kzalloc() riscv/barrier: Add missing space after ',' riscv/barrier: Consolidate fence definitions riscv/barrier: Define RISCV_FULL_BARRIER riscv/barrier: Define __{mb,rmb,wmb} RISC-V: defconfig: Enable CONFIG_ACPI_CPPC_CPUFREQ cpufreq: Move CPPC configs to common Kconfig and add RISC-V ACPI: RISC-V: Add CPPC driver ACPI: Enable ACPI_PROCESSOR for RISC-V ACPI: RISC-V: Add LPI driver cpuidle: RISC-V: Move few functions to arch/riscv riscv: Introduce set_compat_task() in asm/compat.h riscv: Introduce is_compat_thread() into compat.h riscv: add compile-time test into is_compat_task() riscv: Replace direct thread flag check with is_compat_task() riscv: Improve arch_get_mmap_end() macro ...

Linus Torvalds committed 2 years ago

Commit c150b802 parents 1e3cd03 a9ad732105 files · +5183 −747Browse files

Showing the changes to kernel (2 of 105 files). Show all

Unified · Split

2 files
  1. kernel/sched/core.c +13 −3
  2. kernel/sched/membarrier.c +9 −4
kernel/sched/core.c+13−3
@@ -6647,7 +6647,9 @@ static void __sched notrace __schedule(unsigned int sched_mode) · 6646 unmodified lines
66476647 * if (signal_pending_state()) if (p->state & @state)
66486648 *
66496649 * Also, the membarrier system call requires a full memory barrier
6650− * after coming from user-space, before storing to rq->curr.
6650+ * after coming from user-space, before storing to rq->curr; this
6651+ * barrier matches a full barrier in the proximity of the membarrier
6652+ * system call exit.
66516653 */
66526654 rq_lock(rq, &rf);
66536655 smp_mb__after_spinlock();
@@ -6718,12 +6720,20 @@ static void __sched notrace __schedule(unsigned int sched_mode) · 64 unmodified lines
67186720 *
67196721 * Here are the schemes providing that barrier on the
67206722 * various architectures:
6721− * - mm ? switch_mm() : mmdrop() for x86, s390, sparc, PowerPC.
6722− * switch_mm() rely on membarrier_arch_switch_mm() on PowerPC.
6723+ * - mm ? switch_mm() : mmdrop() for x86, s390, sparc, PowerPC,
6724+ * RISC-V. switch_mm() relies on membarrier_arch_switch_mm()
6725+ * on PowerPC and on RISC-V.
67236726 * - finish_lock_switch() for weakly-ordered
67246727 * architectures where spin_unlock is a full barrier,
67256728 * - switch_to() for arm64 (weakly-ordered, spin_unlock
67266729 * is a RELEASE barrier),
6730+ *
6731+ * The barrier matches a full barrier in the proximity of
6732+ * the membarrier system call entry.
6733+ *
6734+ * On RISC-V, this barrier pairing is also needed for the
6735+ * SYNC_CORE command when switching between processes, cf.
6736+ * the inline comments in membarrier_arch_switch_mm().
67276737 */
67286738 ++*switch_count;
67296739
kernel/sched/membarrier.c+9−4
@@ -254,7 +254,7 @@ static int membarrier_global_expedited(void) · 253 unmodified lines
254254 return 0;
255255
256256 /*
257− * Matches memory barriers around rq->curr modification in
257+ * Matches memory barriers after rq->curr modification in
258258 * scheduler.
259259 */
260260 smp_mb(); /* system call entry is not a mb. */
@@ -304,7 +304,7 @@ static int membarrier_global_expedited(void) · 43 unmodified lines
304304
305305 /*
306306 * Memory barrier on the caller thread _after_ we finished
307− * waiting for the last IPI. Matches memory barriers around
307+ * waiting for the last IPI. Matches memory barriers before
308308 * rq->curr modification in scheduler.
309309 */
310310 smp_mb(); /* exit from system call is not a mb */
@@ -324,6 +324,7 @@ static int membarrier_private_expedited(int flags, int cpu_id) · 13 unmodified lines
324324 MEMBARRIER_STATE_PRIVATE_EXPEDITED_SYNC_CORE_READY))
325325 return -EPERM;
326326 ipi_func = ipi_sync_core;
327+ prepare_sync_core_cmd(mm);
327328 } else if (flags == MEMBARRIER_FLAG_RSEQ) {
328329 if (!IS_ENABLED(CONFIG_RSEQ))
329330 return -EINVAL;
@@ -343,8 +344,12 @@ static int membarrier_private_expedited(int flags, int cpu_id) · 13 unmodified lines
343344 return 0;
344345
345346 /*
346− * Matches memory barriers around rq->curr modification in
347+ * Matches memory barriers after rq->curr modification in
347348 * scheduler.
349+ *
350+ * On RISC-V, this barrier pairing is also needed for the
351+ * SYNC_CORE command when switching between processes, cf.
352+ * the inline comments in membarrier_arch_switch_mm().
348353 */
349354 smp_mb(); /* system call entry is not a mb. */
350355
@@ -420,7 +425,7 @@ out: · 69 unmodified lines
420425
421426 /*
422427 * Memory barrier on the caller thread _after_ we finished
423− * waiting for the last IPI. Matches memory barriers around
428+ * waiting for the last IPI. Matches memory barriers before
424429 * rq->curr modification in scheduler.
425430 */
426431 smp_mb(); /* exit from system call is not a mb */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t