Skip to content

Commit 35b51af

Browse files
committed
Merge tag 'riscv-for-linus-5.19-mw0' of git://git.kernel.org/pub/scm/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 ...
2 parents e1cbc3b + 7699f7a commit 35b51af

Some content is hidden

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

112 files changed

+2785
-787
lines changed

arch/arm64/Kconfig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2157,10 +2157,6 @@ config DMI
21572157

21582158
endmenu # "Boot options"
21592159

2160-
config SYSVIPC_COMPAT
2161-
def_bool y
2162-
depends on COMPAT && SYSVIPC
2163-
21642160
menu "Power management options"
21652161

21662162
source "kernel/power/Kconfig"

arch/arm64/include/asm/compat.h

Lines changed: 9 additions & 84 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,15 @@
88
#define compat_mode_t compat_mode_t
99
typedef u16 compat_mode_t;
1010

11+
#define __compat_uid_t __compat_uid_t
12+
typedef u16 __compat_uid_t;
13+
typedef u16 __compat_gid_t;
14+
15+
#define compat_ipc_pid_t compat_ipc_pid_t
16+
typedef u16 compat_ipc_pid_t;
17+
18+
#define compat_statfs compat_statfs
19+
1120
#include <asm-generic/compat.h>
1221

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

22-
#define COMPAT_USER_HZ 100
2331
#ifdef __AARCH64EB__
2432
#define COMPAT_UTS_MACHINE "armv8b\0\0"
2533
#else
2634
#define COMPAT_UTS_MACHINE "armv8l\0\0"
2735
#endif
2836

29-
typedef u16 __compat_uid_t;
30-
typedef u16 __compat_gid_t;
3137
typedef u16 __compat_uid16_t;
3238
typedef u16 __compat_gid16_t;
33-
typedef u32 compat_dev_t;
3439
typedef s32 compat_nlink_t;
35-
typedef u16 compat_ipc_pid_t;
36-
typedef __kernel_fsid_t compat_fsid_t;
3740

