Skip to content

Commit 6cb51a4

Browse files
apply changes from Coreforge's rpi-6.6.y-gpu branch and resolve conflicts
1 parent a4a4d7f commit 6cb51a4

37 files changed

+1130
-139
lines changed

arch/arm64/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1665,6 +1665,14 @@ config ARM64_TAGGED_ADDR_ABI
16651665
to system calls as pointer arguments. For details, see
16661666
Documentation/arch/arm64/tagged-address-abi.rst.
16671667

1668+
config ARM64_ALIGNMENT_FIXUPS
1669+
bool "Fix up misaligned loads and stores from userspace for 64bit code"
1670+
default n
1671+
help
1672+
Userspace may incorrectly assume that certain memory does not need
1673+
any special alignment considerations, which may result in Bus Erros.
1674+
Enable to handle these faults in the kernel.
1675+
16681676
menuconfig COMPAT
16691677
bool "Kernel support for 32-bit EL0"
16701678
depends on ARM64_4K_PAGES || EXPERT

arch/arm64/include/asm/exception.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ void do_sp_pc_abort(unsigned long addr, unsigned long esr, struct pt_regs *regs)
6868
void bad_el0_sync(struct pt_regs *regs, int reason, unsigned long esr);
6969
void do_el0_cp15(unsigned long esr, struct pt_regs *regs);
7070
int do_compat_alignment_fixup(unsigned long addr, struct pt_regs *regs);
71+
int do_alignment_fixup(unsigned long addr, struct pt_regs *regs);
7172
void do_el0_svc(struct pt_regs *regs);
7273
void do_el0_svc_compat(struct pt_regs *regs);
7374
void do_el0_fpac(struct pt_regs *regs, unsigned long esr);

arch/arm64/kernel/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,7 @@ obj-$(CONFIG_COMPAT) += sys32.o signal32.o \
4040
sys_compat.o
4141
obj-$(CONFIG_COMPAT) += sigreturn32.o
4242
obj-$(CONFIG_COMPAT_ALIGNMENT_FIXUPS) += compat_alignment.o
43+
obj-$(CONFIG_ARM64_ALIGNMENT_FIXUPS) += compat_alignment_64.o
4344
obj-$(CONFIG_KUSER_HELPERS) += kuser32.o
4445
obj-$(CONFIG_FUNCTION_TRACER) += ftrace.o entry-ftrace.o
4546
obj-$(CONFIG_MODULES) += module.o module-plts.o

arch/arm64/kernel/compat_alignment.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -318,7 +318,7 @@ int do_compat_alignment_fixup(unsigned long addr, struct pt_regs *regs)
318318
int thumb2_32b = 0;
319319

320320
instrptr = instruction_pointer(regs);
321-
321+
printk("Alignment fixup\n");
322322
if (compat_thumb_mode(regs)) {
323323
__le16 __user *ptr = (__le16 __user *)(instrptr & ~1);
324324
u16 tinstr, tinst2;

0 commit comments

Comments
 (0)