Skip to content

Commit

Permalink
Merge tag 'riscv-for-linus-5.19-mw0' of git://git.kernel.org/pub/scm/…
Browse files Browse the repository at this point in the history
…linux/kernel/git/riscv/linux

Pull RISC-V updates from Palmer Dabbelt:

 - Support for the Svpbmt extension, which allows memory attributes to
   be encoded in pages

 - Support for the Allwinner D1's implementation of page-based memory
   attributes

 - Support for running rv32 binaries on rv64 systems, via the compat
   subsystem

 - Support for kexec_file()

 - Support for the new generic ticket-based spinlocks, which allows us
   to also move to qrwlock. These should have already gone in through
   the asm-geneic tree as well

 - A handful of cleanups and fixes, include some larger ones around
   atomics and XIP

* tag 'riscv-for-linus-5.19-mw0' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux: (51 commits)
  RISC-V: Prepare dropping week attribute from arch_kexec_apply_relocations[_add]
  riscv: compat: Using seperated vdso_maps for compat_vdso_info
  RISC-V: Fix the XIP build
  RISC-V: Split out the XIP fixups into their own file
  RISC-V: ignore xipImage
  RISC-V: Avoid empty create_*_mapping definitions
  riscv: Don't output a bogus mmu-type on a no MMU kernel
  riscv: atomic: Add custom conditional atomic operation implementation
  riscv: atomic: Optimize dec_if_positive functions
  riscv: atomic: Cleanup unnecessary definition
  RISC-V: Load purgatory in kexec_file
  RISC-V: Add purgatory
  RISC-V: Support for kexec_file on panic
  RISC-V: Add kexec_file support
  RISC-V: use memcpy for kexec_file mode
  kexec_file: Fix kexec_file.c build error for riscv platform
  riscv: compat: Add COMPAT Kbuild skeletal support
  riscv: compat: ptrace: Add compat_arch_ptrace implement
  riscv: compat: signal: Add rt_frame implementation
  riscv: add memory-type errata for T-Head
  ...
  • Loading branch information
torvalds committed May 31, 2022
2 parents e1cbc3b + 7699f7a commit 35b51af
Show file tree
Hide file tree
Showing 112 changed files with 2,785 additions and 787 deletions.
4 changes: 0 additions & 4 deletions arch/arm64/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -2157,10 +2157,6 @@ config DMI

endmenu # "Boot options"

config SYSVIPC_COMPAT
def_bool y
depends on COMPAT && SYSVIPC

menu "Power management options"

source "kernel/power/Kconfig"
Expand Down
93 changes: 9 additions & 84 deletions arch/arm64/include/asm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,15 @@
#define compat_mode_t compat_mode_t
typedef u16 compat_mode_t;

#define __compat_uid_t __compat_uid_t
typedef u16 __compat_uid_t;
typedef u16 __compat_gid_t;

#define compat_ipc_pid_t compat_ipc_pid_t
typedef u16 compat_ipc_pid_t;

#define compat_statfs compat_statfs

#include <asm-generic/compat.h>

#ifdef CONFIG_COMPAT
Expand All @@ -19,21 +28,15 @@ typedef u16 compat_mode_t;
#include <linux/sched.h>
#include <linux/sched/task_stack.h>

#define COMPAT_USER_HZ 100
#ifdef __AARCH64EB__
#define COMPAT_UTS_MACHINE "armv8b\0\0"
#else
#define COMPAT_UTS_MACHINE "armv8l\0\0"
#endif

typedef u16 __compat_uid_t;
typedef u16 __compat_gid_t;
typedef u16 __compat_uid16_t;
typedef u16 __compat_gid16_t;
typedef u32 compat_dev_t;
typedef s32 compat_nlink_t;
typedef u16 compat_ipc_pid_t;
typedef __kernel_fsid_t compat_fsid_t;

