06 Sep, 2013
1 commit
-
The functions
__down_read
__down_read_trylock
__down_write
__down_write_trylock
__up_read
__up_write
__downgrade_writeare implemented inline, so remove corresponding EXPORT_SYMBOLs
(They lead to compile errors on RT kernel).Signed-off-by: Kirill Tkhai
CC: David Miller
Signed-off-by: David S. Miller
01 May, 2013
1 commit
-
The help text for this config is duplicated across the x86, parisc, and
s390 Kconfig.debug files. Arnd Bergman noted that the help text was
slightly misleading and should be fixed to state that enabling this
option isn't a problem when using pre 4.4 gcc.To simplify the rewording, consolidate the text into lib/Kconfig.debug
and modify it there to be more explicit about when you should say N to
this config.Also, make the text a bit more generic by stating that this option
enables compile time checks so we can cover architectures which emit
warnings vs. ones which emit errors. The details of how an
architecture decided to implement the checks isn't as important as the
concept of compile time checking of copy_from_user() calls.While we're doing this, remove all the copy_from_user_overflow() code
that's duplicated many times and place it into lib/ so that any
architecture supporting this option can get the function for free.Signed-off-by: Stephen Boyd
Acked-by: Arnd Bergmann
Acked-by: Ingo Molnar
Acked-by: H. Peter Anvin
Cc: Arjan van de Ven
Acked-by: Helge Deller
Cc: Heiko Carstens
Cc: Stephen Rothwell
Cc: Chris Metcalf
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
01 Apr, 2013
1 commit
-
srmmu_nocache_bitmap is cleared by bit_map_init(). But bit_map_init()
attempts to clear by memset(), so it can't clear the trailing edge of
bitmap properly on big-endian architecture if the number of bits is not
a multiple of BITS_PER_LONG.Actually, the number of bits in srmmu_nocache_bitmap is not always
a multiple of BITS_PER_LONG. It is calculated as below:bitmap_bits = srmmu_nocache_size >> SRMMU_NOCACHE_BITMAP_SHIFT;
srmmu_nocache_size is decided proportionally by the amount of system RAM
and it is rounded to a multiple of PAGE_SIZE. SRMMU_NOCACHE_BITMAP_SHIFT
is defined as (PAGE_SHIFT - 4). So it can only be said that bitmap_bits
is a multiple of 16.This fixes the problem by using bitmap_clear() instead of memset()
in bit_map_init() and this also uses BITS_TO_LONGS() to calculate correct
size at bitmap allocation time.Signed-off-by: Akinobu Mita
Cc: "David S. Miller"
Cc: sparclinux@vger.kernel.org
Signed-off-by: David S. Miller
10 Nov, 2012
1 commit
-
Sparc32 already supported it, as a consequence of using the
generic atomic64 implementation. And the sparc64 implementation
is rather trivial.This allows us to set ARCH_HAS_ATOMIC64_DEC_IF_POSITIVE for all
of sparc, and avoid the annoying warning from lib/atomic64_test.cSigned-off-by: David S. Miller
06 Oct, 2012
1 commit
-
This adds optimized memset/bzero/page-clear routines for Niagara-4.
We basically can do what powerpc has been able to do for a decade (via
the "dcbz" instruction), which is use cache line clearing stores for
bzero and memsets with a 'c' argument of zero.As long as we make the cache initializing store to each 32-byte
subblock of the L2 cache line, it works.As with other Niagara-4 optimized routines, the key is to make sure to
avoid any usage of the %asi register, as reads and writes to it cost
at least 50 cycles.For the user clear cases, we don't use these new routines, we use the
Niagara-1 variants instead. Those have to use %asi in an unavoidable
way.A Niagara-4 8K page clear costs just under 600 cycles.
Add definitions of the MRU variants of the cache initializing store
ASIs. By default, cache initializing stores install the line as Least
Recently Used. If we know we're going to use the data immediately
(which is true for page copies and clears) we can use the Most
Recently Used variant, to decrease the likelyhood of the lines being
evicted before they get used.Signed-off-by: David S. Miller
03 Oct, 2012
1 commit
-
There's a Niagara 2 memcpy fix in this tree and I have
a Kconfig fix from Dave Jones which requires the sparc-next
changes which went upstream yesterday.Signed-off-by: David S. Miller
29 Sep, 2012
1 commit
-
Signed-off-by: David S. Miller
28 Sep, 2012
1 commit
-
Noticed by Greg Onufer.
Signed-off-by: David S. Miller
27 Sep, 2012
2 commits
-
It gets clobbered by the kernel's VISEntryHalf, so we have to save it
in a different register than the set clobbered by that macro.The instance in glibc is OK and doesn't have this problem.
Signed-off-by: David S. Miller
-
Before After
-------------- --------------
bw_tcp: 1288.53 MB/sec 1637.77 MB/sec
bw_pipe: 1517.18 MB/sec 2107.61 MB/sec
bw_unix: 1838.38 MB/sec 2640.91 MB/secmake -s -j128
allmodconfig 5min 49sec 5min 31secSigned-off-by: David S. Miller
21 Aug, 2012
1 commit
-
Signed-off-by: David S. Miller
Acked-by: Herbert Xu
27 Jun, 2012
1 commit
-
Because fsrc2, unlike fmovd, does not update the %fsr register.
Signed-off-by: David S. Miller
27 May, 2012
1 commit
-
This throws away the sparc-specific functions in favor of the generic
optimized version.Signed-off-by: Linus Torvalds
25 May, 2012
3 commits
-
To use this, an architecture simply needs to:
1) Provide a user_addr_max() implementation via asm/uaccess.h
2) Add "select GENERIC_STRNCPY_FROM_USER" to their arch Kcnfig
3) Remove the existing strncpy_from_user() implementation and symbol
exports their architecture had.Signed-off-by: David S. Miller
Acked-by: David Howells -
And make sure that everything using it explicitly includes
that header file.Signed-off-by: David S. Miller
-
Hide details of maximum user address calculation in a new
asm/uaccess.h interface named user_addr_max().Provide little-endian implementation in find_zero(), which should work
but can probably be improved.Abstrace alignment check behind IS_UNALIGNED() macro.
Kill double-semicolon, noticed by David Howells.
Signed-off-by: David S. Miller
24 May, 2012
1 commit
-
Compute a mask that will only have 0x80 in the bytes which
had a zero in them. The formula is:~(((x & 0x7f7f7f7f) + 0x7f7f7f7f) | x | 0x7f7f7f7f)
In the inner word iteration, we have to compute the "x | 0x7f7f7f7f"
part, so we can reuse that in the above calculation.Once we have this mask, we perform divide and conquer to find the
highest 0x80 location.Signed-off-by: David S. Miller
23 May, 2012
1 commit
-
Linus removed the end-of-address-space hackery from
fs/namei.c:do_getname() so we really have to validate these edge
conditions and cannot cheat any more (as x86 used to as well).Move to a common C implementation like x86 did. And if both
src and dst are sufficiently aligned we'll do word at a time
copies and checks as well.Signed-off-by: David S. Miller
20 May, 2012
2 commits
-
Otherwise if no references exist in the static kernel image,
we won't export the symbol properly to modules.Signed-off-by: David S. Miller
-
Based on copy from microblaze add ucmpdi2 implementation.
This fixes build of niu driver which failed with:drivers/built-in.o: In function `niu_get_nfc':
niu.c:(.text+0x91494): undefined reference to `__ucmpdi2'This driver will never be used on a sparc32 system,
but patch added to fix build breakage with all*config builds.Signed-off-by: Sam Ravnborg
Signed-off-by: David S. Miller
16 May, 2012
1 commit
-
For the explicit calls to .udiv/.umul in assembler, I made a
mechanical (read as: safe) transformation. I didn't attempt
to make any simplifications.In particular, __ndelay and __udelay can be simplified significantly.
Some of the %y reads are unnecessary and these routines have no need
any longer for allocating a register window, they can be leaf
functions.Signed-off-by: David S. Miller
14 May, 2012
1 commit
-
We always have this instruction available, so no need to use
btfixup for it any more.This also eradicates the whole of atomic_32.S and thus the
__atomic_begin and __atomic_end symbols completely.Signed-off-by: David S. Miller
12 May, 2012
3 commits
-
Use those, instead of doing it all by hand.
Signed-off-by: David S. Miller
-
Let the compiler do stuff like this.
Signed-off-by: David S. Miller
-
Signed-off-by: Sam Ravnborg
Signed-off-by: David S. Miller
02 Feb, 2012
1 commit
-
Both sparc 32-bit's software divide assembler and MPILIB provide
clz_tab[] with identical contents.Break it out into a seperate object file and select it when
SPARC32 or MPILIB is set.Reported-by: Al Viro
Signed-off-by: David S. Miller
Signed-off-by: James Morris
11 Jan, 2012
1 commit
-
lib: use generic pci_iomap on all architectures
Many architectures don't want to pull in iomap.c,
so they ended up duplicating pci_iomap from that file.
That function isn't trivial, and we are going to modify it
https://lkml.org/lkml/2011/11/14/183
so the duplication hurts.This reduces the scope of the problem significantly,
by moving pci_iomap to a separate file and
referencing that from all architectures.* tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
alpha: drop pci_iomap/pci_iounmap from pci-noop.c
mn10300: switch to GENERIC_PCI_IOMAP
mn10300: add missing __iomap markers
frv: switch to GENERIC_PCI_IOMAP
tile: switch to GENERIC_PCI_IOMAP
tile: don't panic on iomap
sparc: switch to GENERIC_PCI_IOMAP
sh: switch to GENERIC_PCI_IOMAP
powerpc: switch to GENERIC_PCI_IOMAP
parisc: switch to GENERIC_PCI_IOMAP
mips: switch to GENERIC_PCI_IOMAP
microblaze: switch to GENERIC_PCI_IOMAP
arm: switch to GENERIC_PCI_IOMAP
alpha: switch to GENERIC_PCI_IOMAP
lib: add GENERIC_PCI_IOMAP
lib: move GENERIC_IOMAP to lib/KconfigFix up trivial conflicts due to changes nearby in arch/{m68k,score}/Kconfig
28 Dec, 2011
1 commit
-
atomic24 support was used to semaphores in the past - but is no longer used.
Signed-off-by: Sam Ravnborg
Signed-off-by: David S. Miller
04 Dec, 2011
1 commit
-
sparc copied pci_iomap from generic code, probably to avoid
pulling the rest of iomap.c in. Since that's in
a separate file now, we can reuse the common implementation.Signed-off-by: Michael S. Tsirkin
21 Oct, 2011
3 commits
-
Properly return the original destination buffer pointer.
Signed-off-by: David S. Miller
Tested-by: Kjetil Oftedal -
This is setting things up so that we can correct the return
value, so that it properly returns the original destination
buffer pointer.Signed-off-by: David S. Miller
Tested-by: Kjetil Oftedal -
Signed-off-by: David S. Miller
Tested-by: Kjetil Oftedal
04 Aug, 2011
1 commit
-
Signed-off-by: David S. Miller
03 Aug, 2011
3 commits
-
Signed-off-by: David S. Miller
-
Just like powerpc, we code patch at boot time.
Signed-off-by: David S. Miller
-
Don't use floating point on Niagara2, use the traditional
plain Niagara code instead.Unroll Niagara loops to 128 bytes for copy, and 256 bytes
for clear.Signed-off-by: David S. Miller
28 Jul, 2011
1 commit
-
Should have been done in commit 1af08a1407f4 ("This is in preparation
for more generic atomic").Signed-off-by: Stephen Rothwell
Cc: Arun Sharma
Cc: David Miller
Cc: "Hans-Christian Egtvedt"
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
27 Jul, 2011
1 commit
-
This allows us to move duplicated code in
(atomic_inc_not_zero() for now) toSigned-off-by: Arun Sharma
Reviewed-by: Eric Dumazet
Cc: Ingo Molnar
Cc: David Miller
Cc: Eric Dumazet
Acked-by: Mike Frysinger
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
21 May, 2011
1 commit
12 May, 2011
1 commit
-
When we are in the label cc_dword_align, registers %o0 and %o1 have the same last 2 bits,
but it's not guaranteed one of them is zero. So we can get unaligned memory access
in label ccte. Example of parameters which lead to this:
%o0=0x7ff183e9, %o1=0x8e709e7d, %g1=3With the parameters I had a memory corruption, when the additional 5 bytes were rewritten.
This patch corrects the error.One comment to the patch. We don't care about the third bit in %o1, because cc_end_cruft
stores word or less.Signed-off-by: Tkhai Kirill
Signed-off-by: David S. Miller