Skip to content

Commit a6a6d22

Browse files
committed
Merge tag 'for-5.16/parisc-4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux
Pull parisc fixes from Helge Deller: "parisc bug and warning fixes and wire up futex_waitv. Fix some warnings which showed up with allmodconfig builds, a revert of a change to the sigreturn trampoline which broke signal handling, wire up futex_waitv and add CONFIG_PRINTK_TIME=y to 32bit defconfig" * tag 'for-5.16/parisc-4' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux: parisc: Enable CONFIG_PRINTK_TIME=y in 32bit defconfig Revert "parisc: Reduce sigreturn trampoline to 3 instructions" parisc: Wrap assembler related defines inside __ASSEMBLY__ parisc: Wire up futex_waitv parisc: Include stringify.h to avoid build error in crypto/api.c parisc/sticon: fix reverse colors
2 parents c46e8ec + 9412f5a commit a6a6d22

File tree

8 files changed

+42
-34
lines changed

8 files changed

+42
-34
lines changed

arch/parisc/configs/generic-32bit_defconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ CONFIG_CRYPTO_DEFLATE=y
231231
CONFIG_CRC_CCITT=m
232232
CONFIG_CRC_T10DIF=y
233233
CONFIG_FONTS=y
234+
CONFIG_PRINTK_TIME=y
234235
CONFIG_MAGIC_SYSRQ=y
235236
CONFIG_DEBUG_FS=y
236237
CONFIG_DEBUG_MEMORY_INIT=y

arch/parisc/include/asm/assembly.h

Lines changed: 24 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -3,38 +3,19 @@
33
* Copyright (C) 1999 Hewlett-Packard (Frank Rowand)
44
* Copyright (C) 1999 Philipp Rumpf <prumpf@tux.org>
55
* Copyright (C) 1999 SuSE GmbH
6+
* Copyright (C) 2021 Helge Deller <deller@gmx.de>
67
*/
78

89
#ifndef _PARISC_ASSEMBLY_H
910
#define _PARISC_ASSEMBLY_H
1011

11-
#define CALLEE_FLOAT_FRAME_SIZE 80
12-
1312
#ifdef CONFIG_64BIT
14-
#define LDREG ldd
15-
#define STREG std
16-
#define LDREGX ldd,s
17-
#define LDREGM ldd,mb
18-
#define STREGM std,ma
19-
#define SHRREG shrd
20-
#define SHLREG shld
21-
#define ANDCM andcm,*
22-
#define COND(x) * ## x
2313
#define RP_OFFSET 16
2414
#define FRAME_SIZE 128
2515
#define CALLEE_REG_FRAME_SIZE 144
2616
#define REG_SZ 8
2717
#define ASM_ULONG_INSN .dword
2818
#else /* CONFIG_64BIT */
29-
#define LDREG ldw
30-
#define STREG stw
31-
#define LDREGX ldwx,s
32-
#define LDREGM ldwm
33-
#define STREGM stwm
34-
#define SHRREG shr
35-
#define SHLREG shlw
36-
#define ANDCM andcm
37-
#define COND(x) x
3819
#define RP_OFFSET 20
3920
#define FRAME_SIZE 64
4021
#define CALLEE_REG_FRAME_SIZE 128
@@ -45,6 +26,7 @@
4526
/* Frame alignment for 32- and 64-bit */
4627
#define FRAME_ALIGN 64
4728

29+
#define CALLEE_FLOAT_FRAME_SIZE 80
4830
#define CALLEE_SAVE_FRAME_SIZE (CALLEE_REG_FRAME_SIZE + CALLEE_FLOAT_FRAME_SIZE)
4931

5032
#ifdef CONFIG_PA20
@@ -67,6 +49,28 @@
6749

6850
#ifdef __ASSEMBLY__
6951

52+
#ifdef CONFIG_64BIT
53+
#define LDREG ldd
54+
#define STREG std
55+
#define LDREGX ldd,s
56+
#define LDREGM ldd,mb
57+
#define STREGM std,ma
58+
#define SHRREG shrd
59+
#define SHLREG shld
60+
#define ANDCM andcm,*
61+
#define COND(x) * ## x
62+
#else /* CONFIG_64BIT */
63+
#define LDREG ldw
64+
#define STREG stw
65+
#define LDREGX ldwx,s
66+
#define LDREGM ldwm
67+
#define STREGM stwm
68+
#define SHRREG shr
69+
#define SHLREG shlw
70+
#define ANDCM andcm
71+
#define COND(x) x
72+
#endif
73+
7074
#ifdef CONFIG_64BIT
7175
/* the 64-bit pa gnu assembler unfortunately defaults to .level 1.1 or 2.0 so
7276
* work around that for now... */

