History log of /linux-master/arch/sparc/kernel/process.c
Revision Date Author Comments
# a66ef2ee 18-Aug-2020 Christian Brauner <christian.brauner@ubuntu.com>

sparc: switch to kernel_clone()

The old _do_fork() helper is removed in favor of the new kernel_clone() helper.
The latter adheres to naming conventions for kernel internal syscall helpers.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Acked-by: David S. Miller <davem@davemloft.net>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: sparclinux@vger.kernel.org
Link: https://lore.kernel.org/r/20200819104655.436656-7-christian.brauner@ubuntu.com


# 714acdbd 11-Jun-2020 Christian Brauner <christian.brauner@ubuntu.com>

arch: rename copy_thread_tls() back to copy_thread()

Now that HAVE_COPY_THREAD_TLS has been removed, rename copy_thread_tls()
back simply copy_thread(). It's a simpler name, and doesn't imply that only
tls is copied here. This finishes an outstanding chunk of internal process
creation work since we've added clone3().

Cc: linux-arch@vger.kernel.org
Acked-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>A
Acked-by: Stafford Horne <shorne@gmail.com>
Acked-by: Greentime Hu <green.hu@gmail.com>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>A
Reviewed-by: Kees Cook <keescook@chromium.org>
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>


# a4261d4b 12-May-2020 Christian Brauner <christian.brauner@ubuntu.com>

sparc: share process creation helpers between sparc and sparc64

As promised in the previous patch, this moves the process creation
helpers into a common process.c file that is shared between sparc and
sparc64. It allows us to get rid of quite a bit custom assembler and the
to remove the separe 32bit specific sparc_do_fork() call.

One thing to note, is that when clone() was called with a separate stack
for the child the assembler would align it. But copy_thread() has always
been doing that too so that line wasn't needed and can thus simply be
removed.

Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
Acked-by: David S. Miller <davem@davemloft.net>
Cc: Arnd Bergmann <arnd@arndb.de>
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Guo Ren <guoren@kernel.org>
Cc: linux-csky@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: sparclinux@vger.kernel.org
Link: https://lore.kernel.org/r/20200512171527.570109-3-christian.brauner@ubuntu.com


# 5110bd21 31-Aug-2008 Adrian Bunk <bunk@kernel.org>

sparc: remove CONFIG_SUN4

While doing some easy cleanups on the sparc code I noticed that the
CONFIG_SUN4 code seems to be worse than the rest - there were some
"I don't know how it should work, but the current code definitely cannot
work." places.

And while I have seen people running Linux on machines like a
SPARCstation 5 a few years ago I don't recall having seen sun4
machines, even less ones running Linux.

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 4fe3ebec 17-Jul-2008 David S. Miller <davem@davemloft.net>

sparc: Use new '%pS' infrastructure to print symbols.

Signed-off-by: David S. Miller <davem@davemloft.net>


# c61c65cd 05-Jun-2008 Adrian Bunk <bunk@kernel.org>

sparc/kernel/: possible cleanups

This patch contains the following possible cleanups:
- make the following needlessly global code static:
- apc.c: apc_swift_idle()
- ebus.c: ebus_blacklist_irq()
- ebus.c: fill_ebus_child()
- ebus.c: fill_ebus_device()
- entry.S: syscall_is_too_hard
- etra: tsetup_sun4c_stackchk
- head.S: cputyp
- head.S: prom_vector_p
- idprom.c: Sun_Machines[]
- ioport.c: _sparc_find_resource()
- ioport.c: create_proc_read_entry()
- irq.c: struct sparc_irq[]
- rtrap.S: sun4c_rett_stackchk
- setup.c: prom_sync_me()
- setup.c: boot_flags
- sun4c_irq.c: sun4c_sbint_to_irq()
- sun4d_irq.c: sbus_tid[]
- sun4d_irq.c: struct sbus_actions
- sun4d_irq.c: sun4d_sbint_to_irq()
- sun4m_irq.c: sun4m_sbint_to_irq()
- sun4m_irq.c: sun4m_get_irqmask()
- sun4m_irq.c: sun4m_timers
- sun4m_smp.c: smp4m_cross_call()
- sun4m_smp.c: smp4m_blackbox_id()
- sun4m_smp.c: smp4m_blackbox_current()
- time.c: sp_clock_typ
- time.c: sbus_time_init()
- traps.c: instruction_dump()
- wof.S: spwin_sun4c_stackchk
- wuf.S: sun4c_fwin_stackchk
- #if 0 the following unused code:
- process.c: sparc_backtrace_lock
- process.c: __show_backtrace()
- process.c: show_backtrace()
- process.c: smp_show_backtrace_all_cpus()
- remove the following unused code:
- entry.S: __handle_exception
- smp.c: smp_num_cpus
- smp.c: smp_activated
- smp.c: __cpu_number_map[]
- smp.c: __cpu_logical_map[]
- smp.c: bitops_spinlock
- traps.c: trap_curbuf
- traps.c: trapbuf[]
- traps.c: linux_smp_still_initting
- traps.c: thiscpus_tbr
- traps.c: thiscpus_mid