3841
struct compat_stat {
3942
#ifdef __AARCH64EB__
@@ -65,26 +68,6 @@ struct compat_stat {
6568
compat_ulong_t __unused4[2];
6669
};
6770

68-
struct compat_flock {
69-
short l_type;
70-
short l_whence;
71-
compat_off_t l_start;
72-
compat_off_t l_len;
73-
compat_pid_t l_pid;
74-
};
75-
76-
#define F_GETLK64 12 /* using 'struct flock64' */
77-
#define F_SETLK64 13
78-
#define F_SETLKW64 14
79-
80-
struct compat_flock64 {
81-
short l_type;
82-
short l_whence;
83-
compat_loff_t l_start;
84-
compat_loff_t l_len;
85-
compat_pid_t l_pid;
86-
};
87-
8871
struct compat_statfs {
8972
int f_type;
9073
int f_bsize;
@@ -107,64 +90,6 @@ struct compat_statfs {
10790
#define compat_user_stack_pointer() (user_stack_pointer(task_pt_regs(current)))
10891
#define COMPAT_MINSIGSTKSZ 2048
10992

110-
struct compat_ipc64_perm {
111-
compat_key_t key;
112-
__compat_uid32_t uid;
113-
__compat_gid32_t gid;
114-
__compat_uid32_t cuid;
115-
__compat_gid32_t cgid;
116-
unsigned short mode;
117-
unsigned short __pad1;
118-
unsigned short seq;
119-
unsigned short __pad2;
120-
compat_ulong_t unused1;
121-
compat_ulong_t unused2;
122-
};
123-
124-
struct compat_semid64_ds {
125-
struct compat_ipc64_perm sem_perm;
126-
compat_ulong_t sem_otime;
127-
compat_ulong_t sem_otime_high;
128-
compat_ulong_t sem_ctime;
129-
compat_ulong_t sem_ctime_high;
130-
compat_ulong_t sem_nsems;
131-
compat_ulong_t __unused3;
132-
compat_ulong_t __unused4;
133-
};
134-
135-
struct compat_msqid64_ds {
136-
struct compat_ipc64_perm msg_perm;
137-
compat_ulong_t msg_stime;
138-
compat_ulong_t msg_stime_high;
139-
compat_ulong_t msg_rtime;
140-
compat_ulong_t msg_rtime_high;
141-
compat_ulong_t msg_ctime;
142-
compat_ulong_t msg_ctime_high;
143-
compat_ulong_t msg_cbytes;
144-
compat_ulong_t msg_qnum;
145-
compat_ulong_t msg_qbytes;
146-
compat_pid_t msg_lspid;
147-
compat_pid_t msg_lrpid;
148-
compat_ulong_t __unused4;
149-
compat_ulong_t __unused5;
150-
};
151-
152-
struct compat_shmid64_ds {
153-
struct compat_ipc64_perm shm_perm;
154-
compat_size_t shm_segsz;
155-
compat_ulong_t shm_atime;
156-
compat_ulong_t shm_atime_high;
157-
compat_ulong_t shm_dtime;
158-
compat_ulong_t shm_dtime_high;
159-
compat_ulong_t shm_ctime;
160-
compat_ulong_t shm_ctime_high;
161-
compat_pid_t shm_cpid;
162-
compat_pid_t shm_lpid;
163-
compat_ulong_t shm_nattch;
164-
compat_ulong_t __unused4;
165-
compat_ulong_t __unused5;
166-
};
167-
16893
static inline int is_compat_task(void)
16994
{
17095
return test_thread_flag(TIF_32BIT);

arch/arm64/include/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* Copyright (C) 2012 ARM Ltd.
44
*/
55
#ifdef CONFIG_COMPAT
6+
#define __ARCH_WANT_COMPAT_STAT
67
#define __ARCH_WANT_COMPAT_STAT64
78
#define __ARCH_WANT_SYS_GETHOSTNAME
89
#define __ARCH_WANT_SYS_PAUSE

arch/mips/Kconfig

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3198,16 +3198,12 @@ config MIPS32_COMPAT
31983198
config COMPAT
31993199
bool
32003200

3201-
config SYSVIPC_COMPAT
3202-
bool
3203-
32043201
config MIPS32_O32
32053202
bool "Kernel support for o32 binaries"
32063203
depends on 64BIT
32073204
select ARCH_WANT_OLD_COMPAT_IPC
32083205
select COMPAT
32093206
select MIPS32_COMPAT
3210-
select SYSVIPC_COMPAT if SYSVIPC
32113207
help
32123208
Select this option if you want to run o32 binaries. These are pure
32133209
32-bit binaries as used by the 32-bit Linux/MIPS port. Most of
@@ -3221,7 +3217,6 @@ config MIPS32_N32
32213217
select ARCH_WANT_COMPAT_IPC_PARSE_VERSION
32223218
select COMPAT
32233219
select MIPS32_COMPAT
3224-
select SYSVIPC_COMPAT if SYSVIPC
32253220
help
32263221
Select this option if you want to run n32 binaries. These are
32273222
64-bit binaries using 32-bit quantities for addressing and certain

arch/mips/include/asm/compat.h

Lines changed: 9 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,28 @@
99
#include <asm/page.h>
1010
#include <asm/ptrace.h>
1111

12+
#define __compat_uid_t __compat_uid_t
1213
typedef s32 __compat_uid_t;
1314
typedef s32 __compat_gid_t;
15+
1416
typedef __compat_uid_t __compat_uid32_t;
1517
typedef __compat_gid_t __compat_gid32_t;
1618
#define __compat_uid32_t __compat_uid32_t
17-
#define __compat_gid32_t __compat_gid32_t
19+
20+
#define compat_statfs compat_statfs
21+
#define compat_ipc64_perm compat_ipc64_perm
1822

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

27+
#define COMPAT_RLIM_INFINITY 0x7fffffffUL
28+
2329
#include <asm-generic/compat.h>
2430

25-
#define COMPAT_USER_HZ 100
2631
#define COMPAT_UTS_MACHINE "mips\0\0\0"
2732

28-
typedef u32 compat_dev_t;
2933
typedef u32 compat_nlink_t;
30-
typedef s32 compat_ipc_pid_t;
31-
typedef struct {
32-
s32 val[2];
33-
} compat_fsid_t;
3434

3535
struct compat_stat {
3636
compat_dev_t st_dev;
@@ -55,27 +55,8 @@ struct compat_stat {
5555
s32 st_pad4[14];
5656
};
5757

58-
struct compat_flock {
59-
short l_type;
60-
short l_whence;
61-
compat_off_t l_start;
62-
compat_off_t l_len;
63-
s32 l_sysid;
64-
compat_pid_t l_pid;
65-
s32 pad[4];
66-
};
67-
68-
#define F_GETLK64 33
69-
#define F_SETLK64 34
70-
#define F_SETLKW64 35
71-
72-
struct compat_flock64 {
73-
short l_type;
74-
short l_whence;
75-
compat_loff_t l_start;
76-
compat_loff_t l_len;
77-
compat_pid_t l_pid;
78-
};
58+
#define __ARCH_COMPAT_FLOCK_EXTRA_SYSID s32 l_sysid;
59+
#define __ARCH_COMPAT_FLOCK_PAD s32 pad[4];
7960

8061
struct compat_statfs {
8162
int f_type;
@@ -92,10 +73,6 @@ struct compat_statfs {
9273
int f_spare[5];
9374
};
9475

95-
#define COMPAT_RLIM_INFINITY 0x7fffffffUL
96-
97-
#define COMPAT_OFF_T_MAX 0x7fffffff
98-
9976
struct compat_ipc64_perm {
10077
compat_key_t key;
10178
__compat_uid32_t uid;

arch/mips/include/asm/unistd.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@
5050
# ifdef CONFIG_32BIT
5151
# define __ARCH_WANT_STAT64
5252
# define __ARCH_WANT_SYS_TIME32
53+
# else
54+
# define __ARCH_WANT_COMPAT_STAT
5355
# endif
5456
# ifdef CONFIG_MIPS32_O32
5557
# define __ARCH_WANT_SYS_TIME32

arch/mips/include/uapi/asm/fcntl.h

Lines changed: 5 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -44,36 +44,16 @@
4444
#define F_SETOWN 24 /* for sockets. */
4545
#define F_GETOWN 23 /* for sockets. */
4646

47-
#ifndef __mips64
47+
#if __BITS_PER_LONG == 32 || defined(__KERNEL__)
4848
#define F_GETLK64 33 /* using 'struct flock64' */
4949
#define F_SETLK64 34
5050
#define F_SETLKW64 35
51-
#endif
52-
53-
/*
54-
* The flavours of struct flock. "struct flock" is the ABI compliant
55-
* variant. Finally struct flock64 is the LFS variant of struct flock. As
56-
* a historic accident and inconsistence with the ABI definition it doesn't
57-
* contain all the same fields as struct flock.
58-
*/
51+
#endif /* __BITS_PER_LONG == 32 || defined(__KERNEL__) */
5952

6053
#if _MIPS_SIM != _MIPS_SIM_ABI64
61-
62-
#include <linux/types.h>
63-
64-
struct flock {
65-
short l_type;
66-
short l_whence;
67-
__kernel_off_t l_start;
68-
__kernel_off_t l_len;
69-
long l_sysid;
70-
__kernel_pid_t l_pid;
71-
long pad[4];
72-
};
73-
74-
#define HAVE_ARCH_STRUCT_FLOCK
75-
76-
#endif /* _MIPS_SIM == _MIPS_SIM_ABI32 */
54+
#define __ARCH_FLOCK_EXTRA_SYSID long l_sysid;
55+
#define __ARCH_FLOCK_PAD long pad[4];
56+
#endif
7757

7858
#include <asm-generic/fcntl.h>
7959

arch/parisc/Kconfig

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -332,10 +332,6 @@ config COMPAT
332332
def_bool y
333333
depends on 64BIT
334334

335-
config SYSVIPC_COMPAT
336-
def_bool y
337-
depends on COMPAT && SYSVIPC
338-
339335
config AUDIT_ARCH
340336
def_bool y
341337

arch/parisc/include/asm/compat.h

Lines changed: 5 additions & 40 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@
1111
#define compat_mode_t compat_mode_t
1212
typedef u16 compat_mode_t;
1313

14+
#define compat_ipc_pid_t compat_ipc_pid_t
15+
typedef u16 compat_ipc_pid_t;
16+
17+
#define compat_ipc64_perm compat_ipc64_perm
18+
1419
#include <asm-generic/compat.h>
1520

16-
#define COMPAT_USER_HZ 100
1721
#define COMPAT_UTS_MACHINE "parisc\0\0"
1822

19-
typedef u32 __compat_uid_t;
20-
typedef u32 __compat_gid_t;
21-
typedef u32 compat_dev_t;
2223
typedef u16 compat_nlink_t;
23-
typedef u16 compat_ipc_pid_t;
2424

2525
struct compat_stat {
2626
compat_dev_t st_dev; /* dev_t is 32 bits on parisc */
@@ -53,37 +53,6 @@ struct compat_stat {
5353
u32 st_spare4[3];
5454
};
5555

56-
struct compat_flock {
57-
short l_type;
58-
short l_whence;
59-
compat_off_t l_start;
60-
compat_off_t l_len;
61-
compat_pid_t l_pid;
62-
};
63-
64-
struct compat_flock64 {
65-
short l_type;
66-
short l_whence;
67-
compat_loff_t l_start;
68-
compat_loff_t l_len;
69-
compat_pid_t l_pid;
70-
};
71-
72-
struct compat_statfs {
73-
s32 f_type;
74-
s32 f_bsize;
75-
s32 f_blocks;
76-
s32 f_bfree;
77-
s32 f_bavail;
78-
s32 f_files;
79-
s32 f_ffree;
80-
__kernel_fsid_t f_fsid;
81-
s32 f_namelen;
82-
s32 f_frsize;
83-
s32 f_flags;
84-
s32 f_spare[4];
85-
};
86-
8756
struct compat_sigcontext {
8857
compat_int_t sc_flags;
8958
compat_int_t sc_gr[32]; /* PSW in sc_gr[0] */
@@ -93,10 +62,6 @@ struct compat_sigcontext {
9362
compat_int_t sc_sar; /* cr11 */
9463
};
9564

96-
#define COMPAT_RLIM_INFINITY 0xffffffff
97-
98-
#define COMPAT_OFF_T_MAX 0x7fffffff
99-
10065
struct compat_ipc64_perm {
10166
compat_key_t key;
10267
__compat_uid_t uid;

arch/parisc/include/asm/unistd.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -162,6 +162,7 @@ type name(type1 arg1, type2 arg2, type3 arg3, type4 arg4, type5 arg5) \
162162
#define __ARCH_WANT_SYS_CLONE
163163
#define __ARCH_WANT_SYS_CLONE3
164164
#define __ARCH_WANT_COMPAT_SYS_SENDFILE
165+
#define __ARCH_WANT_COMPAT_STAT
165166

166167
#ifdef CONFIG_64BIT
167168
#define __ARCH_WANT_SYS_TIME

0 commit comments

Comments
 (0)