09 Feb, 2008

2 commits

  • Background: I've implemented 1K/2K page tables for s390. These sub-page
    page tables are required to properly support the s390 virtualization
    instruction with KVM. The SIE instruction requires that the page tables
    have 256 page table entries (pte) followed by 256 page status table entries
    (pgste). The pgstes are only required if the process is using the SIE
    instruction. The pgstes are updated by the hardware and by the hypervisor
    for a number of reasons, one of them is dirty and reference bit tracking.
    To avoid wasting memory the standard pte table allocation should return
    1K/2K (31/64 bit) and 2K/4K if the process is using SIE.

    Problem: Page size on s390 is 4K, page table size is 1K or 2K. That means
    the s390 version for pte_alloc_one cannot return a pointer to a struct
    page. Trouble is that with the CONFIG_HIGHPTE feature on x86 pte_alloc_one
    cannot return a pointer to a pte either, since that would require more than
    32 bit for the return value of pte_alloc_one (and the pte * would not be
    accessible since its not kmapped).

    Solution: The only solution I found to this dilemma is a new typedef: a
    pgtable_t. For s390 pgtable_t will be a (pte *) - to be introduced with a
    later patch. For everybody else it will be a (struct page *). The
    additional problem with the initialization of the ptl lock and the
    NR_PAGETABLE accounting is solved with a constructor pgtable_page_ctor and
    a destructor pgtable_page_dtor. The page table allocation and free
    functions need to call these two whenever a page table page is allocated or
    freed. pmd_populate will get a pgtable_t instead of a struct page pointer.
    To get the pgtable_t back from a pmd entry that has been installed with
    pmd_populate a new function pmd_pgtable is added. It replaces the pmd_page
    call in free_pte_range and apply_to_pte_range.

    Signed-off-by: Martin Schwidefsky
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Martin Schwidefsky
     
  • 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

    David Howells
     

08 Feb, 2008

2 commits

  • 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

    H. Peter Anvin
     
  • 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

    Kirill A. Shutemov
     

07 Feb, 2008

1 commit

  • The declaration and implementation of __const_udelay use different
    names for the parameter on a number of architectures:

    include/asm-avr32/delay.h:15:extern void __const_udelay(unsigned long usecs);
    arch/avr32/lib/delay.c:39:inline void __const_udelay(unsigned long xloops)

    include/asm-sh/delay.h:15:extern void __const_udelay(unsigned long usecs);
    arch/sh/lib/delay.c:22:inline void __const_udelay(unsigned long xloops)

    include/asm-m32r/delay.h:15:extern void __const_udelay(unsigned long usecs);
    arch/m32r/lib/delay.c:58:void __const_udelay(unsigned long xloops)

    include/asm-x86/delay.h:16:extern void __const_udelay(unsigned long usecs);
    arch/x86/lib/delay_32.c:82:inline void __const_udelay(unsigned long xloops)
    arch/x86/lib/delay_64.c:46:inline void __const_udelay(unsigned long xloops)

    The units of the parameter isn't usecs, so that name is definitely
    wrong. It's also not exactly loops, so I suppose xloops is an OK
    name.

    This patch changes these names from usecs to xloops.

    Signed-off-by: Jeff Dike
    Cc: Haavard Skinnemoen
    Cc: Paul Mundt
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: Hirokazu Takata
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Jeff Dike
     

06 Feb, 2008

2 commits

  • Cc: David Howells
    Cc: Hirokazu Takata
    Cc: Paul Mundt
    Cc: Kazumoto Kojima
    Cc: Richard Curnow
    Cc: Davide Libenzi
    Cc: Michael Kerrisk
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andrew Morton
     
  • (with Martin Schwidefsky )

    The pgd/pud/pmd/pte page table allocation functions get a mm_struct pointer as
    first argument. The free functions do not get the mm_struct argument. This
    is 1) asymmetrical and 2) to do mm related page table allocations the mm
    argument is needed on the free function as well.

    [kamalesh@linux.vnet.ibm.com: i386 fix]
    [akpm@linux-foundation.org: coding-syle fixes]
    Signed-off-by: Benjamin Herrenschmidt
    Signed-off-by: Martin Schwidefsky
    Cc:
    Signed-off-by: Kamalesh Babulal
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Benjamin Herrenschmidt
     

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

    Laszlo Attila Toth
     

29 Jan, 2008

1 commit


28 Jan, 2008

31 commits