Signed-off-by: Adrian Bunk <bunk@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>


# c07c6053 10-May-2008 David S. Miller <davem@davemloft.net>

sparc32: Don't twiddle PT_DTRACE in exec.

That bit isn't used on this platform.

Signed-off-by: David S. Miller <davem@davemloft.net>


# 1e38c126 07-May-2008 David S. Miller <davem@davemloft.net>

sparc: Fix fork/clone/vfork system call restart.

We clobber %i1 as well as %i0 for these system calls,
because they give two return values.

Therefore, on error, we have to restore %i1 properly
or else the restart explodes since it uses the wrong
arguments.

This fixes glibc's nptl/tst-eintr1.c testcase.

Signed-off-by: David S. Miller <davem@davemloft.net>


# 5526b7e4 27-Apr-2008 David S. Miller <davem@davemloft.net>

sparc: Remove old style signal frame support.

Back around the same time we were bootstrapping the first 32-bit sparc
Linux kernel with a SunOS userland, we made the signal frame match
that of SunOS.

By the time we even started putting together a native Linux userland
for 32-bit Sparc we realized this layout wasn't sufficient for Linux's
needs.

Therefore we changed the layout, yet kept support for the old style
signal frame layout in there. The detection mechanism is that we had
sys_sigaction() start passing in a negative signal number to indicate
"new style signal frames please".

Anyways, no binaries exist in the world that use the old stuff. In
fact, I bet Jakub Jelinek and myself are the only two people who ever
had such binaries to be honest.

So let's get rid of this stuff.

I added an assertion using WARN_ON_ONCE() that makes sure 32-bit
applications are passing in that negative signal number still.

Signed-off-by: David S. Miller <davem@davemloft.net>


# 7729d74e 28-Feb-2008 David S. Miller <davem@davemloft.net>

[SPARC]: Add reboot_command[] extern decl to asm/system.h

Kill off some sparse warnings.

Signed-off-by: David S. Miller <davem@davemloft.net>


# 667bc389 18-Feb-2008 David S. Miller <davem@davemloft.net>

[SPARC]: Kill 'prom_palette'.

The idea of this thing is we could save/restore the firmware's
palette when breaking in and out of the firmware prompt.

Only one driver implemented this (atyfb) and it's value is
questionable. If you're just debugging you don't really
care that the characters end up being purple or whatever.

And we can provide better debugging and firmware command
facilities with minimal in-kernel console I/O drivers.

Signed-off-by: David S. Miller <davem@davemloft.net>


# 1eb11411 08-Feb-2008 David Howells <dhowells@redhat.com>

aout: remove unnecessary inclusions of {asm, linux}/a.out.h

Remove now unnecessary inclusions of {asm,linux}/a.out.h.

[akpm@linux-foundation.org: fix alpha build]
Signed-off-by: David Howells <dhowells@redhat.com>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 7fa30315 08-Feb-2008 David Howells <dhowells@redhat.com>

aout: suppress A.OUT library support if !CONFIG_ARCH_SUPPORTS_AOUT

Suppress A.OUT library support if CONFIG_ARCH_SUPPORTS_AOUT is not set.

Not all architectures support the A.OUT binfmt, so the ELF binfmt should not
be permitted to go looking for A.OUT libraries to load in such a case. Not
only that, but under such conditions A.OUT core dumps are not produced either.

To make this work, this patch also does the following:

(1) Makes the existence of the contents of linux/a.out.h contingent on
CONFIG_ARCH_SUPPORTS_AOUT.

(2) Renames dump_thread() to aout_dump_thread() as it's only called by A.OUT
core dumping code.

(3) Moves aout_dump_thread() into asm/a.out-core.h and makes it inline. This
is then included only where needed. This means that this bit of arch
code will be stored in the appropriate A.OUT binfmt module rather than
the core kernel.

(4) Drops A.OUT support for Blackfin (according to Mike Frysinger it's not
needed) and FRV.

This patch depends on the previous patch to move STACK_TOP[_MAX] out of
asm/a.out.h and into asm/processor.h as they're required whether or not A.OUT
format is available.

[jdike@addtoit.com: uml: re-remove accidentally restored code]
Signed-off-by: David Howells <dhowells@redhat.com>
Cc: <linux-arch@vger.kernel.org>
Signed-off-by: Jeff Dike <jdike@linux.intel.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 64d329ee 27-Oct-2007 David S. Miller <davem@sunset.davemloft.net>

[SPARC32]: __inline__ --> inline

Signed-off-by: David S. Miller <davem@davemloft.net>


# c73fcc84 20-Jul-2007 David S. Miller <davem@sunset.davemloft.net>

[SPARC]: Fix serial console device detection.

The current scheme works on static interpretation of text names, which
is wrong.

The output-device setting, for example, must be resolved via an alias
or similar to a full path name to the console device.

Paths also contain an optional set of 'options', which starts with a
colon at the end of the path. The option area is used to specify
which of two serial ports ('a' or 'b') the path refers to when a
device node drives multiple ports. 'a' is assumed if the option
specification is missing.

This was caught by the UltraSPARC-T1 simulator. The 'output-device'
property was set to 'ttya' and we didn't pick upon the fact that this
is an OBP alias set to '/virtual-devices/console'. Instead we saw it
as the first serial console device, instead of the hypervisor console.

The infrastructure is now there to take advantage of this to resolve
the console correctly even in multi-head situations in fbcon too.

Thanks to Greg Onufer for the bug report.

Signed-off-by: David S. Miller <davem@davemloft.net>


# d1a78c32 11-May-2007 Simon Arlott <simon@octiron.net>

[SPARC]: Spelling fixes.

Spelling fixes in arch/sparc/.

Signed-off-by: Simon Arlott <simon@fire.lp0.eu>
Signed-off-by: David S. Miller <davem@davemloft.net>


# e63340ae 08-May-2007 Randy Dunlap <randy.dunlap@oracle.com>

header cleaning: don't include smp_lock.h when not used

Remove includes of <linux/smp_lock.h> where it is not used/needed.
Suggested by Al Viro.

Builds cleanly on x86_64, i386, alpha, ia64, powerpc, sparc,
sparc64, and arm (all 59 defconfigs).

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 54f565ea 12-Mar-2007 William Lee Irwin III <wli@holomorphy.com>

[SPARC]: Fix TIF_USEDFPU flag atomicity

From: William Lee Irwin III <wli@holomorphy.com>

Signed-off-by: David S. Miller <davem@davemloft.net>


# 89eb1693 30-Jan-2007 Al Viro <viro@ftp.linux.org.uk>

[PATCH] missing exports of pm_power_off() on alpha and sparc32

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 6ab3d562 30-Jun-2006 Jörn Engel <joern@wohnheim.fh-wedel.de>

Remove obsolete #include <linux/config.h>

Signed-off-by: Jörn Engel <joern@wohnheim.fh-wedel.de>
Signed-off-by: Adrian Bunk <bunk@stusta.de>


# 304cd3ef 18-Jan-2006 Al Viro <viro@zeniv.linux.org.uk>

[PATCH] restore power-off on sparc32

Damn you, Eric

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>


# 36483c6b 12-Jan-2006 Al Viro <viro@ftp.linux.org.uk>

[PATCH] sparc: task_stack_page()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# d562ef6a 12-Jan-2006 Al Viro <viro@ftp.linux.org.uk>

[PATCH] sparc: task_thread_info()

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# 64c7c8f8 08-Nov-2005 Nick Piggin <nickpiggin@yahoo.com.au>

[PATCH] sched: resched and cpu_idle rework

Make some changes to the NEED_RESCHED and POLLING_NRFLAG to reduce
confusion, and make their semantics rigid. Improves efficiency of
resched_task and some cpu_idle routines.

* In resched_task:
- TIF_NEED_RESCHED is only cleared with the task's runqueue lock held,
and as we hold it during resched_task, then there is no need for an
atomic test and set there. The only other time this should be set is
when the task's quantum expires, in the timer interrupt - this is
protected against because the rq lock is irq-safe.

