Skip to content

Commit

Permalink
Merge tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm
Browse files Browse the repository at this point in the history
Pull ARM updates from Russell King:

 - lots of build cleanups from Arnd spread throughout the arch/arm tree

 - replace strlcpy() with the preferred strscpy()

 - use sign_extend32() in the module linker

 - drop handle_irq() machine descriptor method

* tag 'for-linus' of git://git.armlinux.org.uk/~rmk/linux-arm:
  ARM: 9315/1: fiq: include asm/mach/irq.h for prototypes
  ARM: 9314/1: tcm: move tcm_init() prototype to asm/tcm.h
  ARM: 9313/1: vdso: add missing prototypes
  ARM: 9312/1: vfp: include asm/neon.h in vfpmodule.c
  ARM: 9311/1: decompressor: move function prototypes to misc.h
  ARM: 9310/1: xip-kernel: add __inflate_kernel_data prototype
  ARM: 9309/1: add missing syscall prototypes
  ARM: 9308/1: move setup functions to header
  ARM: 9307/1: nommu: include asm/idmap.h
  ARM: 9306/1: cacheflush: avoid __flush_anon_page() missing-prototype warning
  ARM: 9305/1: add clear/copy_user_highpage declarations
  ARM: 9304/1: add prototype for function called only from asm
  ARM: 9303/1: kprobes: avoid missing-declaration warnings
  ARM: 9302/1: traps: hide unused functions on NOMMU
  ARM: 9301/1: dma-mapping: hide unused dma_contiguous_early_fixup function
  ARM: 9300/1: Replace all non-returning strlcpy with strscpy
  ARM: 9299/1: module: use sign_extend32() to extend the signedness
  ARM: 9298/1: Drop custom mdesc->handle_irq()
  • Loading branch information
torvalds committed Jun 27, 2023
2 parents f810c18 + 85e18ed commit 2b603cd
Show file tree
Hide file tree
Showing 55 changed files with 185 additions and 80 deletions.
1 change: 1 addition & 0 deletions arch/arm/boot/compressed/atags_to_fdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
#include <linux/libfdt_env.h>
#include <asm/setup.h>
#include <libfdt.h>
#include "misc.h"

#if defined(CONFIG_ARM_ATAG_DTB_COMPAT_CMDLINE_EXTEND)
#define do_extend_cmdline 1
Expand Down
1 change: 1 addition & 0 deletions arch/arm/boot/compressed/fdt_check_mem_start.c
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
#include <linux/kernel.h>
#include <linux/libfdt.h>
#include <linux/sizes.h>
#include "misc.h"

static const void *get_prop(const void *fdt, const char *node_path,
const char *property, int minlen)
Expand Down
6 changes: 0 additions & 6 deletions arch/arm/boot/compressed/misc.c
Original file line number Diff line number Diff line change
Expand Up @@ -103,9 +103,6 @@ static void putstr(const char *ptr)
/*
* gzip declarations
*/
extern char input_data[];
extern char input_data_end[];

unsigned char *output_data;

unsigned long free_mem_ptr;
Expand All @@ -131,9 +128,6 @@ asmlinkage void __div0(void)
error("Attempting division by 0!");
}

extern int do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x));


void
decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p,
unsigned long free_mem_ptr_end_p,
Expand Down
11 changes: 11 additions & 0 deletions arch/arm/boot/compressed/misc.h
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,16 @@
void error(char *x) __noreturn;
extern unsigned long free_mem_ptr;
extern unsigned long free_mem_end_ptr;
void __div0(void);
void
decompress_kernel(unsigned long output_start, unsigned long free_mem_ptr_p,
unsigned long free_mem_ptr_end_p, int arch_id);
void fortify_panic(const char *name);
int atags_to_fdt(void *atag_list, void *fdt, int total_space);
uint32_t fdt_check_mem_start(uint32_t mem_start, const void *fdt);
int do_decompress(u8 *input, int len, u8 *output, void (*error)(char *x));

extern char input_data[];
extern char input_data_end[];

#endif
4 changes: 4 additions & 0 deletions arch/arm/include/asm/ftrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,10 @@ static inline bool arch_syscall_match_sym_name(const char *sym,
return !strcasecmp(sym, name);
}

void prepare_ftrace_return(unsigned long *parent, unsigned long self,
unsigned long frame_pointer,
unsigned long stack_pointer);

#endif /* ifndef __ASSEMBLY__ */

#endif /* _ASM_ARM_FTRACE */
1 change: 0 additions & 1 deletion arch/arm/include/asm/mach/arch.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ struct machine_desc {
void (*init_time)(void);
void (*init_machine)(void);
void (*init_late)(void);
void (*handle_irq)(struct pt_regs *);
void (*restart)(enum reboot_mode, const char *);
};

Expand Down
22 changes: 22 additions & 0 deletions arch/arm/include/asm/page.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,28 @@ struct cpu_user_fns {
unsigned long vaddr, struct vm_area_struct *vma);
};

void fa_copy_user_highpage(struct page *to, struct page *from,
unsigned long vaddr, struct vm_area_struct *vma);
void fa_clear_user_highpage(struct page *page, unsigned long vaddr);
void feroceon_copy_user_highpage(struct page *to, struct page *from,
unsigned long vaddr, struct vm_area_struct *vma);
void feroceon_clear_user_highpage(struct page *page, unsigned long vaddr);
void v4_mc_copy_user_highpage(struct page *to, struct page *from,
unsigned long vaddr, struct vm_area_struct *vma);
void v4_mc_clear_user_highpage(struct page *page, unsigned long vaddr);
void v4wb_copy_user_highpage(struct page *to, struct page *from,
unsigned long vaddr, struct vm_area_struct *vma);
void v4wb_clear_user_highpage(struct page *page, unsigned long vaddr);
void v4wt_copy_user_highpage(struct page *to, struct page *from,
unsigned long vaddr, struct vm_area_struct *vma);
void v4wt_clear_user_highpage(struct page *page, unsigned long vaddr);
void xsc3_mc_copy_user_highpage(struct page *to, struct page *from,
unsigned long vaddr, struct vm_area_struct *vma);
void xsc3_mc_clear_user_highpage(struct page *page, unsigned long vaddr);
void xscale_mc_copy_user_highpage(struct page *to, struct page *from,
unsigned long vaddr, struct vm_area_struct *vma);
void xscale_mc_clear_user_highpage(struct page *page, unsigned long vaddr);

#ifdef MULTI_USER
extern struct cpu_user_fns cpu_user;

Expand Down
3 changes: 3 additions & 0 deletions arch/arm/include/asm/ptrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -193,5 +193,8 @@ static inline unsigned long it_advance(unsigned long cpsr)
return cpsr;
}

int syscall_trace_enter(struct pt_regs *regs);
void syscall_trace_exit(struct pt_regs *regs);

#endif /* __ASSEMBLY__ */
#endif
7 changes: 7 additions & 0 deletions arch/arm/include/asm/setup.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,11 @@ extern void save_atags(const struct tag *tags);
static inline void save_atags(const struct tag *tags) { }
#endif

struct machine_desc;
void init_default_cache_policy(unsigned long);
void paging_init(const struct machine_desc *desc);
void early_mm_init(const struct machine_desc *);
void adjust_lowmem_bounds(void);
void setup_dma_zone(const struct machine_desc *desc);