struct compat_stat {
#ifdef __AARCH64EB__
Expand Down Expand Up @@ -65,26 +68,6 @@ struct compat_stat {
compat_ulong_t __unused4[2];
};

struct compat_flock {
short l_type;
short l_whence;
compat_off_t l_start;
compat_off_t l_len;
compat_pid_t l_pid;
};

#define F_GETLK64 12 /* using 'struct flock64' */
#define F_SETLK64 13
#define F_SETLKW64 14

struct compat_flock64 {
short l_type;
short l_whence;
compat_loff_t l_start;
compat_loff_t l_len;
compat_pid_t l_pid;
};

struct compat_statfs {
int f_type;
int f_bsize;
Expand All @@ -107,64 +90,6 @@ struct compat_statfs {
#define compat_user_stack_pointer() (user_stack_pointer(task_pt_regs(current)))
#define COMPAT_MINSIGSTKSZ 2048

struct compat_ipc64_perm {
compat_key_t key;
__compat_uid32_t uid;
__compat_gid32_t gid;
__compat_uid32_t cuid;
__compat_gid32_t cgid;
unsigned short mode;
unsigned short __pad1;
unsigned short seq;
unsigned short __pad2;
compat_ulong_t unused1;
compat_ulong_t unused2;
};

struct compat_semid64_ds {
struct compat_ipc64_perm sem_perm;
compat_ulong_t sem_otime;
compat_ulong_t sem_otime_high;
compat_ulong_t sem_ctime;
compat_ulong_t sem_ctime_high;
compat_ulong_t sem_nsems;
compat_ulong_t __unused3;
compat_ulong_t __unused4;
};

struct compat_msqid64_ds {
struct compat_ipc64_perm msg_perm;
compat_ulong_t msg_stime;
compat_ulong_t msg_stime_high;
compat_ulong_t msg_rtime;
compat_ulong_t msg_rtime_high;
compat_ulong_t msg_ctime;
compat_ulong_t msg_ctime_high;
compat_ulong_t msg_cbytes;
compat_ulong_t msg_qnum;
compat_ulong_t msg_qbytes;
compat_pid_t msg_lspid;
compat_pid_t msg_lrpid;
compat_ulong_t __unused4;
compat_ulong_t __unused5;
};

struct compat_shmid64_ds {
struct compat_ipc64_perm shm_perm;
compat_size_t shm_segsz;
compat_ulong_t shm_atime;
compat_ulong_t shm_atime_high;
compat_ulong_t shm_dtime;
compat_ulong_t shm_dtime_high;
compat_ulong_t shm_ctime;
compat_ulong_t shm_ctime_high;
compat_pid_t shm_cpid;
compat_pid_t shm_lpid;
compat_ulong_t shm_nattch;
compat_ulong_t __unused4;
compat_ulong_t __unused5;
};

static inline int is_compat_task(void)
{
return test_thread_flag(TIF_32BIT);
Expand Down
1 change: 1 addition & 0 deletions arch/arm64/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
* Copyright (C) 2012 ARM Ltd.
*/
#ifdef CONFIG_COMPAT
#define __ARCH_WANT_COMPAT_STAT
#define __ARCH_WANT_COMPAT_STAT64
#define __ARCH_WANT_SYS_GETHOSTNAME
#define __ARCH_WANT_SYS_PAUSE
Expand Down
5 changes: 0 additions & 5 deletions arch/mips/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3198,16 +3198,12 @@ config MIPS32_COMPAT
config COMPAT
bool

config SYSVIPC_COMPAT
bool

config MIPS32_O32
bool "Kernel support for o32 binaries"
depends on 64BIT
select ARCH_WANT_OLD_COMPAT_IPC
select COMPAT
select MIPS32_COMPAT
select SYSVIPC_COMPAT if SYSVIPC
help
Select this option if you want to run o32 binaries. These are pure
32-bit binaries as used by the 32-bit Linux/MIPS port. Most of
Expand All @@ -3221,7 +3217,6 @@ config MIPS32_N32
select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
select COMPAT
select MIPS32_COMPAT
select SYSVIPC_COMPAT if SYSVIPC
help
Select this option if you want to run n32 binaries. These are
64-bit binaries using 32-bit quantities for addressing and certain
Expand Down
41 changes: 9 additions & 32 deletions arch/mips/include/asm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -9,28 +9,28 @@
#include <asm/page.h>
#include <asm/ptrace.h>

#define __compat_uid_t __compat_uid_t
typedef s32 __compat_uid_t;
typedef s32 __compat_gid_t;

typedef __compat_uid_t __compat_uid32_t;
typedef __compat_gid_t __compat_gid32_t;
#define __compat_uid32_t __compat_uid32_t
#define __compat_gid32_t __compat_gid32_t

#define compat_statfs compat_statfs
#define compat_ipc64_perm compat_ipc64_perm

#define _COMPAT_NSIG 128 /* Don't ask !$@#% ... */
#define _COMPAT_NSIG_BPW 32
typedef u32 compat_sigset_word;

#define COMPAT_RLIM_INFINITY 0x7fffffffUL

#include <asm-generic/compat.h>

#define COMPAT_USER_HZ 100
#define COMPAT_UTS_MACHINE "mips\0\0\0"

typedef u32 compat_dev_t;
typedef u32 compat_nlink_t;
typedef s32 compat_ipc_pid_t;
typedef struct {
s32 val[2];
} compat_fsid_t;

struct compat_stat {
compat_dev_t st_dev;
Expand All @@ -55,27 +55,8 @@ struct compat_stat {
s32 st_pad4[14];
};

struct compat_flock {
short l_type;
short l_whence;
compat_off_t l_start;
compat_off_t l_len;
s32 l_sysid;
compat_pid_t l_pid;
s32 pad[4];
};

#define F_GETLK64 33
#define F_SETLK64 34
#define F_SETLKW64 35

struct compat_flock64 {
short l_type;
short l_whence;
compat_loff_t l_start;
compat_loff_t l_len;
compat_pid_t l_pid;
};
#define __ARCH_COMPAT_FLOCK_EXTRA_SYSID s32 l_sysid;
#define __ARCH_COMPAT_FLOCK_PAD s32 pad[4];

struct compat_statfs {
int f_type;
Expand All @@ -92,10 +73,6 @@ struct compat_statfs {
int f_spare[5];
};

#define COMPAT_RLIM_INFINITY 0x7fffffffUL

#define COMPAT_OFF_T_MAX 0x7fffffff

struct compat_ipc64_perm {
compat_key_t key;
__compat_uid32_t uid;
Expand Down
2 changes: 2 additions & 0 deletions arch/mips/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@
# ifdef CONFIG_32BIT
# define __ARCH_WANT_STAT64
# define __ARCH_WANT_SYS_TIME32
# else
# define __ARCH_WANT_COMPAT_STAT
# endif
# ifdef CONFIG_MIPS32_O32
# define __ARCH_WANT_SYS_TIME32
Expand Down
30 changes: 5 additions & 25 deletions arch/mips/include/uapi/asm/fcntl.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,36 +44,16 @@
#define F_SETOWN 24 /* for sockets. */
#define F_GETOWN 23 /* for sockets. */

#ifndef __mips64
#if __BITS_PER_LONG == 32 || defined(__KERNEL__)
#define F_GETLK64 33 /* using 'struct flock64' */
#define F_SETLK64 34
#define F_SETLKW64 35
#endif

/*
* The flavours of struct flock. "struct flock" is the ABI compliant
* variant. Finally struct flock64 is the LFS variant of struct flock. As
* a historic accident and inconsistence with the ABI definition it doesn't
* contain all the same fields as struct flock.
*/
#endif /* __BITS_PER_LONG == 32 || defined(__KERNEL__) */

#if _MIPS_SIM != _MIPS_SIM_ABI64

#include <linux/types.h>

struct flock {
short l_type;
short l_whence;
__kernel_off_t l_start;
__kernel_off_t l_len;
long l_sysid;
__kernel_pid_t l_pid;
long pad[4];
};

#define HAVE_ARCH_STRUCT_FLOCK

#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
#define __ARCH_FLOCK_EXTRA_SYSID long l_sysid;
#define __ARCH_FLOCK_PAD long pad[4];
#endif

#include <asm-generic/fcntl.h>

Expand Down
4 changes: 0 additions & 4 deletions arch/parisc/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -332,10 +332,6 @@ config COMPAT
def_bool y
depends on 64BIT

config SYSVIPC_COMPAT
def_bool y
depends on COMPAT && SYSVIPC

config AUDIT_ARCH
def_bool y

Expand Down
45 changes: 5 additions & 40 deletions arch/parisc/include/asm/compat.h
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
#define compat_mode_t compat_mode_t
typedef u16 compat_mode_t;

#define compat_ipc_pid_t compat_ipc_pid_t
typedef u16 compat_ipc_pid_t;

#define compat_ipc64_perm compat_ipc64_perm

#include <asm-generic/compat.h>

#define COMPAT_USER_HZ 100
#define COMPAT_UTS_MACHINE "parisc\0\0"

typedef u32 __compat_uid_t;
typedef u32 __compat_gid_t;
typedef u32 compat_dev_t;
typedef u16 compat_nlink_t;
typedef u16 compat_ipc_pid_t;

struct compat_stat {
compat_dev_t st_dev; /* dev_t is 32 bits on parisc */
Expand Down Expand Up @@ -53,37 +53,6 @@ struct compat_stat {
u32 st_spare4[3];
};

struct compat_flock {
short l_type;
short l_whence;
compat_off_t l_start;
compat_off_t l_len;
compat_pid_t l_pid;
};

struct compat_flock64 {
short l_type;
short l_whence;
compat_loff_t l_start;
compat_loff_t l_len;
compat_pid_t l_pid;
};

struct compat_statfs {
s32 f_type;
s32 f_bsize;
s32 f_blocks;
s32 f_bfree;
s32 f_bavail;
s32 f_files;
s32 f_ffree;
__kernel_fsid_t f_fsid;
s32 f_namelen;
s32 f_frsize;
s32 f_flags;
s32 f_spare[4];
};

struct compat_sigcontext {
compat_int_t sc_flags;
compat_int_t sc_gr[32]; /* PSW in sc_gr[0] */
Expand All @@ -93,10 +62,6 @@ struct compat_sigcontext {
compat_int_t sc_sar; /* cr11 */
};

#define COMPAT_RLIM_INFINITY 0xffffffff

#define COMPAT_OFF_T_MAX 0x7fffffff

struct compat_ipc64_perm {
compat_key_t key;
__compat_uid_t uid;
Expand Down
1 change: 1 addition & 0 deletions arch/parisc/include/asm/unistd.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
#define __ARCH_WANT_SYS_CLONE
#define __ARCH_WANT_SYS_CLONE3
#define __ARCH_WANT_COMPAT_SYS_SENDFILE
#define __ARCH_WANT_COMPAT_STAT

#ifdef CONFIG_64BIT
#define __ARCH_WANT_SYS_TIME
Expand Down
Loading

0 comments on commit 35b51af

Please sign in to comment.