- If TIF_NEED_RESCHED is set, then we don't need to do anything. It
won't get unset until the task get's schedule()d off.

- If we are running on the same CPU as the task we resched, then set
TIF_NEED_RESCHED and no further action is required.

- If we are running on another CPU, and TIF_POLLING_NRFLAG is *not* set
after TIF_NEED_RESCHED has been set, then we need to send an IPI.

Using these rules, we are able to remove the test and set operation in
resched_task, and make clear the previously vague semantics of
POLLING_NRFLAG.

* In idle routines:
- Enter cpu_idle with preempt disabled. When the need_resched() condition
becomes true, explicitly call schedule(). This makes things a bit clearer
(IMO), but haven't updated all architectures yet.

- Many do a test and clear of TIF_NEED_RESCHED for some reason. According
to the resched_task rules, this isn't needed (and actually breaks the
assumption that TIF_NEED_RESCHED is only cleared with the runqueue lock
held). So remove that. Generally one less locked memory op when switching
to the idle thread.

- Many idle routines clear TIF_POLLING_NRFLAG, and only set it in the inner
most polling idle loops. The above resched_task semantics allow it to be
set until before the last time need_resched() is checked before going into
a halt requiring interrupt wakeup.

Many idle routines simply never enter such a halt, and so POLLING_NRFLAG
can be always left set, completely eliminating resched IPIs when rescheduling
the idle task.

POLLING_NRFLAG width can be increased, to reduce the chance of resched IPIs.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Ingo Molnar <mingo@elte.hu>
Cc: Con Kolivas <kernel@kolivas.org>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# 5bfb5d69 08-Nov-2005 Nick Piggin <nickpiggin@yahoo.com.au>

[PATCH] sched: disable preempt in idle tasks

Run idle threads with preempt disabled.

Also corrected a bugs in arm26's cpu_idle (make it actually call schedule()).
How did it ever work before?

Might fix the CPU hotplugging hang which Nigel Cunningham noted.

We think the bug hits if the idle thread is preempted after checking
need_resched() and before going to sleep, then the CPU offlined.

After calling stop_machine_run, the CPU eventually returns from preemption and
into the idle thread and goes to sleep. The CPU will continue executing
previous idle and have no chance to call play_dead.

By disabling preemption until we are ready to explicitly schedule, this bug is
fixed and the idle threads generally become more robust.

From: alexs <ashepard@u.washington.edu>

PPC build fix

From: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>

MIPS build fix

Signed-off-by: Nick Piggin <npiggin@suse.de>
Signed-off-by: Yoichi Yuasa <yuasa@hh.iij4u.or.jp>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# 59586e5a 26-Jul-2005 Eric W. Biederman <ebiederm@xmission.com>

[PATCH] Don't export machine_restart, machine_halt, or machine_power_off.

machine_restart, machine_halt and machine_power_off are machine
specific hooks deep into the reboot logic, that modules
have no business messing with. Usually code should be calling
kernel_restart, kernel_halt, kernel_power_off, or
emergency_restart. So don't export machine_restart,
machine_halt, and machine_power_off so we can catch buggy users.

Signed-off-by: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>


# 7cc1712b 05-May-2005 Coywolf Qi Hunt <coywolf@lovecn.org>

[SPARC]: Remove legacy stuff from cpu_idle().

Currently sparc and sparc64's UP cpu_idle() checks current pid. This
is old time legacy. Now it's paranoia.

Signed-off-by: Coywolf Qi Hunt <coywolf@lovecn.org>
Acked-by: William Irwin <wli@holomorphy.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 24dc6ead 24-Apr-2005 Tom 'spot' Callaway <tcallawa@redhat.com>

[SPARC]: dump_stack for sparc

Bob Breuer wrote a patch to add dump_stack for sparc. Supposedly, this
was applied, but it doesn't exist in 2.6.11.

This is the same patch, rediffed against 2.6.11.

Signed-off-by: Tom 'spot' Callaway <tcallawa@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>


# 1da177e4 16-Apr-2005 Linus Torvalds <torvalds@ppc970.osdl.org>

Linux-2.6.12-rc2

Initial git repository build. I'm not bothering with the full history,
even though we have it. We can create a separate "historical" git
archive of that later if we want to, and in the meantime it's about
3.2GB when imported into git - space that would just make the early
git days unnecessarily complicated, when we don't have a lot of good
infrastructure for it.

Let it rip!