15 Jan, 2009
1 commit
-
Add swab.h to kbuild.asm and remove the individual entries from
each arch, mark as unifdef as some arches have some kernel-only
bits inside.Signed-off-by: Harvey Harrison
Signed-off-by: Linus Torvalds
08 Jan, 2009
1 commit
-
Make VMAs per mm_struct as for MMU-mode linux. This solves two problems:
(1) In SYSV SHM where nattch for a segment does not reflect the number of
shmat's (and forks) done.(2) In mmap() where the VMA's vm_mm is set to point to the parent mm by an
exec'ing process when VM_EXECUTABLE is specified, regardless of the fact
that a VMA might be shared and already have its vm_mm assigned to another
process or a dead process.A new struct (vm_region) is introduced to track a mapped region and to remember
the circumstances under which it may be shared and the vm_list_struct structure
is discarded as it's no longer required.This patch makes the following additional changes:
(1) Regions are now allocated with alloc_pages() rather than kmalloc() and
with no recourse to __GFP_COMP, so the pages are not composite. Instead,
each page has a reference on it held by the region. Anything else that is
interested in such a page will have to get a reference on it to retain it.
When the pages are released due to unmapping, each page is passed to
put_page() and will be freed when the page usage count reaches zero.(2) Excess pages are trimmed after an allocation as the allocation must be
made as a power-of-2 quantity of pages.(3) VMAs are added to the parent MM's R/B tree and mmap lists. As an MM may
end up with overlapping VMAs within the tree, the VMA struct address is
appended to the sort key.(4) Non-anonymous VMAs are now added to the backing inode's prio list.
(5) Holes may be punched in anonymous VMAs with munmap(), releasing parts of
the backing region. The VMA and region structs will be split if
necessary.(6) sys_shmdt() only releases one attachment to a SYSV IPC shared memory
segment instead of all the attachments at that addresss. Multiple
shmat()'s return the same address under NOMMU-mode instead of different
virtual addresses as under MMU-mode.(7) Core dumping for ELF-FDPIC requires fewer exceptions for NOMMU-mode.
(8) /proc/maps is now the global list of mapped regions, and may list bits
that aren't actually mapped anywhere.(9) /proc/meminfo gains a line (tagged "MmapCopy") that indicates the amount
of RAM currently allocated by mmap to hold mappable regions that can't be
mapped directly. These are copies of the backing device or file if not
anonymous.These changes make NOMMU mode more similar to MMU mode. The downside is that
NOMMU mode requires some extra memory to track things over NOMMU without this
patch (VMAs are no longer shared, and there are now region structs).Signed-off-by: David Howells
Tested-by: Mike Frysinger
Acked-by: Paul Mundt
07 Jan, 2009
2 commits
-
Signed-off-by: Harvey Harrison
Signed-off-by: Linus Torvalds -
The atomic_t type cannot currently be used in some header files because it
would create an include loop with asm/atomic.h. Move the type definition
to linux/types.h to break the loop.Signed-off-by: Matthew Wilcox
Cc: Huang Ying
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
03 Jan, 2009
1 commit
-
Like fls, but can't be handed 0 and returns the bit number.
Signed-off-by: Rusty Russell
18 Oct, 2008
1 commit
-
Just include for __ide_mm_*() instead of
defining them to normal I/O helpers so PCI bus CPU byte-swapping
is done as needed.Cc: David Howells
Signed-off-by: Bartlomiej Zolnierkiewicz
17 Oct, 2008
1 commit
-
Switch unaligned access to the packed-struct implementation for BE accesses as
this reduces the size of the kernel a little. LE still uses the byte shift.Signed-off-by: Harvey Harrison
Signed-off-by: David Howells
Signed-off-by: Linus Torvalds
16 Oct, 2008
1 commit
-
The SET_PERSONALITY macro is always called with a second argument of 0.
Remove the ibcs argument and the various tests to set the PER_SVR4
personality.Signed-off-by: Martin Schwidefsky
21 Aug, 2008
1 commit
-
Provide ioremap_wc() for FRV.
Signed-off-by: David Howells
Signed-off-by: Linus Torvalds
02 Aug, 2008
1 commit
-
Wire up for FRV the system calls that were added in the last merge window.
Signed-off-by: David Howells
Signed-off-by: Linus Torvalds
27 Jul, 2008
2 commits
-
long overdue...
Signed-off-by: Al Viro
-
Add per-device dma_mapping_ops support for CONFIG_X86_64 as POWER
architecture does:This enables us to cleanly fix the Calgary IOMMU issue that some devices
are not behind the IOMMU (http://lkml.org/lkml/2008/5/8/423).I think that per-device dma_mapping_ops support would be also helpful for
KVM people to support PCI passthrough but Andi thinks that this makes it
difficult to support the PCI passthrough (see the above thread). So I
CC'ed this to KVM camp. Comments are appreciated.A pointer to dma_mapping_ops to struct dev_archdata is added. If the
pointer is non NULL, DMA operations in asm/dma-mapping.h use it. If it's
NULL, the system-wide dma_ops pointer is used as before.If it's useful for KVM people, I plan to implement a mechanism to register
a hook called when a new pci (or dma capable) device is created (it works
with hot plugging). It enables IOMMUs to set up an appropriate
dma_mapping_ops per device.The major obstacle is that dma_mapping_error doesn't take a pointer to the
device unlike other DMA operations. So x86 can't have dma_mapping_ops per
device. Note all the POWER IOMMUs use the same dma_mapping_error function
so this is not a problem for POWER but x86 IOMMUs use different
dma_mapping_error functions.The first patch adds the device argument to dma_mapping_error. The patch
is trivial but large since it touches lots of drivers and dma-mapping.h in
all the architecture.This patch:
dma_mapping_error() doesn't take a pointer to the device unlike other DMA
operations. So we can't have dma_mapping_ops per device.Note that POWER already has dma_mapping_ops per device but all the POWER
IOMMUs use the same dma_mapping_error function. x86 IOMMUs use device
argument.[akpm@linux-foundation.org: fix sge]
[akpm@linux-foundation.org: fix svc_rdma]
[akpm@linux-foundation.org: build fix]
[akpm@linux-foundation.org: fix bnx2x]
[akpm@linux-foundation.org: fix s2io]
[akpm@linux-foundation.org: fix pasemi_mac]
[akpm@linux-foundation.org: fix sdhci]
[akpm@linux-foundation.org: build fix]
[akpm@linux-foundation.org: fix sparc]
[akpm@linux-foundation.org: fix ibmvscsi]
Signed-off-by: FUJITA Tomonori
Cc: Muli Ben-Yehuda
Cc: Andi Kleen
Cc: Thomas Gleixner
Cc: Ingo Molnar
Cc: Avi Kivity
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
26 Jul, 2008
4 commits
-
* git://git.infradead.org/~dwmw2/random-2.6:
remove dummy asm/kvm.h files
firmware: create firmware binaries during 'make modules'. -
This patch removes the dummy asm/kvm.h files on architectures not (yet)
supporting KVM and uses the same conditional headers installation as
already used for a.out.h .Also removed are superfluous install rules in the s390 and x86 Kbuild
files (they are already in Kbuild.asm).Signed-off-by: Adrian Bunk
Acked-by: Sam Ravnborg
Signed-off-by: David Woodhouse -
This patch contains the following cleanups for the asm/ptrace.h
userspace headers:- include/asm-generic/Kbuild.asm already lists ptrace.h, remove
the superfluous listings in the Kbuild files of the following
architectures:
- cris
- frv
- powerpc
- x86
- don't expose function prototypes and macros to userspace:
- arm
- blackfin
- cris
- mn10300
- parisc
- remove #ifdef CONFIG_'s around #define's:
- blackfin
- m68knommu
- sh: AFAIK __SH5__ should work in both kernel and userspace,
no need to leak CONFIG_SUPERH64 to userspace
- xtensa: cosmetical change to remove empty
#ifndef __ASSEMBLY__ #else #endif
from the userspace headersNot changed by this patch is the fact that the following architectures
have a different struct pt_regs depending on CONFIG_ variables:
- h8300
- m68knommu
- mipsThis does not work in userspace.
Signed-off-by: Adrian Bunk
Cc:
Cc: Roland McGrath
Cc: Oleg Nesterov
Acked-by: Greg Ungerer
Acked-by: Paul Mundt
Acked-by: Grant Grundler
Acked-by: Jesper Nilsson
Acked-by: Chris Zankel
Acked-by: David Howells
Acked-by: Paul Mackerras
Acked-by: Russell King
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds -
We duplicate alloc/free_thread_info defines on many platforms (the
majority uses __get_free_pages/free_pages). This patch defines common
defines and removes these duplicated defines.
__HAVE_ARCH_THREAD_INFO_ALLOCATOR is introduced for platforms that do
something different.Signed-off-by: FUJITA Tomonori
Acked-by: Russell King
Cc: Pekka Enberg
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
25 Jul, 2008
4 commits
-
* git://git.kernel.org/pub/scm/linux/kernel/git/bart/ide-2.6: (76 commits)
ide: use proper printk() KERN_* levels in ide-probe.c
ide: fix for EATA SCSI HBA in ATA emulating mode
ide: remove stale comments from drivers/ide/Makefile
ide: enable local IRQs in all handlers for TASKFILE_NO_DATA data phase
ide-scsi: remove kmalloced struct request
ht6560b: remove old history
ht6560b: update email address
ide-cd: fix oops when using growisofs
gayle: release resources on ide_host_add() failure
palm_bk3710: add UltraDMA/100 support
ide: trivial sparse annotations
ide: ide-tape.c sparse annotations and unaligned access removal
ide: drop 'name' parameter from ->init_chipset method
ide: prefix messages from IDE PCI host drivers by driver name
it821x: remove DECLARE_ITE_DEV() macro
it8213: remove DECLARE_ITE_DEV() macro
ide: include PCI device name in messages from IDE PCI host drivers
ide: remove for some archs
ide-generic: remove ide_default_{io_base,irq}() inlines (take 3)
ide-generic: is no longer needed on ppc32
... -
* Now that ide_hwif_t instances are allocated dynamically
the difference between MAX_HWIFS == 2 and MAX_HWIFS == 10
is ~100 bytes (x86-32) so use MAX_HWIFS == 10 on all archs
except these ones that use MAX_HWIFS == 1.* Define MAX_HWIFS in instead of .
[ Please note that avr32/cris/v850 have no
and alpha/ia64/sh always define CONFIG_IDE_MAX_HWIFS. ]Signed-off-by: Bartlomiej Zolnierkiewicz
-
* 'semaphore' of git://git.kernel.org/pub/scm/linux/kernel/git/willy/misc:
Remove __DECLARE_SEMAPHORE_GENERIC
Remove asm/semaphore.h
Remove use of asm/semaphore.h
Add missing semaphore.h includes
Remove mention of semaphores from kernel-locking -
On 32-bit architectures PAGE_ALIGN() truncates 64-bit values to the 32-bit
boundary. For example:u64 val = PAGE_ALIGN(size);
always returns a value < 4GB even if size is greater than 4GB.
The problem resides in PAGE_MASK definition (from include/asm-x86/page.h for
example):#define PAGE_SHIFT 12
#define PAGE_SIZE (_AC(1,UL) << PAGE_SHIFT)
#define PAGE_MASK (~(PAGE_SIZE-1))
...
#define PAGE_ALIGN(addr) (((addr)+PAGE_SIZE-1)&PAGE_MASK)The "~" is performed on a 32-bit value, so everything in "and" with
PAGE_MASK greater than 4GB will be truncated to the 32-bit boundary.
Using the ALIGN() macro seems to be the right way, because it uses
typeof(addr) for the mask.Also move the PAGE_ALIGN() definitions out of include/asm-*/page.h in
include/linux/mm.h.See also lkml discussion: http://lkml.org/lkml/2008/6/11/237
[akpm@linux-foundation.org: fix drivers/media/video/uvc/uvc_queue.c]
[akpm@linux-foundation.org: fix v850]
[akpm@linux-foundation.org: fix powerpc]
[akpm@linux-foundation.org: fix arm]
[akpm@linux-foundation.org: fix mips]
[akpm@linux-foundation.org: fix drivers/media/video/pvrusb2/pvrusb2-dvb.c]
[akpm@linux-foundation.org: fix drivers/mtd/maps/uclinux.c]
[akpm@linux-foundation.org: fix powerpc]
Signed-off-by: Andrea Righi
Cc:
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
24 Jul, 2008
1 commit
-
All users have now been converted to linux/semaphore.h and we don't need
to keep these files around any longer.Signed-off-by: Matthew Wilcox
21 Jul, 2008
1 commit
-
Fix up the termios of the people who have not yet got with the program
Signed-off-by: Alan Cox
Signed-off-by: Linus Torvalds
13 Jul, 2008
1 commit
-
Fix FRV irqs_disabled() to return an int, not an unsigned long to avoid
this warning:kernel/sched.c: In function '__might_sleep':
kernel/sched.c:8198: warning: format '%d' expects type 'int', but argument 3 has type 'long unsigned int'Signed-off-by: David Howells
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
06 Jun, 2008
1 commit
-
ip_fast_csum() requires a memory clobber on its inline asm as it accesses
memory in a fashion that gcc can't predict.The GCC manual says:
If your assembler instructions access memory in an unpredictable
fashion, add `memory' to the list of clobbered registers. This will
cause GCC to not keep memory values cached in registers across the
assembler instruction and not optimize stores or loads to that memory.The bug hasn't been noticed in FRV, but it has been seen in PA-RISC.
Signed-off-by: David Howells
Signed-off-by: Linus Torvalds
29 May, 2008
1 commit
-
> +#define ARCH_KMALLOC_MINALIGN (sizeof(long) * 2)
> +#define ARCH_SLAB_MINALIGN (sizeof(long) * 2)This doesn't work if SLAB is selected and slab debugging is enabled as
these are passed to the preprocessor, and the preprocessor doesn't
understand sizeof.Signed-off-by: Linus Torvalds
28 May, 2008
1 commit
-
Specify the minimum slab/kmalloc alignment to be 8 bytes. This fixes a
crash when SLOB is selected as the memory allocator. The FRV arch needs
this so that it can use the load- and store-double instructions without
faulting. By default SLOB sets the minimum to be 4 bytes.Signed-off-by: David Howells
Signed-off-by: Linus Torvalds
15 May, 2008
1 commit
-
read_barrie_depends has always been a noop (not a compiler barrier) on all
architectures except SMP alpha. This brings UP alpha and frv into line with all
other architectures, and fixes incorrect documentation.Signed-off-by: Nick Piggin
Acked-by: Paul E. McKenney
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: David Howells
01 May, 2008
1 commit
-
Fix a reference in a arch/frv/mm/Makefile to unaligned.c which has now been
deleted.Also revert the change to the guard macro name in include/asm-frv/unaligned.h.
Signed-off-by: David Howells
Cc: Harvey Harrison
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
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
28 Apr, 2008
1 commit
-
s390 for one, cannot implement VM_MIXEDMAP with pfn_valid, due to their memory
model (which is more dynamic than most). Instead, they had proposed to
implement it with an additional path through vm_normal_page(), using a bit in
the pte to determine whether or not the page should be refcounted:vm_normal_page()
{
...
if (unlikely(vma->vm_flags & (VM_PFNMAP|VM_MIXEDMAP))) {
if (vma->vm_flags & VM_MIXEDMAP) {
#ifdef s390
if (!mixedmap_refcount_pte(pte))
return NULL;
#else
if (!pfn_valid(pfn))
return NULL;
#endif
goto out;
}
...
}This is fine, however if we are allowed to use a bit in the pte to determine
refcountedness, we can use that to _completely_ replace all the vma based
schemes. So instead of adding more cases to the already complex vma-based
scheme, we can have a clearly seperate and simple pte-based scheme (and get
slightly better code generation in the process):vm_normal_page()
{
#ifdef s390
if (!mixedmap_refcount_pte(pte))
return NULL;
return pte_page(pte);
#else
...
#endif
}And finally, we may rather make this concept usable by any architecture rather
than making it s390 only, so implement a new type of pte state for this.
Unfortunately the old vma based code must stay, because some architectures may
not be able to spare pte bits. This makes vm_normal_page a little bit more
ugly than we would like, but the 2 cases are clearly seperate.So introduce a pte_special pte state, and use it in mm/memory.c. It is
currently a noop for all architectures, so this doesn't actually result in any
compiled code changes to mm/memory.o.BTW:
I haven't put vm_normal_page() into arch code as-per an earlier suggestion.
The reason is that, regardless of where vm_normal_page is actually
implemented, the *abstraction* is still exactly the same. Also, while it
depends on whether the architecture has pte_special or not, that is the
only two possible cases, and it really isn't an arch specific function --
the role of the arch code should be to provide primitive functions and
accessors with which to build the core code; pte_special does that. We do
not want architectures to know or care about vm_normal_page itself, and
we definitely don't want them being able to invent something new there
out of sight of mm/ code. If we made vm_normal_page an arch function, then
we have to make vm_insert_mixed (next patch) an arch function too. So I
don't think moving it to arch code fundamentally improves any abstractions,
while it does practically make the code more difficult to follow, for both
mm and arch developers, and easier to misuse.[akpm@linux-foundation.org: build fix]
Signed-off-by: Nick Piggin
Acked-by: Carsten Otte
Cc: Jared Hulbert
Cc: Martin Schwidefsky
Cc: Heiko Carstens
Signed-off-by: Andrew Morton
Signed-off-by: Linus Torvalds
22 Apr, 2008
1 commit
-
HARD_RESET_NOW() was unused.
And one of the few remaining cli() users.
Signed-off-by: Adrian Bunk
Signed-off-by: David Howells
Signed-off-by: Linus Torvalds
20 Apr, 2008
1 commit
-
Create a simple macro to always return a pointer to the node_to_cpumask(node)
value. This relies on compiler optimization to remove the extra indirection:#define node_to_cpumask_ptr(v, node) \
cpumask_t _##v = node_to_cpumask(node), *v = &_##vFor those systems with a large cpumask size, then a true pointer
to the array element can be used:#define node_to_cpumask_ptr(v, node) \
cpumask_t *v = &(node_to_cpumask_map[node])A node_to_cpumask_ptr_next() macro is provided to access another
node_to_cpumask value.The other change is to always include asm-generic/topology.h moving the
ifdef CONFIG_NUMA to this same file.Note: there are no references to either of these new macros in this patch,
only the definition.Based on 2.6.25-rc5-mm1
# alpha
Cc: Richard Henderson# fujitsu
Cc: David Howells# ia64
Cc: Tony Luck# powerpc
Cc: Paul Mackerras
Cc: Anton Blanchard# sparc
Cc: David S. Miller
Cc: William L. Irwin# x86
Cc: H. Peter AnvinSigned-off-by: Mike Travis
Signed-off-by: Ingo Molnar
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
11 Apr, 2008
4 commits
-
Don't make smp_{r,w,}mb() interpolate a MEMBAR instruction when CONFIG_SMP=n as
SMP memory barries on UP systems should interpolate a compiler barrier only.Signed-off-by: David Howells
Signed-off-by: Linus Torvalds -
Use traps 120-126 to emulate atomic cmpxchg32, xchg32, and XOR-, OR-, AND-, SUB-
and ADD-to-memory operations for userspace.Signed-off-by: David Howells
Signed-off-by: Linus Torvalds -
Move STACK_TOP_MAX up so that we don't try moving the stack above it as that
causes setup_arg_pages() to malfunction.Signed-off-by: David Howells
Signed-off-by: Linus Torvalds -
Handle update_mmu_cache() being called when current->mm is NULL.
We cache static TLB mappings for the current page table in DAMPR4 and DAMPR5
on the theory that the next data lookup is likely to be in the same general
region, and thus is likely to be mapped by the same page table. However, we
can't get this information if we can't access the appropriate mm_struct.If current->mm is NULL, we just clear the cache in the knowledge that the TLB
miss handlers will load it.Signed-off-by: David Howells
Signed-off-by: Linus Torvalds
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
31 Mar, 2008
1 commit
-
Signed-off-by: Al Viro
Acked-by: Harvey Harrison
Signed-off-by: Linus Torvalds