CONFIG_REGPARM breaks non-asmlinkage syscalls
Subsystems (2)
Hello,
with CONFIG_REGPARM=y, syscalls must be declared asmlinkage or else calling them will fail. Current gcc unfortunately does not warn about this. (I have already told one of our compiler developers.) Attached is a fix that adds a few missing declarations.
Regards,
Signature · 2 lines
Andreas Gruenbacher <[email protected]> SUSE Labs, SUSE LINUX AG
arch/ia64/ia32/sys_ia32.c +1 -1
@@ -2990,7 +2990,7 @@ sys32_timer_create(u32 clock, struct sigreturn err; } -extern long sys_fadvise64_64 (int fd,loff_t offset,loff_t len,int advice); +extern asmlinkage long sys_fadvise64_64 (int fd,loff_t offset,loff_t len,int advice);long sys32_fadvise64_64 (int fd,__u32 offset_low,__u32 offset_high,__u32 len_low,__u32 len_high,int advice)
arch/x86_64/ia32/sys_ia32.c +1 -1
@@ -1895,7 +1895,7 @@ sys32_timer_create(u32 clock, struct sigreturn err; } -extern long sys_fadvise64_64 (int fd,loff_t offset,loff_t len,int advice); +extern asmlinkage long sys_fadvise64_64 (int fd,loff_t offset,loff_t len,int advice);long sys32_fadvise64_64 (int fd,__u32 offset_low,__u32 offset_high,__u32 len_low,__u32 len_high,int advice)
include/linux/mm.h +2 -2
@@ -455,8 +455,8 @@ extern int install_file_pte(struct mm_stextern int handle_mm_fault (struct mm_struct *mm,struct vm_area_struct *vma,unsigned long address,int write_access);extern int make_pages_present (unsigned long addr,unsigned long end);extern int access_process_vm (struct task_struct *tsk,unsigned long addr,void *buf,int len,int write); -extern long sys_remap_file_pages (unsigned long start,unsigned long size,unsigned long prot,unsigned long pgoff,unsigned long nonblock); -extern long sys_fadvise64_64 (int fd,loff_t offset,loff_t len,int advice); +extern asmlinkage long sys_remap_file_pages (unsigned long start,unsigned long size,unsigned long prot,unsigned long pgoff,unsigned long nonblock); +extern asmlinkage long sys_fadvise64_64 (int fd,loff_t offset,loff_t len,int advice);void put_dirty_page (struct task_struct *tsk,struct page *page,unsigned long address,pgprot_t prot);
include/linux/shm.h +1 -1
@@ -90,7 +90,7 @@ struct shmid_kernel /* private to the ke#define SHM_LOCKED 02000/* segment will not be swapped */ #define SHM_HUGETLB 04000/* segment will use huge TLB pages */ -long sys_shmat (int shmid,char __user *shmaddr,int shmflg,unsigned long *addr); +asmlinkage long sys_shmat (int shmid,char __user *shmaddr,int shmflg,unsigned long *addr);asmlinkage long sys_shmget (key_t key,size_t size,int flag);asmlinkage long sys_shmdt (char __user *shmaddr);asmlinkage long sys_shmctl (int shmid,int cmd,struct shmid_ds __user *buf);
mm/fremap.c +1 -1
@@ -155,7 +155,7 @@ err_unlock:* protection is used. Arbitrary protections might be implemented in the * future. */ -long sys_remap_file_pages (unsigned long start,unsigned long size, +asmlinkage long sys_remap_file_pages (unsigned long start,unsigned long size,unsigned long __prot,unsigned long pgoff,unsigned long flags) {struct mm_struct *mm = current->mm;
Quoted 5 lines · Andreas Gruenbacher
with
CONFIG_REGPARM=y, syscalls must be declared asmlinkage or else
calling them will fail. Current gcc unfortunately does not warn about this. (I have already told one of our compiler developers.) Attached is a fix that adds a few missing declarations.
hm, thanks. These should all be fixed by the "put all syscall decls in syscalls.h" patch. I'll hurry that along a bit.