#endif
5 changes: 5 additions & 0 deletions arch/arm/include/asm/signal.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,9 @@ typedef struct {
#define __ARCH_HAS_SA_RESTORER

#include <asm/sigcontext.h>

void do_rseq_syscall(struct pt_regs *regs);
int do_work_pending(struct pt_regs *regs, unsigned int thread_flags,
int syscall);

#endif
4 changes: 4 additions & 0 deletions arch/arm/include/asm/spectre.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,8 @@ static inline void spectre_v2_update_state(unsigned int state,

int spectre_bhb_update_vectors(unsigned int method);

void cpu_v7_ca8_ibe(void);
void cpu_v7_ca15_ibe(void);
void cpu_v7_bugs_init(void);

#endif
1 change: 1 addition & 0 deletions arch/arm/include/asm/suspend.h
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,6 @@ extern void cpu_resume(void);
extern void cpu_resume_no_hyp(void);
extern void cpu_resume_arm(void);
extern int cpu_suspend(unsigned long, int (*)(unsigned long));
extern void __cpu_suspend_save(u32 *ptr, u32 ptrsz, u32 sp, u32 *save_ptr);

#endif
51 changes: 51 additions & 0 deletions arch/arm/include/asm/syscalls.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
/* SPDX-License-Identifier: GPL-2.0-only */
#ifndef __ASM_SYSCALLS_H
#define __ASM_SYSCALLS_H

#include <linux/linkage.h>
#include <linux/types.h>

struct pt_regs;
asmlinkage int sys_sigreturn(struct pt_regs *regs);
asmlinkage int sys_rt_sigreturn(struct pt_regs *regs);
asmlinkage long sys_arm_fadvise64_64(int fd, int advice,
loff_t offset, loff_t len);

struct oldabi_stat64;
asmlinkage long sys_oabi_stat64(const char __user * filename,
struct oldabi_stat64 __user * statbuf);
asmlinkage long sys_oabi_lstat64(const char __user * filename,
struct oldabi_stat64 __user * statbuf);
asmlinkage long sys_oabi_fstat64(unsigned long fd,
struct oldabi_stat64 __user * statbuf);
asmlinkage long sys_oabi_fstatat64(int dfd,
const char __user *filename,
struct oldabi_stat64 __user *statbuf,
int flag);
asmlinkage long sys_oabi_fcntl64(unsigned int fd, unsigned int cmd,
unsigned long arg);
struct oabi_epoll_event;
asmlinkage long sys_oabi_epoll_ctl(int epfd, int op, int fd,
struct oabi_epoll_event __user *event);
struct oabi_sembuf;
struct old_timespec32;
asmlinkage long sys_oabi_semtimedop(int semid,
struct oabi_sembuf __user *tsops,
unsigned nsops,
const struct old_timespec32 __user *timeout);
asmlinkage long sys_oabi_semop(int semid, struct oabi_sembuf __user *tsops,
unsigned nsops);
asmlinkage int sys_oabi_ipc(uint call, int first, int second, int third,
void __user *ptr, long fifth);
struct sockaddr;
asmlinkage long sys_oabi_bind(int fd, struct sockaddr __user *addr, int addrlen);
asmlinkage long sys_oabi_connect(int fd, struct sockaddr __user *addr, int addrlen);
asmlinkage long sys_oabi_sendto(int fd, void __user *buff,
size_t len, unsigned flags,
struct sockaddr __user *addr,
int addrlen);
struct user_msghdr;
asmlinkage long sys_oabi_sendmsg(int fd, struct user_msghdr __user *msg, unsigned flags);
asmlinkage long sys_oabi_socketcall(int call, unsigned long __user *args);

#endif
11 changes: 8 additions & 3 deletions arch/arm/include/asm/tcm.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@
#ifndef __ASMARM_TCM_H
#define __ASMARM_TCM_H

#ifndef CONFIG_HAVE_TCM
#error "You should not be including tcm.h unless you have a TCM!"
#endif
#ifdef CONFIG_HAVE_TCM

#include <linux/compiler.h>

Expand All @@ -29,4 +27,11 @@ void tcm_free(void *addr, size_t len);
bool tcm_dtcm_present(void);
bool tcm_itcm_present(void);

void __init tcm_init(void);
#else
/* No TCM support, just blank inlines to be optimized out */
static inline void tcm_init(void)
{
}
#endif
#endif
9 changes: 9 additions & 0 deletions arch/arm/include/asm/traps.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,13 @@ extern void ptrace_break(struct pt_regs *regs);

extern void *vectors_page;

asmlinkage void dump_backtrace_stm(u32 *stack, u32 instruction, const char *loglvl);
asmlinkage void do_undefinstr(struct pt_regs *regs);
asmlinkage void handle_fiq_as_nmi(struct pt_regs *regs);
asmlinkage void bad_mode(struct pt_regs *regs, int reason);
asmlinkage int arm_syscall(int no, struct pt_regs *regs);
asmlinkage void baddataabort(int code, unsigned long instr, struct pt_regs *regs);
asmlinkage void __div0(void);
asmlinkage void handle_bad_stack(struct pt_regs *regs);

#endif
4 changes: 4 additions & 0 deletions arch/arm/include/asm/unwind.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ extern void unwind_table_del(struct unwind_table *tab);
extern void unwind_backtrace(struct pt_regs *regs, struct task_struct *tsk,
const char *loglvl);

void __aeabi_unwind_cpp_pr0(void);
void __aeabi_unwind_cpp_pr1(void);
void __aeabi_unwind_cpp_pr2(void);

#endif /* !__ASSEMBLY__ */

#ifdef CONFIG_ARM_UNWIND
Expand Down
5 changes: 5 additions & 0 deletions arch/arm/include/asm/vdso.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@ static inline void arm_install_vdso(struct mm_struct *mm, unsigned long addr)

#endif /* CONFIG_VDSO */

int __vdso_clock_gettime(clockid_t clock, struct old_timespec32 *ts);
int __vdso_clock_gettime64(clockid_t clock, struct __kernel_timespec *ts);
int __vdso_gettimeofday(struct __kernel_old_timeval *tv, struct timezone *tz);
int __vdso_clock_getres(clockid_t clock_id, struct old_timespec32 *res);

#endif /* __ASSEMBLY__ */

#endif /* __KERNEL__ */
Expand Down
1 change: 1 addition & 0 deletions arch/arm/include/asm/vfp.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,7 @@

#ifndef __ASSEMBLY__
void vfp_disable(void);
void VFP_bounce(u32 trigger, u32 fpexc, struct pt_regs *regs);
#endif

#endif /* __ASM_VFP_H */
4 changes: 2 additions & 2 deletions arch/arm/kernel/atags_parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ static int __init parse_tag_cmdline(const struct tag *tag)
#elif defined(CONFIG_CMDLINE_FORCE)
pr_warn("Ignoring tag cmdline (using the default kernel command line)\n");
#else
strlcpy(default_command_line, tag->u.cmdline.cmdline,
strscpy(default_command_line, tag->u.cmdline.cmdline,
COMMAND_LINE_SIZE);
#endif
return 0;
Expand Down Expand Up @@ -224,7 +224,7 @@ setup_machine_tags(void *atags_vaddr, unsigned int machine_nr)
}

/* parse_early_param needs a boot_command_line */
strlcpy(boot_command_line, from, COMMAND_LINE_SIZE);
strscpy(boot_command_line, from, COMMAND_LINE_SIZE);

return mdesc;
}
1 change: 1 addition & 0 deletions arch/arm/kernel/fiq.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
#include <asm/cacheflush.h>
#include <asm/cp15.h>
#include <asm/fiq.h>
#include <asm/mach/irq.h>
#include <asm/irq.h>
#include <asm/traps.h>

Expand Down
5 changes: 1 addition & 4 deletions arch/arm/kernel/head-inflate-data.c
Original file line number Diff line number Diff line change
Expand Up @@ -8,16 +8,13 @@

#include <linux/init.h>
#include <linux/zutil.h>
#include "head.h"

/* for struct inflate_state */
#include "../../../lib/zlib_inflate/inftrees.h"
#include "../../../lib/zlib_inflate/inflate.h"
#include "../../../lib/zlib_inflate/infutil.h"

extern char __data_loc[];
extern char _edata_loc[];
extern char _sdata[];

/*
* This code is called very early during the boot process to decompress
* the .data segment stored compressed in ROM. Therefore none of the global
Expand Down
7 changes: 7 additions & 0 deletions arch/arm/kernel/head.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
// SPDX-License-Identifier: GPL-2.0-only

extern char __data_loc[];
extern char _edata_loc[];
extern char _sdata[];

int __init __inflate_kernel_data(void);
10 changes: 4 additions & 6 deletions arch/arm/kernel/module.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,8 +169,7 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,

offset = __mem_to_opcode_arm(*(u32 *)loc);
offset = (offset & 0x00ffffff) << 2;
if (offset & 0x02000000)
offset -= 0x04000000;
offset = sign_extend32(offset, 25);

offset += sym->st_value - loc;

Expand Down Expand Up @@ -236,7 +235,7 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
case R_ARM_MOVT_PREL:
offset = tmp = __mem_to_opcode_arm(*(u32 *)loc);
offset = ((offset & 0xf0000) >> 4) | (offset & 0xfff);
offset = (offset ^ 0x8000) - 0x8000;
offset = sign_extend32(offset, 15);

offset += sym->st_value;
if (ELF32_R_TYPE(rel->r_info) == R_ARM_MOVT_PREL ||
Expand Down Expand Up @@ -344,8 +343,7 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
((~(j2 ^ sign) & 1) << 22) |
((upper & 0x03ff) << 12) |
((lower & 0x07ff) << 1);
if (offset & 0x01000000)
offset -= 0x02000000;
offset = sign_extend32(offset, 24);
offset += sym->st_value - loc;

/*
Expand Down Expand Up @@ -401,7 +399,7 @@ apply_relocate(Elf32_Shdr *sechdrs, const char *strtab, unsigned int symindex,
offset = ((upper & 0x000f) << 12) |
((upper & 0x0400) << 1) |
((lower & 0x7000) >> 4) | (lower & 0x00ff);
offset = (offset ^ 0x8000) - 0x8000;
offset = sign_extend32(offset, 15);
offset += sym->st_value;

if (ELF32_R_TYPE(rel->r_info) == R_ARM_THM_MOVT_PREL ||
Expand Down
13 changes: 1 addition & 12 deletions arch/arm/kernel/setup.c
Original file line number Diff line number Diff line change
Expand Up @@ -76,13 +76,6 @@ static int __init fpe_setup(char *line)
__setup("fpe=", fpe_setup);
#endif

extern void init_default_cache_policy(unsigned long);
extern void paging_init(const struct machine_desc *desc);
extern void early_mm_init(const struct machine_desc *);
extern void adjust_lowmem_bounds(void);
extern enum reboot_mode reboot_mode;
extern void setup_dma_zone(const struct machine_desc *desc);

unsigned int processor_id;
EXPORT_SYMBOL(processor_id);
unsigned int __machine_arch_type __read_mostly;
Expand Down Expand Up @@ -1142,7 +1135,7 @@ void __init setup_arch(char **cmdline_p)
setup_initial_init_mm(_text, _etext, _edata, _end);

/* populate cmd_line too for later use, preserving boot_command_line */
strlcpy(cmd_line, boot_command_line, COMMAND_LINE_SIZE);
strscpy(cmd_line, boot_command_line, COMMAND_LINE_SIZE);
*cmdline_p = cmd_line;

early_fixmap_init();
Expand Down Expand Up @@ -1198,10 +1191,6 @@ void __init setup_arch(char **cmdline_p)

reserve_crashkernel();

#ifdef CONFIG_GENERIC_IRQ_MULTI_HANDLER
handle_arch_irq = mdesc->handle_irq;
#endif

#ifdef CONFIG_VT
#if defined(CONFIG_VGA_CONSOLE)
conswitchp = &vga_con;
Expand Down
1 change: 1 addition & 0 deletions arch/arm/kernel/signal.c
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
#include <asm/traps.h>
#include <asm/unistd.h>
#include <asm/vfp.h>
#include <asm/syscalls.h>

#include "signal.h"

Expand Down
Loading

0 comments on commit 2b603cd

Please sign in to comment.