15 May, 2008
1 commit
-
I noticed this because alpha was broken due to the recent commit commit
bdc807871d58285737d50dc6163d0feb72cb0dc2 ("avoid overflows in
kernel/time.c"). Most arches do something like this in their
asm/param.h:#ifdef __KERNEL__
# define HZ CONFIG_HZ
#else
# define HZ 100
#endifA few arches though (namely alpha/h8300/um/v850/xtensa) either do no set
HZ at all for !__KERNEL__, or they set it wrongly. This should bring all
arches in line by setting up HZ for userspace.Without this currently perl 5.10 doesn't build on alpha:
perl.c: In function 'perl_construct':
perl.c:388: error: 'CONFIG_HZ' undeclared (first use in this function)
-> http://buildd.debian.org/fetch.cgi?pkg=perl;ver=5.10.0-10;arch=alpha;stamp=1210252894Signed-off-by: Mike Frysinger
Cc: Richard Henderson
Cc: Ivan Kokshaysky
Cc: Yoshinori Sato
Cc: Jeff Dike
Cc: Chris Zankel
Cc: maximilian attems
Signed-off-by: Andrew Morton
[ HZ on alpha is 1024 for historical reasons. - Linus ]
Signed-off-by: Linus Torvalds
03 May, 2008
1 commit
-
This modifies to use the
generic include files.Signed-off-by: H. Peter Anvin
Cc: Yoshinori Sato
29 Apr, 2008
1 commit
-
Unaligned access is ok for the following arches:
cris, m68k, mn10300, powerpc, s390, x86Arches that use the memmove implementation for native endian, and
the byteshifting for the opposite endianness.
h8300, m32r, xtensaPacked struct for native endian, byteshifting for other endian:
alpha, blackfin, ia64, parisc, sparc, sparc64, mips, shm86knommu is generic_be for Coldfire, otherwise unaligned access is ok.
frv, arm chooses endianness based on compiler settings, uses the byteshifting
versions. Remove the unaligned trap handler from frv as it is now unused.v850 is le, uses the byteshifting versions for both be and le.
Remove the now unused asm-generic implementation.
Signed-off-by: Harvey Harrison
Acked-by: David S. Miller
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
17 Apr, 2008
1 commit
-
Semaphores are no longer performance-critical, so a generic C
implementation is better for maintainability, debuggability and
extensibility. Thanks to Peter Zijlstra for fixing the lockdep
warning. Thanks to Harvey Harrison for pointing out that the
unlikely() was unnecessary.Signed-off-by: Matthew Wilcox
Acked-by: Ingo Molnar
03 Apr, 2008
1 commit
-
Currently include/linux/kvm.h is not considered by make headers_install,
because Kbuild cannot handle " unifdef-$(CONFIG_FOO) += foo.h. This problem
was introduced bycommit fb56dbb31c4738a3918db81fd24da732ce3b4ae6
Author: Avi Kivity
Date: Sun Dec 2 10:50:06 2007 +0200KVM: Export include/linux/kvm.h only if $ARCH actually supports KVM
Currently, make headers_check barfs due to , which
includes, not existing. Rather than add a zillion s, export kvm.
only if the arch actually supports it.Signed-off-by: Avi Kivity
which makes this an 2.6.25 regression.
One way of solving the issue is to enhance Kbuild, but Avi and David conviced
me, that changing headers_install is not the way to go. This patch changes
the definition for linux/kvm.h to unifdef-y.If unifdef-y is used for linux/kvm.h "make headers_check" will fail on all
architectures without asm/kvm.h. Therefore, this patch also provides
asm/kvm.h on all architectures.Signed-off-by: Christian Borntraeger
Acked-by: Avi Kivity
Cc: Sam Ravnborg
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
14 Mar, 2008
1 commit
-
Al Viro wrote:
>
> After that commit in asm-h8300/uaccess.h we have
>
> #define get_user(x, ptr) \
> ({ \
> int __gu_err = 0; \
> uint32_t __gu_val = 0; \
> ^^^^^^^^^^^^^^^^^
> switch (sizeof(*(ptr))) { \
> case 1: \
> case 2: \
> case 4: \
> __gu_val = *(ptr); \
> break; \
> case 8: \
> memcpy(&__gu_val, ptr, sizeof (*(ptr))); \
> ^^^^^^^^^^^^^^^^
>
> which, of course, is FUBAR whenever we actually hit that case - memcpy of
> 8 bytes into uint32_t is obviously wrong. Why don't we simply doCc: Al Viro
Signed-off-by: Yoshinori Sato
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
24 Feb, 2008
2 commits
-
- add missing file and declare.
- remove unused file and macros.
- some cleanup.Signed-off-by: Yoshinori Sato
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
get_user const *ptr access fix.
Signed-off-by: Yoshinori Sato
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
10 Feb, 2008
1 commit
-
The pte_fn_t in include/linux/mm.h make it necessary for all architectures
to define a pgtable_t type, even those that do not have an mmu.Signed-off-by: Martin Schwidefsky
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
09 Feb, 2008
3 commits
-
When the conversion factor between jiffies and milli- or microseconds is
not a single multiply or divide, as for the case of HZ == 300, we currently
do a multiply followed by a divide. The intervening result, however, is
subject to overflows, especially since the fraction is not simplified (for
HZ == 300, we multiply by 300 and divide by 1000).This is exposed to the user when passing a large timeout to poll(), for
example.This patch replaces the multiply-divide with a reciprocal multiplication on
32-bit platforms. When the input is an unsigned long, there is no portable
way to do this on 64-bit platforms there is no portable way to do this
since it requires a 128-bit intermediate result (which gcc does support on
64-bit platforms but may generate libgcc calls, e.g. on 64-bit s390), but
since the output is a 32-bit integer in the cases affected, just simplify
the multiply-divide (*3/10 instead of *300/1000).The reciprocal multiply used can have off-by-one errors in the upper half
of the valid output range. This could be avoided at the expense of having
to deal with a potential 65-bit intermediate result. Since the intent is
to avoid overflow problems and most of the other time conversions are only
semiexact, the off-by-one errors were considered an acceptable tradeoff.At Ralf Baechle's suggestion, this version uses a Perl script to compute
the necessary constants. We already have dependencies on Perl for kernel
compiles. This does, however, require the Perl module Math::BigInt, which
is included in the standard Perl distribution starting with version 5.8.0.
In order to support older versions of Perl, include a table of canned
constants in the script itself, and structure the script so that
Math::BigInt isn't required if pulling values from said table.Running the script requires that the HZ value is available from the
Makefile. Thus, this patch also adds the Kconfig variable CONFIG_HZ to the
architectures which didn't already have it (alpha, cris, frv, h8300, m32r,
m68k, m68knommu, sparc, v850, and xtensa.) It does *not* touch the sh or
sh64 architectures, since Paul Mundt has dealt with those separately in the
sh tree.Signed-off-by: H. Peter Anvin
Cc: Ralf Baechle ,
Cc: Sam Ravnborg ,
Cc: Paul Mundt ,
Cc: Richard Henderson ,
Cc: Michael Starvik ,
Cc: David Howells ,
Cc: Yoshinori Sato ,
Cc: Hirokazu Takata ,
Cc: Geert Uytterhoeven ,
Cc: Roman Zippel ,
Cc: William L. Irwin ,
Cc: Chris Zankel ,
Cc: H. Peter Anvin ,
Cc: Jan Engelhardt
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Some arches (like alpha and ia64) already have a clean posix_types.h header.
This brings all the others in line by removing all references to __GLIBC__
(and some undocumented __USE_ALL).Signed-off-by: Mike Frysinger
Acked-by: Ingo Molnar
Cc: Ulrich Drepper
Cc: Roland McGrath
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
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.Signed-off-by: David Howells
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
08 Feb, 2008
3 commits
-
Use the new generic cmpxchg_local (disables interrupt). Also use the generic
cmpxchg as fallback if SMP is not set.Signed-off-by: Mathieu Desnoyers
Cc: Yoshinori Sato
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
struct user.u_ar0 is defined to contain a pointer offset on all
architectures in which it is defined (all architectures which define an
a.out format except SPARC.) However, it has a pointer type in the headers,
which is pointless -- is not exported to userspace, and it
just makes the code messy.Redefine the field as "unsigned long" (which is the same size as a pointer
on all Linux architectures) and change the setting code to user offsetof()
instead of hand-coded arithmetic.Cc: Linux Arch Mailing List
Cc: Bryan Wu
Cc: Roman Zippel
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: Richard Henderson
Cc: Ivan Kokshaysky
Cc: Russell King
Cc: Lennert Buytenhek
Cc: Håvard Skinnemoen
Cc: Mikael Starvik
Cc: Yoshinori Sato
Cc: Tony Luck
Cc: Hirokazu Takata
Cc: Ralf Baechle
Cc: Paul Mackerras
Cc: Martin Schwidefsky
Cc: Heiko Carstens
Cc: Paul Mundt
Signed-off-by: H. Peter Anvin
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
asm/elf.h, asm/page.h and asm/user.h don't export to userspace now, so we can
drop #ifdef __KERNEL__ for them.[k.shutemov@gmail.com: remove #ifdef __KERNEL_]
Signed-off-by: Kirill A. Shutemov
Reviewed-by: David Woodhouse
Cc:
Signed-off-by: Kirill A. Shutemov
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
07 Feb, 2008
1 commit
-
This patch removes the unused mm_{ptov,vtop}().
Signed-off-by: Adrian Bunk
Acked-by: Greg Ungerer
Acked-by: Bryan Wu
Cc: Miles Bader
Cc: Yoshinori Sato
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
01 Feb, 2008
1 commit
-
A userspace program may wish to set the mark for each packets its send
without using the netfilter MARK target. Changing the mark can be used
for mark based routing without netfilter or for packet filtering.It requires CAP_NET_ADMIN capability.
Signed-off-by: Laszlo Attila Toth
Acked-by: Patrick McHardy
Signed-off-by: David S. Miller
11 Dec, 2007
1 commit
-
Some places where CLOCK_TICK_RATE may be used incorrectly:
arch/arm/mach-mx3/time.c:125: __raw_writel((v / CLOCK_TICK_RATE) - 1, MXC_GPT_GPTPR);
drivers/watchdog/davinci_wdt.c:103: timer_margin = (((u64)heartbeat * CLOCK_TICK_RATE) & 0xffffffff);
drivers/watchdog/davinci_wdt.c:105: timer_margin = (((u64)heartbeat * CLOCK_TICK_RATE) >> 32);
drivers/watchdog/ks8695_wdt.c:64: unsigned long tval = wdt_time * CLOCK_TICK_RATE;I'm not sure whether this definition is used there, but adding parentheses
should be good anyway.Signed-off-by: Roel Kluin
Cc: Yoshinori Sato
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
23 Oct, 2007
2 commits
-
Add a Kconfig entry which will toggle some sanity checks on the sg
entry and tables.Signed-off-by: Jens Axboe
-
Change the page member of the scatterlist structure to be an unsigned
long, and encode more stuff in the lower bits:- Bits 0 and 1 zero: this is a normal sg entry. Next sg entry is located
at sg + 1.
- Bit 0 set: this is a chain entry, the next real entry is at ->page_link
with the two low bits masked off.
- Bit 1 set: this is the final entry in the sg entry. sg_next() will return
NULL when passed such an entry.It's thus important that sg table users use the proper accessors to get
and set the page member.Signed-off-by: Jens Axboe
20 Oct, 2007
3 commits
-
These don't appear anywhere else in the kernel anymore.
Signed-off-by: Stefan Richter
Acked-by: Paul Mundt
Acked-by: Greg Ungerer
Signed-off-by: Adrian Bunk -
forbid asm/bitops.h direct inclusion
Because of compile errors that may occur after bit changes if asm/bitops.h is
included directly without e.g. linux/kernel.h which includes linux/bitops.h,
forbid direct inclusion of asm/bitops.h. Thanks to Adrian Bunk.Signed-off-by: Jiri Slaby
Cc: Adrian Bunk
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Nobody uses flush_tlb_pgtables anymore, this patch removes all remaining
traces of it from all archs.Signed-off-by: Benjamin Herrenschmidt
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
19 Oct, 2007
1 commit
-
Introduce test_and_set_bit_lock / clear_bit_unlock bitops with lock semantics.
Convert all architectures to use the generic implementation.Signed-off-by: Nick Piggin
Acked-By: David Howells
Cc: Richard Henderson
Cc: Ivan Kokshaysky
Cc: Russell King
Cc: Haavard Skinnemoen
Cc: Bryan Wu
Cc: Mikael Starvik
Cc: David Howells
Cc: Yoshinori Sato
Cc: "Luck, Tony"
Cc: Hirokazu Takata
Cc: Geert Uytterhoeven
Cc: Roman Zippel
Cc: Greg Ungerer
Cc: Ralf Baechle
Cc: Kyle McMartin
Cc: Matthew Wilcox
Cc: Paul Mackerras
Cc: Benjamin Herrenschmidt
Cc: Heiko Carstens
Cc: Martin Schwidefsky
Cc: Paul Mundt
Cc: Kazumoto Kojima
Cc: Richard Curnow
Cc: William Lee Irwin III
Cc: "David S. Miller"
Cc: Jeff Dike
Cc: Paolo 'Blaisorblade' Giarrusso
Cc: Miles Bader
Cc: Andi Kleen
Cc: Chris Zankel
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
17 Oct, 2007
4 commits
-
dma_cache_(wback|inv|wback_inv) were the earliest attempt on a generalized
cache managment API for I/O purposes. Originally it was basically the raw
MIPS low level cache API exported to the entire world. The API has
suffered from a lack of documentation, was not very widely used unlike it's
more modern brothers and can easily be replaced by dma_cache_sync. So
remove it rsp. turn the surviving bits back into an arch private API, as
discussed on linux-arch.Signed-off-by: Ralf Baechle
Acked-by: Paul Mundt
Acked-by: Paul Mackerras
Acked-by: David S. Miller
Acked-by: Kyle McMartin
Acked-by: Haavard Skinnemoen
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
All asm/ipc.h files do only #include .
This patch therefore removes all include/asm-*/ipc.h files and moves the
contents of include/asm-generic/ipc.h to include/linux/ipc.h.Signed-off-by: Adrian Bunk
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Remove the __STRICT_ANSI__ check from the __u64/__s64 declaration on
32bit targets.GCC can be made to warn about usage of long long types with ISO C90
(-ansi), but only with -pedantic. You can write this in a way that even
then it doesn't cause warnings, namely by:#ifdef __GNUC__
__extension__ typedef __signed__ long long __s64;
__extension__ typedef unsigned long long __u64;
#endifThe __extension__ keyword in front of this switches off any pedantic
warnings for this expression.Signed-off-by: Olaf Hering
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
DECLARE_MUTEX_LOCKED was used for semaphores used as completions and we've
got rid of them. Well, except for one in libusual that the maintainer
explicitly wants to keep as semaphore. So convert that useage to an
explicit sema_init and kill of DECLARE_MUTEX_LOCKED so that new code is
reminded to use a completion.Signed-off-by: Christoph Hellwig
Acked-by: "Satyam Sharma"
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
03 Oct, 2007
1 commit
-
Add minimum support for the Blackfin relocations, since we don't have
enough space in each reloc. The idea is to store a value with one
relocation so that subsequent ones can access it.Actually, this patch is required for Blackfin. Currently if BINFMT_FLAT is
enabled, git-tree kernel will fail to compile.Signed-off-by: Bernd Schmidt
Signed-off-by: Bryan Wu
Cc: David McCullough
Cc: Greg Ungerer
Cc: Miles Bader
Signed-off-by: Andrew Morton
01 Aug, 2007
1 commit
-
Remove unused TIF_NOTIFY_RESUME flag for all processor architectures. The
flag was not used excecpt on IA-64 where the patch replaces it with
TIF_PERFMON_WORK.Signed-off-by: stephane eranian
Cc:
Cc: "Luck, Tony"
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
23 Jul, 2007
1 commit
-
Now that the last inlined instances are gone, all that is left to do
is turning disable_irq_nosync on arm26 and m68k from defines to aliases
and we are all set - we can make these externs in linux/interrupt.h
uncoditional and kill remaining instances in asm/irq.hSigned-off-by: Al Viro
Signed-off-by: Linus Torvalds
20 Jul, 2007
1 commit
-
New arch macro STACK_TOP_MAX it gives the larges valid stack address for the
architecture in question.It differs from STACK_TOP in that it will not distinguish between
personalities but will always return the largest possible address.This is used to create the initial stack on execve, which we will move down to
the proper location once the binfmt code has figured out where that is.Signed-off-by: Peter Zijlstra
Signed-off-by: Ollie Wild
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
18 Jul, 2007
3 commits
-
Add function helper, fb_is_primary_device(). Given struct fb_info, it will
return a nonzero value if the device is the primary display.Currently, only the i386 is supported where the function checks for the
IORESOURCE_ROM_SHADOW flag.Signed-off-by: Antonino Daplas
Cc: David Miller
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Move arch-specific bits of fb_mmap() to their respective subdirectories
[bob.picco@hp.com: efi_range_is_wc is referenced but not declared]
[bunk@stusta.de: fix include/asm-m68k/fb.h]
Signed-off-by: Antonino Daplas
Acked-by: David S. Miller
Signed-off-by: Adrian Bunk
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
It is often known at allocation time whether a page may be migrated or not.
This patch adds a flag called __GFP_MOVABLE and a new mask called
GFP_HIGH_MOVABLE. Allocations using the __GFP_MOVABLE can be either migrated
using the page migration mechanism or reclaimed by syncing with backing
storage and discarding.An API function very similar to alloc_zeroed_user_highpage() is added for
__GFP_MOVABLE allocations called alloc_zeroed_user_highpage_movable(). The
flags used by alloc_zeroed_user_highpage() are not changed because it would
change the semantics of an existing API. After this patch is applied there
are no in-kernel users of alloc_zeroed_user_highpage() so it probably should
be marked deprecated if this patch is merged.Note that this patch includes a minor cleanup to the use of __GFP_ZERO in
shmem.c to keep all flag modifications to inode->mapping in the
shmem_dir_alloc() helper function. This clean-up suggestion is courtesy of
Hugh Dickens.Additional credit goes to Christoph Lameter and Linus Torvalds for shaping the
concept. Credit to Hugh Dickens for catching issues with shmem swap vector
and ramfs allocations.[akpm@linux-foundation.org: build fix]
[hugh@veritas.com: __GFP_ZERO cleanup]
Signed-off-by: Mel Gorman
Cc: Andy Whitcroft
Cc: Christoph Lameter
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
17 Jul, 2007
3 commits
-
Continuing the work started in 411f0f3edc141a582190d3605cadd1d993abb6df ...
This enables code with a dma path, that compiles away, to build without
requiring additional code factoring. It also prevents code that calls
dma_alloc_coherent and dma_free_coherent from linking whereas previously
the code would hit a BUG() at run time. Finally, it allows archs that set
!HAS_DMA to delete their asm/dma-mapping.h file.Cc: Cornelia Huck
Cc: Martin Schwidefsky
Cc: Heiko Carstens
Cc: John W. Linville
Cc: Kyle McMartin
Cc: James Bottomley
Cc: Tejun Heo
Cc: Jeff Garzik
Cc:
Cc:
Cc:
Cc:
Signed-off-by: Dan Williams
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Signed-off-by: Yoshinori Sato
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
Add the needed constants and defines to activate the new tty code on this
platformSigned-off-by: Alan Cox
Cc: Yoshinori Sato
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
12 Jul, 2007
1 commit
-
I'm not sure if this is going to fly, weak symbols work on the compilers I'm
using, but whether they work for all of the affected architectures I can't say.
I've cc'ed as many arch maintainers/lists as I could find.But assuming they do, we can use a weak empty definition of
pcibios_add_platform_entries() to avoid having an empty definition on every
arch.Signed-off-by: Michael Ellerman
Signed-off-by: Greg Kroah-Hartman
11 Jul, 2007
1 commit
-
Add the termios2 structure ready for enabling on most platforms. One or
two like Sparc are plain weird so have been left alone. Most can use the
same structure as ktermios for termios2 (ie the newer ioctl uses the
structure matching the current kernel structure)Signed-off-by: Alan Cox
Cc: Bryan Wu
Cc: Ian Molton
Cc: Haavard Skinnemoen
Cc: Yoshinori Sato
Cc: Mikael Starvik
Cc: David Howells
Cc: "Luck, Tony"
Cc: Hirokazu Takata
Cc: Geert Uytterhoeven
Cc: Roman Zippel
Cc: Ralf Baechle
Cc: Kyle McMartin
Cc: Matthew Wilcox
Cc: Heiko Carstens
Cc: Martin Schwidefsky
Cc: Paul Mundt
Cc: Kazumoto Kojima
Cc: Richard Curnow
Cc: Miles Bader
Cc: Chris Zankel
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds