History log of /linux-master/arch/sh/kernel/machvec.c
Revision Date Author Comments
# c5783af3 07-Sep-2022 Kees Cook <keescook@chromium.org>

sh: machvec: Use char[] for section boundaries

As done for other sections, define the extern as a character array,
which relaxes many of the compiler-time object size checks, which would
otherwise assume it's a single long. Solves the following build error:

arch/sh/kernel/machvec.c: error: array subscript 'struct sh_machine_vector[0]' is partly outside array bounds of 'long int[1]' [-Werror=array-bounds]: => 105:33

Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Cc: Rich Felker <dalias@libc.org>
Cc: linux-sh@vger.kernel.org
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Link: https://lore.kernel.org/lkml/alpine.DEB.2.22.394.2209050944290.964530@ramsan.of.borg/
Fixes: 9655ad03af2d ("sh: Fixup machvec support.")
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Acked-by: Rich Felker <dalias@libc.org>
Signed-off-by: Kees Cook <keescook@chromium.org>


# eac1a488 17-Jun-2020 Geert Uytterhoeven <geert+renesas@glider.be>

sh: machvec: Modernize printing of kernel messages

- Convert from printk() to pr_*(),
- Add missing continuations.

Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be>
Tested-by: Guenter Roeck <linux@roeck-us.net>
Signed-off-by: Rich Felker <dalias@libc.org>


# 0cd39f46 06-Aug-2020 Peter Zijlstra <peterz@infradead.org>

locking/seqlock, headers: Untangle the spaghetti monster

By using lockdep_assert_*() from seqlock.h, the spaghetti monster
attacked.

Attack back by reducing seqlock.h dependencies from two key high level headers:

- <linux/seqlock.h>: -Remove <linux/ww_mutex.h>
- <linux/time.h>: -Remove <linux/seqlock.h>
- <linux/sched.h>: +Add <linux/seqlock.h>

The price was to add it to sched.h ...

Core header fallout, we add direct header dependencies instead of gaining them
parasitically from higher level headers:

- <linux/dynamic_queue_limits.h>: +Add <asm/bug.h>
- <linux/hrtimer.h>: +Add <linux/seqlock.h>
- <linux/ktime.h>: +Add <asm/bug.h>
- <linux/lockdep.h>: +Add <linux/smp.h>
- <linux/sched.h>: +Add <linux/seqlock.h>
- <linux/videodev2.h>: +Add <linux/kernel.h>

Arch headers fallout:

- PARISC: <asm/timex.h>: +Add <asm/special_insns.h>
- SH: <asm/io.h>: +Add <asm/page.h>
- SPARC: <asm/timer_64.h>: +Add <uapi/asm/asi.h>
- SPARC: <asm/vvar.h>: +Add <asm/processor.h>, <asm/barrier.h>
-Remove <linux/seqlock.h>
- X86: <asm/fixmap.h>: +Add <asm/pgtable_types.h>
-Remove <asm/acpi.h>

There's also a bunch of parasitic header dependency fallout in .c files, not listed
separately.

[ mingo: Extended the changelog, split up & fixed the original patch. ]

Co-developed-by: Ingo Molnar <mingo@kernel.org>
Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Link: https://lore.kernel.org/r/20200804133438.GK2674@hirez.programming.kicks-ass.net


# 5933f6d2 28-Dec-2018 Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>

sh: kernel: convert to SPDX identifiers

Update license to use SPDX-License-Identifier instead of verbose license
text.

Link: http://lkml.kernel.org/r/8736rccswn.wl-kuninori.morimoto.gx@renesas.com
Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Reviewed-by: Simon Horman <horms+renesas@verge.net.au>
Cc: Rich Felker <dalias@libc.org>
Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>


# 63dc02bd 21-May-2012 Paul Mundt <lethal@linux-sh.org>

sh: Kill off machvec IRQ hinting.

Everything is using sparseirq these days, so we have no need to
arbitrarily size nr_irqs ahead of time. The legacy IRQ pre-allocation
likewise has no meaning for us, so that's killed off too. We now depend
on nr_irqs expansion by the generic hardirq layer instead.

It's also worth noting that the majority of boards had completely bogus
values for their nr_irqs relative to their CPU and configurations, so
this ends up correcting behaviour for quite a few platforms.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>


# 37b7a978 01-Nov-2010 Paul Mundt <lethal@linux-sh.org>

sh: machvec IO death.

This takes a bit of a sledgehammer to the machvec I/O routines. The
iomem case requires no special casing and so can just be dropped
outright. This only leaves the ioport casing for PCI and SuperIO
mangling. With the SuperIO case going through the standard ioport
mapping, it's possible to replace everything with generic routines.

