Skip to content

Commit d850c9d

Browse files
Automatic merge of 'fixes' into merge (2026-05-18 15:48)
2 parents a00d336 + 5200f5f commit d850c9d

46 files changed

Lines changed: 336 additions & 232 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Documentation/arch/riscv/cmodx.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ call at each patchable function entry, and patches it dynamically at runtime to
2121
enable or disable the redirection. In the case of RISC-V, 2 instructions,
2222
AUIPC + JALR, are required to compose a function call. However, it is impossible
2323
to patch 2 instructions and expect that a concurrent read-side executes them
24-
without a race condition. This series makes atmoic code patching possible in
24+
without a race condition. This series makes atomic code patching possible in
2525
RISC-V ftrace. Kernel preemption makes things even worse as it allows the old
2626
state to persist across the patching process with stop_machine().
2727

2828
In order to get rid of stop_machine() and run dynamic ftrace with full kernel
2929
preemption, we partially initialize each patchable function entry at boot-time,
30-
setting the first instruction to AUIPC, and the second to NOP. Now, atmoic
30+
setting the first instruction to AUIPC, and the second to NOP. Now, atomic
3131
patching is possible because the kernel only has to update one instruction.
3232
According to Ziccif, as long as an instruction is naturally aligned, the ISA
3333
guarantee an atomic update.
@@ -36,8 +36,8 @@ By fixing down the first instruction, AUIPC, the range of the ftrace trampoline
3636
is limited to +-2K from the predetermined target, ftrace_caller, due to the lack
3737
of immediate encoding space in RISC-V. To address the issue, we introduce
3838
CALL_OPS, where an 8B naturally align metadata is added in front of each
39-
pacthable function. The metadata is resolved at the first trampoline, then the
40-
execution can be derect to another custom trampoline.
39+
patchable function. The metadata is resolved at the first trampoline, then the
40+
execution can be directed to another custom trampoline.
4141

4242
CMODX in the User Space
4343
-----------------------

Documentation/arch/riscv/zicfilp.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ the program.
7878

