15 Jan, 2009

1 commit


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

    David Howells
     

07 Jan, 2009

2 commits


03 Jan, 2009

1 commit


18 Oct, 2008

1 commit


17 Oct, 2008

1 commit


16 Oct, 2008

1 commit


21 Aug, 2008

1 commit


02 Aug, 2008

1 commit


27 Jul, 2008

2 commits

  • long overdue...

    Signed-off-by: Al Viro

    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

    FUJITA Tomonori
     

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'.

    Linus Torvalds
     
  • 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

    Adrian Bunk
     
  • 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 headers

    Not changed by this patch is the fact that the following architectures
    have a different struct pt_regs depending on CONFIG_ variables:
    - h8300
    - m68knommu
    - mips

    This 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

    Adrian Bunk
     
  • 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

    FUJITA Tomonori
     

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
    ...

    Linus Torvalds
     
  • * 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

    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

    Linus Torvalds
     
  • 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

    Andrea Righi
     

24 Jul, 2008

1 commit


21 Jul, 2008

1 commit


13 Jul, 2008

1 commit


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

    David Howells
     

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

    David Howells
     

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

    David Howells
     

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

    Nick Piggin
     

03 May, 2008

1 commit


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

    David Howells
     

29 Apr, 2008

1 commit

  • Unaligned access is ok for the following arches:
    cris, m68k, mn10300, powerpc, s390, x86

    Arches that use the memmove implementation for native endian, and
    the byteshifting for the opposite endianness.
    h8300, m32r, xtensa

    Packed struct for native endian, byteshifting for other endian:
    alpha, blackfin, ia64, parisc, sparc, sparc64, mips, sh

    m86knommu 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

    Harvey Harrison
     

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

    Nick Piggin
     

22 Apr, 2008

1 commit


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 = &_##v

    For 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 Anvin

    Signed-off-by: Mike Travis
    Signed-off-by: Ingo Molnar

    Mike Travis
     

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

    Matthew Wilcox
     

11 Apr, 2008

4 commits


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 by

    commit fb56dbb31c4738a3918db81fd24da732ce3b4ae6
    Author: Avi Kivity
    Date: Sun Dec 2 10:50:06 2007 +0200

    KVM: 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

    Christian Borntraeger
     

31 Mar, 2008

1 commit