With this done the standard I/O routines are tidied up and NO_IOPORT
now gets default-enabled for the vast majority of boards.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>


# 86e4dd5a 25-May-2010 Paul Mundt <lethal@linux-sh.org>

sh: support for platforms without PIO.

This extends some of the existing special casing for HAS_IOPORT
platforms and gets it to the point where platforms can begin to
conditionally select it.

The major changes here are that the PIO routines themselves go away
completely, including all of the machvec port mapping wrappers. With this
in place it's possible for any non-machvec abusing platform to disable
PIO completely. At present this is left as an opt-in until the abusers
are the odd ones out instead of the majority.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>


# 19d8f84f 10-May-2010 Paul Mundt <lethal@linux-sh.org>

sh: enable LMB region setup via machvec.

This plugs in a memory init callback in the machvec to permit boards to
wire up various bits of memory directly in to LMB. A generic machvec
implementation is provided that simply wraps around the normal
Kconfig-derived memory start/size.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>


# e9c58fc5 12-Nov-2009 Paul Mundt <lethal@linux-sh.org>

sh: Use the generic I/O port base for slowdown.

This fixes up the build and behaviour for various configurations. Namely
the CONFIG_32BIT cases where legacy mappings do not exist, as well as the
sh64 build.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>


# d44ee12a 28-Sep-2009 Paul Mundt <lethal@linux-sh.org>

sh: Set the default I/O port base to P2SEG.

This bumps up the default I/O base to P2SEG, which allows legacy probing
to bail out gracefully rather than oopsing. Platforms that have a real
PIO offset still need to fix this up on their own, although most
platforms are content with P2SEG already.

The previous change to teach ioport_map() about >= P1SEG offsets in
combination with this patch allows both the already remapped and the
legacy address probing to pass through and succeed.

Fixes up an oops with i8042 on the sh7785lcr board.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>


# eb9b9b56 28-May-2009 Magnus Damm <damm@igel.co.jp>

sh: boot word / mode pin support V2

Add mode pin support for the SuperH architecture V2.

With this patch applied the board code can add their
own function to export the cpu mode pin configuration.
In most cases this will be a constant bitmap, but
boards that allow reading this from a register can
instead read out the pin state from hardware.

The code warns if a pin is tested but no board specific
mode pin function has been provided.

Signed-off-by: Magnus Damm <damm@igel.co.jp>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>


# 14866543 03-Oct-2008 Paul Mundt <lethal@linux-sh.org>

sh: More I/O routine overhauling.

This tidies up a lot of the PIO/MMIO split. No in-tree platforms were
making use of the MMIO overloading through the machvec (nor have any of
them been in some time), so we just kill all of that off. The ISA I/O
routine wrapping remains unaffected, which remains the only special
casing outside of the iomap API that boards need to think about.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>


# fa43972f 04-Sep-2008 Paul Mundt <lethal@linux-sh.org>

sh: fixup many sparse errors.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>


# 5556410e 07-Aug-2007 Paul Mundt <lethal@linux-sh.org>

sh: panic on machvec section misalignment.

Now that __initmv references the machvec section unconditionally
there have been cases where folks have been mistakenly flagging
non-machvec structures with the machvec section attribute (presumably
to shut up modpost). This leads to obscure breakage in earlyprintk
amongst other places and is rather non-obvious.

Add a simple sanity check to try and catch __initmv misuse and
panic early.

Reported-by: Markus Brunner <super.firetwister@gmail.com>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>


# fd8f20e8 15-May-2007 Paul Mundt <lethal@linux-sh.org>

sh: Rip out special unknown machvec.

This kills off the BareCPU board as a "special" machvec, rather,
we leave this as a default for when no other vector is available,
or when we want to use it in combination with other vectors for
testing with generic ops. As sh_mv is copied out anyways (or
overloaded when an alternate vector is explicitly selected), this
doesn't consume any additional memory.

The generic machvec can be forcibly selected with sh_mv=generic,
or by not having any other boards enabled.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>


# 82f81f47 15-May-2007 Paul Mundt <lethal@linux-sh.org>

sh: Kill off machvec aliases.

We now throw all of the machvecs in to .machvec.init and either
select one on the command line, or copy out the first (and
usually only) one to sh_mv. The rest are freed as usual.

This gets rid of all of the silly sh_mv aliasing and makes the
selection explicit rather than link-order dependent.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>


# 9655ad03 14-May-2007 Paul Mundt <lethal@linux-sh.org>

sh: Fixup machvec support.

This fixes up much of the machvec handling, allowing for it to be
overloaded on boot. Making practical use of this still requires
some Kconfig munging, however.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>