Skip to content

Commit 34258a3

Browse files
committed
Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
Pull s390 fixes from Martin Schwidefsky: "Assorted bug fixes, the mlock2 system call gets added, and one improvement. The boot from dasd devices is now possible from a wider range of devices" * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux: s390: remove SALIPL loader s390: wire up mlock2 system call s390: remove g5 elf platform support s390: avoid cache aliasing under z/VM and KVM s390/sclp: _sclp_wait_int(): retain full PSW mask s390/zcrypt: Fix initialisation when zcrypt is built-in s390/zcrypt: Fix kernel crash on systems without AP bus support s390: add support for ipl devices in subchannel sets > 0 s390/ipl: fix out of bounds access in scpdata_write s390/pci_dma: improve debugging of errors during dma map s390/pci_dma: handle dma table failures s390/pci_dma: unify label of invalid translation table entries s390/syscalls: remove system call number calculation s390/cio: simplify css_generate_pgid s390/diag: add a s390 prefix to the diagnose trace point s390/head: fix error message on unsupported hardware
2 parents 0d77a12 + f52c74f commit 34258a3

File tree

29 files changed

+247
-278
lines changed

29 files changed

+247
-278
lines changed

arch/s390/include/asm/cio.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,7 @@ extern void css_schedule_reprobe(void);
312312
extern void reipl_ccw_dev(struct ccw_dev_id *id);
313313

314314
struct cio_iplinfo {
315+
u8 ssid;
315316
u16 devno;
316317
int is_qdio;
317318
};

arch/s390/include/asm/elf.h

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -206,9 +206,16 @@ do { \
206206
} while (0)
207207
#endif /* CONFIG_COMPAT */
208208

209-
extern unsigned long mmap_rnd_mask;
210-
211-
#define STACK_RND_MASK (test_thread_flag(TIF_31BIT) ? 0x7ff : mmap_rnd_mask)
209+
/*
210+
* Cache aliasing on the latest machines calls for a mapping granularity
211+
* of 512KB. For 64-bit processes use a 512KB alignment and a randomization
212+
* of up to 1GB. For 31-bit processes the virtual address space is limited,
213+
* use no alignment and limit the randomization to 8MB.
214+
*/
215+
#define BRK_RND_MASK (is_32bit_task() ? 0x7ffUL : 0x3ffffUL)
216+
#define MMAP_RND_MASK (is_32bit_task() ? 0x7ffUL : 0x3ff80UL)
217+
#define MMAP_ALIGN_MASK (is_32bit_task() ? 0 : 0x7fUL)
218+
#define STACK_RND_MASK MMAP_RND_MASK
212219

