Skip to content

Commit b7e573b

Browse files
committed
Merge tag 'arc-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc
Pull ARC updates from Vineet Gupta: - Wire up clone3 syscall - ARCv2 FPU state save/restore across context switch - AXS10x platform and misc fixes * tag 'arc-5.6-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc: ARCv2: fpu: preserve userspace fpu state ARC: fpu: declutter code, move bits out into fpu.h ARC: wireup clone3 syscall ARC: [plat-axs10x]: Add missing multicast filter number to GMAC node ARC: update feature support for jump-labels
2 parents a108454 + f45ba2b commit b7e573b

File tree

14 files changed

+121
-41
lines changed

14 files changed

+121
-41
lines changed

Documentation/features/core/jump-labels/arch-support.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
| arch |status|
88
-----------------------
99
| alpha: | TODO |
10-
| arc: | TODO |
10+
| arc: | ok |
1111
| arm: | ok |
1212
| arm64: | ok |
1313
| c6x: | TODO |

arch/arc/Kconfig

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ config ARC
2828
select GENERIC_SMP_IDLE_THREAD
2929
select HAVE_ARCH_KGDB
3030
select HAVE_ARCH_TRACEHOOK
31+
select HAVE_COPY_THREAD_TLS
3132
select HAVE_DEBUG_STACKOVERFLOW
3233
select HAVE_DEBUG_KMEMLEAK
3334
select HAVE_FUTEX_CMPXCHG if FUTEX
@@ -350,24 +351,19 @@ config NODES_SHIFT
350351
Accessing memory beyond 1GB (with or w/o PAE) requires 2 memory
351352
zones.
352353

353-
if ISA_ARCOMPACT
354-
355354
config ARC_COMPACT_IRQ_LEVELS
355+
depends on ISA_ARCOMPACT
356356
bool "Setup Timer IRQ as high Priority"
357357
# if SMP, LV2 enabled ONLY if ARC implementation has LV2 re-entrancy
358358
depends on !SMP
359359

360360
config ARC_FPU_SAVE_RESTORE
361361
bool "Enable FPU state persistence across context switch"
362362
help
363-
Double Precision Floating Point unit had dedicated regs which
364-
need to be saved/restored across context-switch.
365-
Note that ARC FPU is overly simplistic, unlike say x86, which has
366-
hardware pieces to allow software to conditionally save/restore,
367-
based on actual usage of FPU by a task. Thus our implemn does
368-
this for all tasks in system.
369-
370-
endif #ISA_ARCOMPACT
363+
ARCompact FPU has internal registers to assist with Double precision
364+
Floating Point operations. There are control and stauts registers
365+
for floating point exceptions and rounding modes. These are
366+
preserved across task context switch when enabled.
371367

372368
config ARC_CANT_LLSC
373369
def_bool n

arch/arc/boot/dts/axs10x_mb.dtsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@
7878
interrupt-names = "macirq";
7979
phy-mode = "rgmii";
8080
snps,pbl = < 32 >;
81+
snps,multicast-filter-bins = <256>;
8182
clocks = <&apbclk>;
8283
clock-names = "stmmaceth";
8384
max-speed = <100>;

arch/arc/include/asm/arcregs.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,8 @@
3939
#define ARC_REG_CLUSTER_BCR 0xcf
4040
#define ARC_REG_AUX_ICCM 0x208 /* ICCM Base Addr (ARCv2) */
4141
#define ARC_REG_LPB_CTRL 0x488 /* ARCv2 Loop Buffer control */
42+
#define ARC_REG_FPU_CTRL 0x300
43+
#define ARC_REG_FPU_STATUS 0x301
4244

4345
/* Common for ARCompact and ARCv2 status register */
4446
#define ARC_REG_STATUS32 0x0A