7979
Per-task indirect branch tracking state can be monitored and
8080
controlled via the :c:macro:`PR_GET_CFI` and :c:macro:`PR_SET_CFI`
81-
``prctl()` arguments (respectively), by supplying
81+
``prctl()`` arguments (respectively), by supplying
8282
:c:macro:`PR_CFI_BRANCH_LANDING_PADS` as the second argument. These
8383
are architecture-agnostic, and will return -EINVAL if the underlying
8484
functionality is not supported.

Documentation/hwmon/sy7636a-hwmon.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,5 +22,5 @@ The following sensors are supported
2222
sysfs-Interface
2323
---------------
2424

25-
temp0_input
25+
temp1_input
2626
- Temperature of external NTC (milli-degree C)

Documentation/sound/codecs/cs35l56.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ There are two drivers in the kernel
4040

4141
*For systems using SoundWire*: sound/soc/codecs/cs35l56.c and associated files
4242

43-
*For systems using HDA*: sound/pci/hda/cs35l56_hda.c
43+
*For systems using HDA*: sound/hda/codecs/side-codecs/cs35l56_hda.c
4444

4545
Firmware
4646
========

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
VERSION = 7
33
PATCHLEVEL = 1
44
SUBLEVEL = 0
5-
EXTRAVERSION = -rc3
5+
EXTRAVERSION = -rc4
66
NAME = Baby Opossum Posse
77

88
# *DOCUMENTATION*

arch/arm64/kernel/entry-common.c

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,13 @@ static void noinstr arm64_exit_to_kernel_mode(struct pt_regs *regs,
6262
irqentry_exit_to_kernel_mode_after_preempt(regs, state);
6363
}
6464

65+
static __always_inline void arm64_syscall_enter_from_user_mode(struct pt_regs *regs)
66+
{
67+
enter_from_user_mode(regs);
68+
mte_disable_tco_entry(current);
69+
sme_enter_from_user_mode();
70+
}
71+
6572
/*
6673
* Handle IRQ/context state management when entering from user mode.
6774
* Before this function is called it is not safe to call regular kernel code,
@@ -70,20 +77,30 @@ static void noinstr arm64_exit_to_kernel_mode(struct pt_regs *regs,
7077
static __always_inline void arm64_enter_from_user_mode(struct pt_regs *regs)
7178
{
7279
enter_from_user_mode(regs);
80+
rseq_note_user_irq_entry();
7381
mte_disable_tco_entry(current);
7482
sme_enter_from_user_mode();
7583
}
7684

85+
static __always_inline void arm64_syscall_exit_to_user_mode(struct pt_regs *regs)
86+
{
87+
local_irq_disable();
88+
syscall_exit_to_user_mode_prepare(regs);
89+
local_daif_mask();
90+
sme_exit_to_user_mode();
91+
mte_check_tfsr_exit();
92+
exit_to_user_mode();
93+
}
94+
7795
/*
7896
* Handle IRQ/context state management when exiting to user mode.
7997
* After this function returns it is not safe to call regular kernel code,
8098
* instrumentable code, or any code which may trigger an exception.
8199
*/
82-
83100
static __always_inline void arm64_exit_to_user_mode(struct pt_regs *regs)
84101
{
85102
local_irq_disable();
86-
exit_to_user_mode_prepare_legacy(regs);
103+
irqentry_exit_to_user_mode_prepare(regs);
87104
local_daif_mask();
88105
sme_exit_to_user_mode();
89106
mte_check_tfsr_exit();
@@ -92,7 +109,7 @@ static __always_inline void arm64_exit_to_user_mode(struct pt_regs *regs)
92109

93110
asmlinkage void noinstr asm_exit_to_user_mode(struct pt_regs *regs)
94111
{
95-
arm64_exit_to_user_mode(regs);
112+
arm64_syscall_exit_to_user_mode(regs);
96113
}
97114

98115
/*
@@ -716,12 +733,12 @@ static void noinstr el0_brk64(struct pt_regs *regs, unsigned long esr)
716733

717734
static void noinstr el0_svc(struct pt_regs *regs)
718735
{
719-
arm64_enter_from_user_mode(regs);
736+
arm64_syscall_enter_from_user_mode(regs);
720737
cortex_a76_erratum_1463225_svc_handler();
721738
fpsimd_syscall_enter();
722739
local_daif_restore(DAIF_PROCCTX);
723740
do_el0_svc(regs);
724-
arm64_exit_to_user_mode(regs);
741+
arm64_syscall_exit_to_user_mode(regs);
725742
fpsimd_syscall_exit();
726743
}
727744

@@ -868,11 +885,11 @@ static void noinstr el0_cp15(struct pt_regs *regs, unsigned long esr)
868885

869886
static void noinstr el0_svc_compat(struct pt_regs *regs)
870887
{
871-
arm64_enter_from_user_mode(regs);
888+
arm64_syscall_enter_from_user_mode(regs);
872889
cortex_a76_erratum_1463225_svc_handler();
873890
local_daif_restore(DAIF_PROCCTX);
874891
do_el0_svc_compat(regs);
875-
arm64_exit_to_user_mode(regs);
892+
arm64_syscall_exit_to_user_mode(regs);
876893
}
877894

878895
static void noinstr el0_bkpt32(struct pt_regs *regs, unsigned long esr)

arch/riscv/Kconfig

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -937,6 +937,28 @@ config RISCV_VECTOR_MISALIGNED
937937
help
938938
Enable detecting support for vector misaligned loads and stores.
939939

940+
config RISCV_SBI_FWFT_DELEGATE_MISALIGNED
941+
bool "Request firmware delegation of unaligned access exceptions"
942+
depends on RISCV_SBI
943+
depends on NONPORTABLE
944+
help
945+
Use SBI FWFT to request delegation of load address misaligned and
946+
store address misaligned exceptions, if possible, and prefer Linux
947+
kernel emulation of these accesses to firmware emulation.
948+
949+
Unfortunately, Linux's emulation is still incomplete. Namely, it
950+
currently does not handle vector instructions and KVM guest accesses.
951+
On platforms where these accesses would have been handled by firmware,
952+
enabling this causes unexpected kernel oopses, userspaces crashes and
953+
KVM guest crashes. If you are sure that these are not a problem for
954+
your platform, you can say Y here, which may improve performance.
955+
956+
Saying N here will not worsen emulation support for unaligned accesses
957+
even in the case where the firmware also has incomplete support. It
958+
simply keeps the firmware's emulation enabled.
959+
960+
If you don't know what to do here, say N.
961+
940962
choice
941963
prompt "Unaligned Accesses Support"
942964
default RISCV_PROBE_UNALIGNED_ACCESS

arch/riscv/errata/mips/errata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ void mips_errata_patch_func(struct alt_entry *begin, struct alt_entry *end,
5757
}
5858

5959
tmp = (1U << alt->patch_id);
60-
if (cpu_req_errata && tmp) {
60+
if (cpu_req_errata & tmp) {
6161
mutex_lock(&text_mutex);
6262
patch_text_nosync(ALT_OLD_PTR(alt), ALT_ALT_PTR(alt),
6363
alt->alt_len);

arch/riscv/kernel/compat_signal.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,8 @@ static long compat_restore_sigcontext(struct pt_regs *regs,
107107

108108
/* sc_regs is structured the same as the start of pt_regs */
109109
err = __copy_from_user(&cregs, &sc->sc_regs, sizeof(sc->sc_regs));
110+
if (unlikely(err))
111+
return err;
110112

111113
cregs_to_regs(&cregs, regs);
112114

arch/riscv/kernel/copy-unaligned.S

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
22
/* Copyright (C) 2023 Rivos Inc. */
33

4+
#include <linux/cfi_types.h>
45
#include <linux/linkage.h>
56
#include <asm/asm.h>
67

@@ -9,7 +10,7 @@
910
/* void __riscv_copy_words_unaligned(void *, const void *, size_t) */
1011
/* Performs a memcpy without aligning buffers, using word loads and stores. */
1112
/* Note: The size is truncated to a multiple of 8 * SZREG */
12-
SYM_FUNC_START(__riscv_copy_words_unaligned)
13+
SYM_TYPED_FUNC_START(__riscv_copy_words_unaligned)
1314
andi a4, a2, ~((8*SZREG)-1)
1415
beqz a4, 2f
1516
add a3, a1, a4
@@ -41,7 +42,7 @@ SYM_FUNC_END(__riscv_copy_words_unaligned)
4142
/* void __riscv_copy_bytes_unaligned(void *, const void *, size_t) */
4243
/* Performs a memcpy without aligning buffers, using only byte accesses. */
4344
/* Note: The size is truncated to a multiple of 8 */
44-
SYM_FUNC_START(__riscv_copy_bytes_unaligned)
45+
SYM_TYPED_FUNC_START(__riscv_copy_bytes_unaligned)
4546
andi a4, a2, ~(8-1)
4647
beqz a4, 2f
4748
add a3, a1, a4

0 commit comments

Comments
 (0)