arch/parisc/include/asm/jump_label.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
#ifndef __ASSEMBLY__
66

77
#include <linux/types.h>
8+
#include <linux/stringify.h>
89
#include <asm/assembly.h>
910

1011
#define JUMP_LABEL_NOP_SIZE 4

arch/parisc/include/asm/rt_sigframe.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
#ifndef _ASM_PARISC_RT_SIGFRAME_H
33
#define _ASM_PARISC_RT_SIGFRAME_H
44

5-
#define SIGRETURN_TRAMP 3
5+
#define SIGRETURN_TRAMP 4
66
#define SIGRESTARTBLOCK_TRAMP 5
77
#define TRAMP_SIZE (SIGRETURN_TRAMP + SIGRESTARTBLOCK_TRAMP)
88

arch/parisc/kernel/signal.c

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -288,21 +288,22 @@ setup_rt_frame(struct ksignal *ksig, sigset_t *set, struct pt_regs *regs,
288288
already in userspace. The first words of tramp are used to
289289
save the previous sigrestartblock trampoline that might be
290290
on the stack. We start the sigreturn trampoline at
291-
SIGRESTARTBLOCK_TRAMP. */
291+
SIGRESTARTBLOCK_TRAMP+X. */
292292
err |= __put_user(in_syscall ? INSN_LDI_R25_1 : INSN_LDI_R25_0,
293293
&frame->tramp[SIGRESTARTBLOCK_TRAMP+0]);
294-
err |= __put_user(INSN_BLE_SR2_R0,
294+
err |= __put_user(INSN_LDI_R20,
295295
&frame->tramp[SIGRESTARTBLOCK_TRAMP+1]);
296-
err |= __put_user(INSN_LDI_R20,
296+
err |= __put_user(INSN_BLE_SR2_R0,
297297
&frame->tramp[SIGRESTARTBLOCK_TRAMP+2]);
298+
err |= __put_user(INSN_NOP, &frame->tramp[SIGRESTARTBLOCK_TRAMP+3]);
298299

299-
start = (unsigned long) &frame->tramp[SIGRESTARTBLOCK_TRAMP+0];
300-
end = (unsigned long) &frame->tramp[SIGRESTARTBLOCK_TRAMP+3];
300+
start = (unsigned long) &frame->tramp[0];
301+
end = (unsigned long) &frame->tramp[TRAMP_SIZE];
301302
flush_user_dcache_range_asm(start, end);
302303
flush_user_icache_range_asm(start, end);
303304

304305
/* TRAMP Words 0-4, Length 5 = SIGRESTARTBLOCK_TRAMP
305-
* TRAMP Words 5-7, Length 3 = SIGRETURN_TRAMP
306+
* TRAMP Words 5-9, Length 4 = SIGRETURN_TRAMP
306307
* So the SIGRETURN_TRAMP is at the end of SIGRESTARTBLOCK_TRAMP
307308
*/
308309
rp = (unsigned long) &frame->tramp[SIGRESTARTBLOCK_TRAMP];

arch/parisc/kernel/signal32.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ struct compat_regfile {
3636
compat_int_t rf_sar;
3737
};
3838

39-
#define COMPAT_SIGRETURN_TRAMP 3
39+
#define COMPAT_SIGRETURN_TRAMP 4
4040
#define COMPAT_SIGRESTARTBLOCK_TRAMP 5
4141
#define COMPAT_TRAMP_SIZE (COMPAT_SIGRETURN_TRAMP + \
4242
COMPAT_SIGRESTARTBLOCK_TRAMP)

arch/parisc/kernel/syscalls/syscall.tbl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -446,3 +446,4 @@
446446
446 common landlock_restrict_self sys_landlock_restrict_self
447447
# 447 reserved for memfd_secret
448448
448 common process_mrelease sys_process_mrelease
449+
449 common futex_waitv sys_futex_waitv

drivers/video/console/sticon.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -332,13 +332,13 @@ static u8 sticon_build_attr(struct vc_data *conp, u8 color,
332332
bool blink, bool underline, bool reverse,
333333
bool italic)
334334
{
335-
u8 attr = ((color & 0x70) >> 1) | ((color & 7));
335+
u8 fg = color & 7;
336+
u8 bg = (color & 0x70) >> 4;
336337

337-
if (reverse) {
338-
color = ((color >> 3) & 0x7) | ((color & 0x7) << 3);
339-
}
340-
341-
return attr;
338+
if (reverse)
339+
return (fg << 3) | bg;
340+
else
341+
return (bg << 3) | fg;
342342
}
343343

344344
static void sticon_invert_region(struct vc_data *conp, u16 *p, int count)

0 commit comments

Comments
 (0)