213220
#define ARCH_DLINFO \
214221
do { \

arch/s390/include/asm/ipl.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,8 @@ struct ipl_block_fcp {
6464

6565
struct ipl_block_ccw {
6666
u8 reserved1[84];
67-
u8 reserved2[2];
67+
u16 reserved2 : 13;
68+
u8 ssid : 3;
6869
u16 devno;
6970
u8 vm_flags;
7071
u8 reserved3[3];

arch/s390/include/asm/pci_dma.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,5 +195,7 @@ void zpci_dma_exit_device(struct zpci_dev *);
195195
void dma_free_seg_table(unsigned long);
196196
unsigned long *dma_alloc_cpu_table(void);
197197
void dma_cleanup_tables(unsigned long *);
198-
void dma_update_cpu_trans(unsigned long *, void *, dma_addr_t, int);
198+
unsigned long *dma_walk_cpu_trans(unsigned long *rto, dma_addr_t dma_addr);
199+
void dma_update_cpu_trans(unsigned long *entry, void *page_addr, int flags);
200+
199201
#endif

arch/s390/include/asm/trace/diag.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
#define TRACE_INCLUDE_PATH asm/trace
2020
#define TRACE_INCLUDE_FILE diag
2121

22-
TRACE_EVENT(diagnose,
22+
TRACE_EVENT(s390_diagnose,
2323
TP_PROTO(unsigned short nr),
2424
TP_ARGS(nr),
2525
TP_STRUCT__entry(
@@ -32,9 +32,9 @@ TRACE_EVENT(diagnose,
3232
);
3333

3434
#ifdef CONFIG_TRACEPOINTS
35-
void trace_diagnose_norecursion(int diag_nr);
35+
void trace_s390_diagnose_norecursion(int diag_nr);
3636
#else
37-
static inline void trace_diagnose_norecursion(int diag_nr) { }
37+
static inline void trace_s390_diagnose_norecursion(int diag_nr) { }
3838
#endif
3939

4040
#endif /* _TRACE_S390_DIAG_H */

arch/s390/include/uapi/asm/unistd.h

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -192,14 +192,14 @@
192192
#define __NR_set_tid_address 252
193193
#define __NR_fadvise64 253
194194
#define __NR_timer_create 254
195-
#define __NR_timer_settime (__NR_timer_create+1)
196-
#define __NR_timer_gettime (__NR_timer_create+2)
197-
#define __NR_timer_getoverrun (__NR_timer_create+3)
198-
#define __NR_timer_delete (__NR_timer_create+4)
199-
#define __NR_clock_settime (__NR_timer_create+5)
200-
#define __NR_clock_gettime (__NR_timer_create+6)
201-
#define __NR_clock_getres (__NR_timer_create+7)
202-
#define __NR_clock_nanosleep (__NR_timer_create+8)
195+
#define __NR_timer_settime 255
196+
#define __NR_timer_gettime 256
197+
#define __NR_timer_getoverrun 257
198+
#define __NR_timer_delete 258
199+
#define __NR_clock_settime 259
200+
#define __NR_clock_gettime 260
201+
#define __NR_clock_getres 261
202+
#define __NR_clock_nanosleep 262
203203
/* Number 263 is reserved for vserver */
204204
#define __NR_statfs64 265
205205
#define __NR_fstatfs64 266
@@ -309,7 +309,8 @@
309309
#define __NR_recvfrom 371
310310
#define __NR_recvmsg 372
311311
#define __NR_shutdown 373
312-
#define NR_syscalls 374
312+
#define __NR_mlock2 374
313+
#define NR_syscalls 375
313314

314315
/*
315316
* There are some system calls that are not present on 64 bit, some

arch/s390/kernel/compat_wrapper.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,3 +176,4 @@ COMPAT_SYSCALL_WRAP4(accept4, int, fd, struct sockaddr __user *, upeer_sockaddr,
176176
COMPAT_SYSCALL_WRAP3(getsockname, int, fd, struct sockaddr __user *, usockaddr, int __user *, usockaddr_len);
177177
COMPAT_SYSCALL_WRAP3(getpeername, int, fd, struct sockaddr __user *, usockaddr, int __user *, usockaddr_len);
178178
COMPAT_SYSCALL_WRAP6(sendto, int, fd, void __user *, buff, size_t, len, unsigned int, flags, struct sockaddr __user *, addr, int, addr_len);
179+
COMPAT_SYSCALL_WRAP3(mlock2, unsigned long, start, size_t, len, int, flags);

arch/s390/kernel/diag.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,14 +121,14 @@ device_initcall(show_diag_stat_init);
121121
void diag_stat_inc(enum diag_stat_enum nr)
122122
{
123123
this_cpu_inc(diag_stat.counter[nr]);
124-
trace_diagnose(diag_map[nr].code);
124+
trace_s390_diagnose(diag_map[nr].code);
125125
}
126126
EXPORT_SYMBOL(diag_stat_inc);
127127

128128
void diag_stat_inc_norecursion(enum diag_stat_enum nr)
129129
{
130130
this_cpu_inc(diag_stat.counter[nr]);
131-
trace_diagnose_norecursion(diag_map[nr].code);
131+
trace_s390_diagnose_norecursion(diag_map[nr].code);
132132
}
133133
EXPORT_SYMBOL(diag_stat_inc_norecursion);
134134

arch/s390/kernel/head.S

Lines changed: 12 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#include <asm/asm-offsets.h>
2727
#include <asm/thread_info.h>
2828
#include <asm/page.h>
29+
#include <asm/ptrace.h>
2930

3031
#define ARCH_OFFSET 4
3132

@@ -59,19 +60,6 @@ __HEAD
5960
.long 0x020006e0,0x20000050
6061

6162
.org 0x200
62-
#
63-
# subroutine to set architecture mode
64-
#
65-
.Lsetmode:
66-
mvi __LC_AR_MODE_ID,1 # set esame flag
67-
slr %r0,%r0 # set cpuid to zero
68-
lhi %r1,2 # mode 2 = esame (dump)
69-
sigp %r1,%r0,0x12 # switch to esame mode
70-
bras %r13,0f
71-
.fill 16,4,0x0
72-
0: lmh %r0,%r15,0(%r13) # clear high-order half of gprs
73-
sam31 # switch to 31 bit addressing mode
74-
br %r14
7563

7664
#
7765
# subroutine to wait for end I/O
@@ -159,7 +147,14 @@ __HEAD
159147
.long 0x02200050,0x00000000
160148

161149
iplstart:
162-
bas %r14,.Lsetmode # Immediately switch to 64 bit mode
150+
mvi __LC_AR_MODE_ID,1 # set esame flag
151+
slr %r0,%r0 # set cpuid to zero
152+
lhi %r1,2 # mode 2 = esame (dump)
153+
sigp %r1,%r0,0x12 # switch to esame mode
154+
bras %r13,0f
155+
.fill 16,4,0x0
156+
0: lmh %r0,%r15,0(%r13) # clear high-order half of gprs
157+
sam31 # switch to 31 bit addressing mode
163158
lh %r1,0xb8 # test if subchannel number
164159
bct %r1,.Lnoload # is valid
165160
l %r1,0xb8 # load ipl subchannel number
@@ -268,71 +263,6 @@ iplstart:
268263
.align 8
269264
.Lcpuid:.fill 8,1,0
270265

271-
#
272-
# SALIPL loader support. Based on a patch by Rob van der Heij.
273-
# This entry point is called directly from the SALIPL loader and
274-
# doesn't need a builtin ipl record.
275-
#
276-
.org 0x800
277-
ENTRY(start)
278-
stm %r0,%r15,0x07b0 # store registers
279-
bas %r14,.Lsetmode # Immediately switch to 64 bit mode
280-
basr %r12,%r0
281-
.base:
282-
l %r11,.parm
283-
l %r8,.cmd # pointer to command buffer
284-
285-
ltr %r9,%r9 # do we have SALIPL parameters?
286-
bp .sk8x8
287-
288-
mvc 0(64,%r8),0x00b0 # copy saved registers
289-
xc 64(240-64,%r8),0(%r8) # remainder of buffer
290-
tr 0(64,%r8),.lowcase
291-
b .gotr
292-
.sk8x8:
293-
mvc 0(240,%r8),0(%r9) # copy iplparms into buffer
294-
.gotr:
295-
slr %r0,%r0
296-
st %r0,INITRD_SIZE+ARCH_OFFSET-PARMAREA(%r11)
297-
st %r0,INITRD_START+ARCH_OFFSET-PARMAREA(%r11)
298-
j startup # continue with startup
299-
.cmd: .long COMMAND_LINE # address of command line buffer
300-
.parm: .long PARMAREA
301-
.lowcase:
302-
.byte 0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07
303-
.byte 0x08,0x09,0x0a,0x0b,0x0c,0x0d,0x0e,0x0f
304-
.byte 0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17
305-
.byte 0x18,0x19,0x1a,0x1b,0x1c,0x1d,0x1e,0x1f
306-
.byte 0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27
307-
.byte 0x28,0x29,0x2a,0x2b,0x2c,0x2d,0x2e,0x2f
308-
.byte 0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37
309-
.byte 0x38,0x39,0x3a,0x3b,0x3c,0x3d,0x3e,0x3f
310-
.byte 0x40,0x41,0x42,0x43,0x44,0x45,0x46,0x47
311-
.byte 0x48,0x49,0x4a,0x4b,0x4c,0x4d,0x4e,0x4f
312-
.byte 0x50,0x51,0x52,0x53,0x54,0x55,0x56,0x57
313-
.byte 0x58,0x59,0x5a,0x5b,0x5c,0x5d,0x5e,0x5f
314-
.byte 0x60,0x61,0x62,0x63,0x64,0x65,0x66,0x67
315-
.byte 0x68,0x69,0x6a,0x6b,0x6c,0x6d,0x6e,0x6f
316-
.byte 0x70,0x71,0x72,0x73,0x74,0x75,0x76,0x77
317-
.byte 0x78,0x79,0x7a,0x7b,0x7c,0x7d,0x7e,0x7f
318-
319-
.byte 0x80,0x81,0x82,0x83,0x84,0x85,0x86,0x87
320-
.byte 0x88,0x89,0x8a,0x8b,0x8c,0x8d,0x8e,0x8f
321-
.byte 0x90,0x91,0x92,0x93,0x94,0x95,0x96,0x97
322-
.byte 0x98,0x99,0x9a,0x9b,0x9c,0x9d,0x9e,0x9f
323-
.byte 0xa0,0xa1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7
324-
.byte 0xa8,0xa9,0xaa,0xab,0xac,0xad,0xae,0xaf
325-
.byte 0xb0,0xb1,0xb2,0xb3,0xb4,0xb5,0xb6,0xb7
326-
.byte 0xb8,0xb9,0xba,0xbb,0xbc,0xbd,0xbe,0xbf
327-
.byte 0xc0,0x81,0x82,0x83,0x84,0x85,0x86,0x87 # .abcdefg
328-
.byte 0x88,0x89,0xca,0xcb,0xcc,0xcd,0xce,0xcf # hi
329-
.byte 0xd0,0x91,0x92,0x93,0x94,0x95,0x96,0x97 # .jklmnop
330-
.byte 0x98,0x99,0xda,0xdb,0xdc,0xdd,0xde,0xdf # qr
331-
.byte 0xe0,0xe1,0xa2,0xa3,0xa4,0xa5,0xa6,0xa7 # ..stuvwx
332-
.byte 0xa8,0xa9,0xea,0xeb,0xec,0xed,0xee,0xef # yz
333-
.byte 0xf0,0xf1,0xf2,0xf3,0xf4,0xf5,0xf6,0xf7
334-
.byte 0xf8,0xf9,0xfa,0xfb,0xfc,0xfd,0xfe,0xff
335-
336266
#
337267
# startup-code at 0x10000, running in absolute addressing mode
338268
# this is called either by the ipl loader or directly by PSW restart
@@ -364,7 +294,7 @@ ENTRY(startup_kdump)
364294
bras %r13,0f
365295
.fill 16,4,0x0
366296
0: lmh %r0,%r15,0(%r13) # clear high-order half of gprs
367-
sam31 # switch to 31 bit addressing mode
297+
sam64 # switch to 64 bit addressing mode
368298
basr %r13,0 # get base
369299
.LPG0:
370300
xc 0x200(256),0x200 # partially clear lowcore
@@ -395,7 +325,7 @@ ENTRY(startup_kdump)
395325
jnz 1b
396326
j 4f
397327
2: l %r15,.Lstack-.LPG0(%r13)
398-
ahi %r15,-96
328+
ahi %r15,-STACK_FRAME_OVERHEAD
399329
la %r2,.Lals_string-.LPG0(%r13)
400330
l %r3,.Lsclp_print-.LPG0(%r13)
401331
basr %r14,%r3
@@ -429,8 +359,7 @@ ENTRY(startup_kdump)
429359
.long 1, 0xc0000000
430360
#endif
431361
4:
432-
/* Continue with 64bit startup code in head64.S */
433-
sam64 # switch to 64 bit mode
362+
/* Continue with startup code in head64.S */
434363
jg startup_continue
435364

436365
.align 8

0 commit comments

Comments
 (0)