Skip to content

Commit d5d2476

Browse files
committed
Merge tag 'for-linus' of git://github.com/openrisc/linux
Pull OpenRISC updates from Stafford Horne: "A few cleanups all over the place, things of note: - Enable the clone3 syscall - Remove CONFIG_CROSS_COMPILE from Krzysztof Kozlowski - Update to use mmgrab from Julia Lawall" * tag 'for-linus' of git://github.com/openrisc/linux: openrisc: Remove obsolete show_trace_task function openrisc: Cleanup copy_thread_tls docs and comments openrisc: Enable the clone3 syscall openrisc: Convert copy_thread to copy_thread_tls openrisc: use mmgrab openrisc: configs: Cleanup CONFIG_CROSS_COMPILE
2 parents f9db97d + 9737e2c commit d5d2476

File tree

8 files changed

+12
-24
lines changed

8 files changed

+12
-24
lines changed

Documentation/openrisc/openrisc_port.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,8 +37,8 @@ or Stafford's toolchain build and release scripts.
3737

3838
Build the Linux kernel as usual::
3939

40-
make ARCH=openrisc defconfig
41-
make ARCH=openrisc
40+
make ARCH=openrisc CROSS_COMPILE="or1k-linux-" defconfig
41+
make ARCH=openrisc CROSS_COMPILE="or1k-linux-"
4242

4343
3) Running on FPGA (optional)
4444

arch/openrisc/Kconfig

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ config OPENRISC
1616
select HANDLE_DOMAIN_IRQ
1717
select GPIOLIB
1818
select HAVE_ARCH_TRACEHOOK
19+
select HAVE_COPY_THREAD_TLS
1920
select SPARSE_IRQ
2021
select GENERIC_IRQ_CHIP
2122
select GENERIC_IRQ_PROBE

arch/openrisc/configs/or1ksim_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
CONFIG_CROSS_COMPILE="or1k-linux-"
21
CONFIG_NO_HZ=y
32
CONFIG_LOG_BUF_SHIFT=14
43
CONFIG_BLK_DEV_INITRD=y

arch/openrisc/configs/simple_smp_defconfig

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
CONFIG_CROSS_COMPILE="or1k-linux-"
21
CONFIG_LOCALVERSION="-simple-smp"
32
CONFIG_NO_HZ=y
43
CONFIG_LOG_BUF_SHIFT=14

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
#define __ARCH_WANT_SET_GET_RLIMIT
2525
#define __ARCH_WANT_SYS_FORK
2626
#define __ARCH_WANT_SYS_CLONE
27+
#define __ARCH_WANT_SYS_CLONE3
2728
#define __ARCH_WANT_TIME32_SYSCALLS
2829

2930
#include <asm-generic/unistd.h>

arch/openrisc/kernel/process.c

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -117,12 +117,12 @@ void release_thread(struct task_struct *dead_task)
117117
extern asmlinkage void ret_from_fork(void);
118118

119119
/*
120-
* copy_thread
120+
* copy_thread_tls
121121
* @clone_flags: flags
122122
* @usp: user stack pointer or fn for kernel thread
123123
* @arg: arg to fn for kernel thread; always NULL for userspace thread
124124
* @p: the newly created task
125-
* @regs: CPU context to copy for userspace thread; always NULL for kthread
125+
* @tls: the Thread Local Storage pointer for the new process
126126
*
127127
* At the top of a newly initialized kernel stack are two stacked pt_reg
128128
* structures. The first (topmost) is the userspace context of the thread.
@@ -148,8 +148,8 @@ extern asmlinkage void ret_from_fork(void);
148148
*/
149149

150150
int
151-
copy_thread(unsigned long clone_flags, unsigned long usp,
152-
unsigned long arg, struct task_struct *p)
151+
copy_thread_tls(unsigned long clone_flags, unsigned long usp,
152+
unsigned long arg, struct task_struct *p, unsigned long tls)
153153
{
154154
struct pt_regs *userregs;
155155
struct pt_regs *kregs;
@@ -179,16 +179,10 @@ copy_thread(unsigned long clone_flags, unsigned long usp,
179179
userregs->sp = usp;
180180

181181
/*
182-
* For CLONE_SETTLS set "tp" (r10) to the TLS pointer passed to sys_clone.
183-
*
184-
* The kernel entry is:
185-
* int clone (long flags, void *child_stack, int *parent_tid,
186-
* int *child_tid, struct void *tls)
187-
*
188-
* This makes the source r7 in the kernel registers.
182+
* For CLONE_SETTLS set "tp" (r10) to the TLS pointer.
189183
*/
190184
if (clone_flags & CLONE_SETTLS)
191-
userregs->gpr[10] = userregs->gpr[7];
185+
userregs->gpr[10] = tls;
192186

193187
userregs->gpr[11] = 0; /* Result from fork() */
194188

arch/openrisc/kernel/smp.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
#include <linux/smp.h>
1515
#include <linux/cpu.h>
1616
#include <linux/sched.h>
17+
#include <linux/sched/mm.h>
1718
#include <linux/irq.h>
1819
#include <asm/cpuinfo.h>
1920
#include <asm/mmu_context.h>
@@ -113,7 +114,7 @@ asmlinkage __init void secondary_start_kernel(void)
113114
* All kernel threads share the same mm context; grab a
114115
* reference and switch to it.
115116
*/
116-
atomic_inc(&mm->mm_count);
117+
mmgrab(mm);
117118
current->active_mm = mm;
118119
cpumask_set_cpu(cpu, mm_cpumask(mm));
119120

arch/openrisc/kernel/traps.c

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -55,13 +55,6 @@ void show_stack(struct task_struct *task, unsigned long *esp)
5555
unwind_stack(NULL, esp, print_trace);
5656
}
5757

58-
void show_trace_task(struct task_struct *tsk)
59-
{
60-
/*
61-
* TODO: SysRq-T trace dump...
62-
*/
63-
}
64-
6558
void show_registers(struct pt_regs *regs)
6659
{
6760
int i;

0 commit comments

Comments
 (0)