arch/arc/include/asm/fpu.h

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
/* SPDX-License-Identifier: GPL-2.0-only */
2+
/*
3+
* Copyright (C) 2020 Synopsys, Inc. (www.synopsys.com)
4+
*
5+
*/
6+
7+
#ifndef _ASM_ARC_FPU_H
8+
#define _ASM_ARC_FPU_H
9+
10+
#ifdef CONFIG_ARC_FPU_SAVE_RESTORE
11+
12+
#include <asm/ptrace.h>
13+
14+
#ifdef CONFIG_ISA_ARCOMPACT
15+
16+
/* These DPFP regs need to be saved/restored across ctx-sw */
17+
struct arc_fpu {
18+
struct {
19+
unsigned int l, h;
20+
} aux_dpfp[2];
21+
};
22+
23+
#define fpu_init_task(regs)
24+
25+
#else
26+
27+
/*
28+
* ARCv2 FPU Control aux register
29+
* - bits to enable Traps on Exceptions
30+
* - Rounding mode
31+
*
32+
* ARCv2 FPU Status aux register
33+
* - FPU exceptions flags (Inv, Div-by-Zero, overflow, underflow, inexact)
34+
* - Flag Write Enable to clear flags explicitly (vs. by fpu instructions
35+
* only
36+
*/
37+
38+
struct arc_fpu {
39+
unsigned int ctrl, status;
40+
};
41+
42+
extern void fpu_init_task(struct pt_regs *regs);
43+
44+
#endif /* !CONFIG_ISA_ARCOMPACT */
45+
46+
extern void fpu_save_restore(struct task_struct *p, struct task_struct *n);
47+
48+
#else /* !CONFIG_ARC_FPU_SAVE_RESTORE */
49+
50+
#define fpu_save_restore(p, n)
51+
#define fpu_init_task(regs)
52+
53+
#endif /* CONFIG_ARC_FPU_SAVE_RESTORE */
54+
55+
#endif /* _ASM_ARC_FPU_H */

arch/arc/include/asm/processor.h

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,7 @@
1414
#ifndef __ASSEMBLY__
1515

1616
#include <asm/ptrace.h>
17-
18-
#ifdef CONFIG_ARC_FPU_SAVE_RESTORE
19-
/* These DPFP regs need to be saved/restored across ctx-sw */
20-
struct arc_fpu {
21-
struct {
22-
unsigned int l, h;
23-
} aux_dpfp[2];
24-
};
25-
#endif
17+
#include <asm/fpu.h>
2618

2719
#ifdef CONFIG_ARC_PLAT_EZNPS
2820
struct eznps_dp {

arch/arc/include/asm/switch_to.h

Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,19 +9,7 @@
99
#ifndef __ASSEMBLY__
1010

1111
#include <linux/sched.h>
12-
13-
#ifdef CONFIG_ARC_FPU_SAVE_RESTORE
14-
15-
extern void fpu_save_restore(struct task_struct *p, struct task_struct *n);
16-
#define ARC_FPU_PREV(p, n) fpu_save_restore(p, n)
17-
#define ARC_FPU_NEXT(t)
18-
19-
#else
20-
21-
#define ARC_FPU_PREV(p, n)
22-
#define ARC_FPU_NEXT(n)
23-
24-
#endif /* !CONFIG_ARC_FPU_SAVE_RESTORE */
12+
#include <asm/fpu.h>
2513

2614
#ifdef CONFIG_ARC_PLAT_EZNPS
2715
extern void dp_save_restore(struct task_struct *p, struct task_struct *n);
@@ -36,9 +24,8 @@ struct task_struct *__switch_to(struct task_struct *p, struct task_struct *n);
3624
#define switch_to(prev, next, last) \
3725
do { \
3826
ARC_EZNPS_DP_PREV(prev, next); \
39-
ARC_FPU_PREV(prev, next); \
27+
fpu_save_restore(prev, next); \
4028
last = __switch_to(prev, next);\
41-
ARC_FPU_NEXT(next); \
4229
mb(); \
4330
} while (0)
4431

arch/arc/include/asm/syscalls.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
#include <linux/types.h>
1212

1313
int sys_clone_wrapper(int, int, int, int, int);
14+
int sys_clone3_wrapper(void *, size_t);
1415
int sys_cacheflush(uint32_t, uint32_t uint32_t);
1516
int sys_arc_settls(void *);
1617
int sys_arc_gettls(void);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
#define __ARCH_WANT_SET_GET_RLIMIT
2222
#define __ARCH_WANT_SYS_EXECVE
2323
#define __ARCH_WANT_SYS_CLONE
24+
#define __ARCH_WANT_SYS_CLONE3
2425
#define __ARCH_WANT_SYS_VFORK
2526
#define __ARCH_WANT_SYS_FORK
2627
#define __ARCH_WANT_TIME32_SYSCALLS

arch/arc/kernel/Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,9 @@ obj-$(CONFIG_PERF_EVENTS) += perf_event.o
2323
obj-$(CONFIG_JUMP_LABEL) += jump_label.o
2424

2525
obj-$(CONFIG_ARC_FPU_SAVE_RESTORE) += fpu.o
26+
ifdef CONFIG_ISA_ARCOMPACT
2627
CFLAGS_fpu.o += -mdpfp
28+
endif
2729

2830
ifdef CONFIG_ARC_DW2_UNWIND
2931
CFLAGS_ctx_sw.o += -fno-omit-frame-pointer

0 commit comments

Comments
 (0)