04 Dec, 2011

2 commits


04 Nov, 2011

1 commit

  • The kernel code was using some headers that included a mix
    of hardware-specific information (typically found in Tilera
    headers) and structures, enums, and function declarations supporting
    the disassembly function of the tile-desc.c sources.

    This change refactors that code so that a hardware-specific, but
    OS- and application-agnostic header, is created: .
    This header is then exported to userspace along with the other
    headers and can be used to build userspace code; in particular,
    it is used by glibc as part of implementing the backtrace() function.

    The new header, together with a header that specifically describes
    the disassembly code ( with _32 and _64 variants),
    replaces the old and
    headers.

    As part of this change, we are also renaming the 32-bit constants
    from TILE_xxx to TILEPRO_xxx to better reflect the fact that they
    are specific to the TILEPro architecture, and not to TILE-Gx
    and any successor "tile" architecture chips.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     

13 Oct, 2011

1 commit


03 Aug, 2011

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
    arch/tile/mm/init.c: trivial: use BUG_ON
    arch/tile: remove useless set_fixmap_nocache() macro
    arch/tile: add hypervisor-based character driver for SPI flash ROM
    ioctl-number.txt: add the tile hardwall ioctl range
    tile: use generic-y format for one-line asm-generic headers
    clocksource: tile: convert to use clocksource_register_hz

    Linus Torvalds
     

30 Jul, 2011

1 commit

  • * 'linux-next' of git://git.kernel.org/pub/scm/linux/kernel/git/jbarnes/pci-2.6:
    PCI: remove printks about disabled bridge windows
    PCI: fold pci_calc_resource_flags() into decode_bar()
    PCI: treat mem BAR type "11" (reserved) as 32-bit, not 64-bit, BAR
    PCI: correct pcie_set_readrq write size
    PCI: pciehp: change wait time for valid configuration access
    x86/PCI: Preserve existing pci=bfsort whitelist for Dell systems
    PCI: ARI is a PCIe v2 feature
    x86/PCI: quirks: Use pci_dev->revision
    PCI: Make the struct pci_dev * argument of pci_fixup_irqs const.
    PCI hotplug: cpqphp: use pci_dev->vendor
    PCI hotplug: cpqphp: use pci_dev->subsystem_{vendor|device}
    x86/PCI: config space accessor functions should not ignore the segment argument
    PCI: Assign values to 'pci_obff_signal_type' enumeration constants
    x86/PCI: reduce severity of host bridge window conflict warnings
    PCI: enumerate the PCI device only removed out PCI hieratchy of OS when re-scanning PCI
    PCI: PCIe AER: add aer_recover_queue
    x86/PCI: select direct access mode for mmconfig option
    PCI hotplug: Rename is_ejectable which also exists in dock.c

    Linus Torvalds
     

27 Jul, 2011

1 commit

  • This allows us to move duplicated code in
    (atomic_inc_not_zero() for now) to

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

    Arun Sharma
     

26 Jul, 2011

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (43 commits)
    fs: Merge split strings
    treewide: fix potentially dangerous trailing ';' in #defined values/expressions
    uwb: Fix misspelling of neighbourhood in comment
    net, netfilter: Remove redundant goto in ebt_ulog_packet
    trivial: don't touch files that are removed in the staging tree
    lib/vsprintf: replace link to Draft by final RFC number
    doc: Kconfig: `to be' -> `be'
    doc: Kconfig: Typo: square -> squared
    doc: Konfig: Documentation/power/{pm => apm-acpi}.txt
    drivers/net: static should be at beginning of declaration
    drivers/media: static should be at beginning of declaration
    drivers/i2c: static should be at beginning of declaration
    XTENSA: static should be at beginning of declaration
    SH: static should be at beginning of declaration
    MIPS: static should be at beginning of declaration
    ARM: static should be at beginning of declaration
    rcu: treewide: Do not use rcu_read_lock_held when calling rcu_dereference_check
    Update my e-mail address
    PCIe ASPM: forcedly -> forcibly
    gma500: push through device driver tree
    ...

    Fix up trivial conflicts:
    - arch/arm/mach-ep93xx/dma-m2p.c (deleted)
    - drivers/gpio/gpio-ep93xx.c (renamed and context nearby)
    - drivers/net/r8169.c (just context changes)

    Linus Torvalds
     

24 Jul, 2011

1 commit

  • This patch removes all the module loader hook implementations in the
    architecture specific code where the functionality is the same as that
    now provided by the recently added default hooks.

    Signed-off-by: Jonas Bonn
    Acked-by: Mike Frysinger
    Acked-by: Geert Uytterhoeven
    Tested-by: Michal Simek
    Signed-off-by: Rusty Russell

    Jonas Bonn
     

22 Jul, 2011

1 commit

  • Aside of the usual motivation for constification, this function has a
    history of being abused a hook for interrupt and other fixups so I turned
    this function const ages ago in the MIPS code but it should be done
    treewide.

    Due to function pointer passing in varous places a few other functions
    had to be constified as well.

    Signed-off-by: Ralf Baechle
    To: Anton Vorontsov
    To: Chris Metcalf
    To: Colin Cross
    Acked-by: "David S. Miller"
    To: Eric Miao
    To: Erik Gilling
    Acked-by: Guan Xuetao
    To: "H. Peter Anvin"
    To: Imre Kaloz
    To: Ingo Molnar
    To: Ivan Kokshaysky
    To: Jesse Barnes
    To: Krzysztof Halasa
    To: Lennert Buytenhek
    To: Matt Turner
    To: Nicolas Pitre
    To: Olof Johansson
    Acked-by: Paul Mundt
    To: Richard Henderson
    To: Russell King
    To: Thomas Gleixner
    Cc: Andrew Morton
    Cc: linux-alpha@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-kernel@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: linux-pci@vger.kernel.org
    Cc: linux-sh@vger.kernel.org
    Cc: linux-tegra@vger.kernel.org
    Cc: sparclinux@vger.kernel.org
    Cc: x86@kernel.org
    Signed-off-by: Jesse Barnes

    Ralf Baechle
     

10 Jun, 2011

1 commit


04 Jun, 2011

1 commit


30 May, 2011

1 commit


27 May, 2011

1 commit

  • This change introduces a few of the less controversial /proc and
    /proc/sys interfaces for tile, along with sysfs attributes for
    various things that were originally proposed as /proc/tile files.
    It also adjusts the "hardwall" proc API.

    Arnd Bergmann reviewed the initial arch/tile submission, which
    included a complete set of all the /proc/tile and /proc/sys/tile
    knobs that we had added in a somewhat ad hoc way during initial
    development, and provided feedback on where most of them should go.

    One knob turned out to be similar enough to the existing
    /proc/sys/debug/exception-trace that it was re-implemented to use
    that model instead.

    Another knob was /proc/tile/grid, which reported the "grid" dimensions
    of a tile chip (e.g. 8x8 processors = 64-core chip). Arnd suggested
    looking at sysfs for that, so this change moves that information
    to a pair of sysfs attributes (chip_width and chip_height) in the
    /sys/devices/system/cpu directory. We also put the "chip_serial"
    and "chip_revision" information from our old /proc/tile/board file
    as attributes in /sys/devices/system/cpu.

    Other information collected via hypervisor APIs is now placed in
    /sys/hypervisor. We create a /sys/hypervisor/type file (holding the
    constant string "tilera") to be parallel with the Xen use of
    /sys/hypervisor/type holding "xen". We create three top-level files,
    "version" (the hypervisor's own version), "config_version" (the
    version of the configuration file), and "hvconfig" (the contents of
    the configuration file). The remaining information from our old
    /proc/tile/board and /proc/tile/switch files becomes an attribute
    group appearing under /sys/hypervisor/board/.

    Finally, after some feedback from Arnd Bergmann for the previous
    version of this patch, the /proc/tile/hardwall file is split up into
    two conceptual parts. First, a directory /proc/tile/hardwall/ which
    contains one file per active hardwall, each file named after the
    hardwall's ID and holding a cpulist that says which cpus are enclosed by
    the hardwall. Second, a /proc/PID file "hardwall" that is either
    empty (for non-hardwall-using processes) or contains the hardwall ID.

    Finally, this change pushes the /proc/sys/tile/unaligned_fixup/
    directory, with knobs controlling the kernel code for handling the
    fixup of unaligned exceptions.

    Reviewed-by: Arnd Bergmann
    Signed-off-by: Chris Metcalf

    Chris Metcalf
     

26 May, 2011

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile: (26 commits)
    arch/tile: prefer "tilepro" as the name of the 32-bit architecture
    compat: include aio_abi.h for aio_context_t
    arch/tile: cleanups for tilegx compat mode
    arch/tile: allocate PCI IRQs later in boot
    arch/tile: support signal "exception-trace" hook
    arch/tile: use better definitions of xchg() and cmpxchg()
    include/linux/compat.h: coding-style fixes
    tile: add an RTC driver for the Tilera hypervisor
    arch/tile: finish enabling support for TILE-Gx 64-bit chip
    compat: fixes to allow working with tile arch
    arch/tile: update defconfig file to something more useful
    tile: do_hardwall_trap: do not play with task->sighand
    tile: replace mm->cpu_vm_mask with mm_cpumask()
    tile,mn10300: add device parameter to dma_cache_sync()
    audit: support the "standard"
    arch/tile: clarify flush_buffer()/finv_buffer() function names
    arch/tile: kernel-related cleanups from removing static page size
    arch/tile: various header improvements for building drivers
    arch/tile: disable GX prefetcher during cache flush
    arch/tile: tolerate disabling CONFIG_BLK_DEV_INITRD
    ...

    Linus Torvalds
     

25 May, 2011

1 commit


20 May, 2011

3 commits

  • These changes make the syscall table line up correctly for
    tilegx compat mode, and remove the stale sys32_fadvise64() function,
    which isn't actually used by any syscall table.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • This change became required due to some recent reworking in the
    platform-independent IRQ code. It is required for 2.6.38 and later.

    Cc: stable@kernel.org
    Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • This change adds support for /proc/sys/debug/exception-trace to tile.
    Like x86 and sparc, by default it is set to "1", generating a one-line
    printk whenever a user process crashes. By setting it to "2", we get
    a much more complete userspace diagnostic at crash time, including
    a user-space backtrace, register dump, and memory dump around the
    address of the crash.

    Some vestiges of the Tilera-internal version of this support are
    removed with this patch (the show_crashinfo variable and the
    arch_coredump_signal function). We retain a "crashinfo" boot parameter
    which allows you to set the boot-time value of exception-trace.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     

13 May, 2011

2 commits

  • This support was partially present in the existing code (look for
    "__tilegx__" ifdefs) but with this change you can build a working
    kernel using the TILE-Gx toolchain and ARCH=tilegx.

    Most of these files are new, generally adding a foo_64.c file
    where previously there was just a foo_32.c file.

    The ARCH=tilegx directive redirects to arch/tile, not arch/tilegx,
    using the existing SRCARCH mechanism in the top-level Makefile.

    Changes to existing files:

    - and changed to factor the
    include of in the common header.

    - and arch/tile/kernel/compat.c changed to remove
    the "const" markers I had put on compat_sys_execve() when trying
    to match some recent similar changes to the non-compat execve.
    It turns out the compat version wasn't "upgraded" to use const.

    - and were
    previously included accidentally, with the 32-bit contents. Now
    they have the proper 64-bit contents.

    Finally, I had to hack the existing hacky drivers/input/input-compat.h
    to add yet another "#ifdef" for INPUT_COMPAT_TEST (same as x86_64).

    Signed-off-by: Chris Metcalf
    Acked-by: Dmitry Torokhov [drivers/input]

    Chris Metcalf
     
  • The existing mechanism doesn't really provide
    enough to create the 64-bit "compat" ABI properly in a generic way,
    since the compat ABI is a mix of things were you can re-use the 64-bit
    versions of syscalls and things where you need a compat wrapper.

    To provide this in the most direct way possible, I added two new macros
    to go along with the existing __SYSCALL and __SC_3264 macros: __SC_COMP
    and SC_COMP_3264. These macros take an additional argument, typically a
    "compat_sys_xxx" function, which is passed to __SYSCALL if you define
    __SYSCALL_COMPAT when including the header, resulting in a pointer to
    the compat function being placed in the generated syscall table.

    The change also adds some missing definitions to so that
    it actually has declarations for all the compat syscalls, since the
    "[nr] = ##call" approach requires proper C declarations for all the
    functions included in the syscall table.

    Finally, compat.c defines compat_sys_sigpending() and
    compat_sys_sigprocmask() even if the underlying architecture doesn't
    request it, which tries to pull in undefined compat_old_sigset_t defines.
    We need to guard those compat syscall definitions with appropriate
    __ARCH_WANT_SYS_xxx ifdefs.

    Acked-by: Arnd Bergmann
    Signed-off-by: Chris Metcalf

    Chris Metcalf
     

05 May, 2011

8 commits

  • 1. do_hardwall_trap() checks ->sighand != NULL and then takes ->siglock.

    This is unsafe even if the task can't run (I assume it is pinned to
    the same CPU), its parent can reap the task and set ->sighand = NULL
    right after this check. Even if the compiler dosn't read ->sighand
    twice and this memory can't to away __group_send_sig_info() is wrong
    after that. Use do_send_sig_info().

    2. Send SIGILL to the thread, not to the whole process. Unless it has
    the handler or blocked this kills the whole thread-group as before.
    IIUC, different threads can be bound to different rect's.

    3. Check PF_EXITING instead of ->sighand. A zombie thread can go away
    but its ->sighand can be !NULL.

    Reported-by: Matt Fleming
    Signed-off-by: Oleg Nesterov
    Signed-off-by: Chris Metcalf

    Oleg Nesterov
     
  • We plan to change mm->cpu_vm_mask definition later. Thus, this patch convert
    it into proper macro.

    Signed-off-by: KOSAKI Motohiro
    Signed-off-by: Chris Metcalf

    KOSAKI Motohiro
     
  • Since v2.6.20 "Pass struct dev pointer to dma_cache_sync()"
    (d3fa72e4556ec1f04e46a0d561d9e785ecaa173d), dma_cache_sync() takes a
    struct dev pointer, but these appear to be missing from the tile and
    mn10300 implementations, so add them.

    Signed-off-by: James Hogan
    [cmetcalf@tilera.com: took only the "tile" portion as I don't maintain mn10300]
    Signed-off-by: Chris Metcalf

    James Hogan
     
  • This change adds a number of missing headers in asm (fb.h, parport.h,
    serial.h, and vga.h) using the minimal generic versions.

    It also adds a number of missing interfaces that showed up as build
    failures when trying to build various drivers not normally included in the
    "tile" distribution: ioremap_wc(), memset_io(), io{read,write}{16,32}be(),
    virt_to_bus(), bus_to_virt(), irq_canonicalize(), __pte(), __pgd(),
    and __pmd(). I also added a cast in virt_to_page() since not all callers
    pass a pointer.

    I fixed to properly include a __KERNEL__ guard for the
    __ARCH_WANT_STAT64 symbol, and to use __builtin_bswap32()
    even for our 64-bit architecture, since the same code is produced.

    I added an export for get_cycles(), since it's used in some modules.

    And I made properly include the __KERNEL__ guard,
    even though it's not yet exported, since it likely will be soon.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • The code accidentally was relying on this configuration option
    being selected.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • Otherwise, in principle, there could be stale I$ data present
    next time the page that previously held the kernel module code was
    used to run some new code.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • This semantic was already true for atomic operations within the kernel,
    and this change makes it true for the fast atomic syscalls (__NR_cmpxchg
    and __NR_atomic_update) as well. Previously, user-space had to use
    the fast atomic syscalls exclusively to update memory, since raw stores
    could lose a race with the atomic update code even when the atomic update
    hadn't actually modified the value.

    With this change, we no longer write back the value to memory if it
    hasn't changed. This allows certain types of idioms in user space to
    work as expected, e.g. "atomic exchange" to acquire a spinlock, followed
    by a raw store of zero to release the lock.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • Note that this is not complete hot-plug support; hot-unplug is not included.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     

03 May, 2011

2 commits

  • This support is required for CONFIG_KEYS, NFSv4 kernel DNS, etc.
    The change is slightly more complex than the minimal thing, since
    I took advantage of having to go into the assembly code to just
    move a bunch of stuff into C code: specifically, the schedule(),
    do_async_page_fault(), do_signal(), and single_step_once() support,
    in addition to the TIF_NOTIFY_RESUME support.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     
  • This change is the result of some work to make the backtrace code more
    shareable between kernel, libc, and gdb.

    For the kernel, some good effects are to eliminate the hacky
    "VirtualAddress" typedef in favor of "unsigned long", to eliminate a
    bunch of spurious kernel doc comments, to remove the dead "bt_read_memory"
    function, and to use "__tilegx__" in #ifdefs instead of "TILE_CHIP".

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     

14 Apr, 2011

1 commit

  • For future rework of try_to_wake_up() we'd like to push part of that
    function onto the CPU the task is actually going to run on.

    In order to do so we need a generic callback from the existing scheduler IPI.

    This patch introduces such a generic callback: scheduler_ipi() and
    implements it as a NOP.

    BenH notes: PowerPC might use this IPI on offline CPUs under rare conditions!

    Acked-by: Russell King
    Acked-by: Martin Schwidefsky
    Acked-by: Chris Metcalf
    Acked-by: Jesper Nilsson
    Acked-by: Benjamin Herrenschmidt
    Signed-off-by: Ralf Baechle
    Reviewed-by: Frank Rowand
    Cc: Mike Galbraith
    Cc: Nick Piggin
    Cc: Linus Torvalds
    Cc: Andrew Morton
    Signed-off-by: Ingo Molnar
    Signed-off-by: Peter Zijlstra
    Link: http://lkml.kernel.org/r/20110405152728.744338123@chello.nl

    Peter Zijlstra
     

31 Mar, 2011

1 commit


26 Mar, 2011

2 commits


25 Mar, 2011

1 commit

  • Percpu allocator honors alignment request upto PAGE_SIZE and both the
    percpu addresses in the percpu address space and the translated kernel
    addresses should be aligned accordingly. The calculation of the
    former depends on the alignment of percpu output section in the kernel
    image.

    The linker script macros PERCPU_VADDR() and PERCPU() are used to
    define this output section and the latter takes @align parameter.
    Several architectures are using @align smaller than PAGE_SIZE breaking
    percpu memory alignment.

    This patch removes @align parameter from PERCPU(), renames it to
    PERCPU_SECTION() and makes it always align to PAGE_SIZE. While at it,
    add PCPU_SETUP_BUG_ON() checks such that alignment problems are
    reliably detected and remove percpu alignment comment recently added
    in workqueue.c as the condition would trigger BUG way before reaching
    there.

    For um, this patch raises the alignment of percpu area. As the area
    is in .init, there shouldn't be any noticeable difference.

    This problem was discovered by David Howells while debugging boot
    failure on mn10300.

    Signed-off-by: Tejun Heo
    Acked-by: Mike Frysinger
    Cc: uclinux-dist-devel@blackfin.uclinux.org
    Cc: David Howells
    Cc: Jeff Dike
    Cc: user-mode-linux-devel@lists.sourceforge.net

    Tejun Heo
     

23 Mar, 2011

1 commit

  • Add a node parameter to alloc_thread_info(), and change its name to
    alloc_thread_info_node()

    This change is needed to allow NUMA aware kthread_create_on_cpu()

    Signed-off-by: Eric Dumazet
    Acked-by: David S. Miller
    Reviewed-by: Andi Kleen
    Acked-by: Rusty Russell
    Cc: Tejun Heo
    Cc: Tony Luck
    Cc: Fenghua Yu
    Cc: David Howells
    Cc:
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Eric Dumazet
     

18 Mar, 2011

2 commits

  • * git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile: (27 commits)
    arch/tile: support newer binutils assembler shift semantics
    arch/tile: fix deadlock bugs in rwlock implementation
    drivers/edac: provide support for tile architecture
    tile on-chip network driver: sync up with latest fixes
    arch/tile: support 4KB page size as well as 64KB
    arch/tile: add some more VMSPLIT options and use consistent naming
    arch/tile: fix some comments and whitespace
    arch/tile: export some additional module symbols
    arch/tile: enhance existing finv_buffer_remote() routine
    arch/tile: fix two bugs in the backtracer code
    arch/tile: use extended assembly to inline __mb_incoherent()
    arch/tile: use a cleaner technique to enable interrupt for cpu_idle()
    arch/tile: sync up with and changes
    arch/tile: fix reversed test of strict_strtol() return value
    arch/tile: avoid a simulator warning during bootup
    arch/tile: export to userspace
    arch/tile: warn and retry if an IPI is not accepted by the target cpu
    arch/tile: stop disabling INTCTRL_1 interrupts during hypervisor downcalls
    arch/tile: fix __ndelay etc to work better
    arch/tile: bug fix: exec'ed task thought it was still single-stepping
    ...

    Fix up trivial conflict in arch/tile/kernel/vmlinux.lds.S (percpu
    alignment vs section naming convention fix)

    Linus Torvalds
     
  • This change supports building the kernel with newer binutils where
    a shift of greater than the word size is no longer interpreted
    silently as modulo the word size, but instead generates a warning.

    Signed-off-by: Chris Metcalf

    Chris Metcalf
     

11 Mar, 2011

1 commit

  • The Tilera architecture traditionally supports 64KB page sizes
    to improve TLB utilization and improve performance when the
    hardware is being used primarily to run a single application.

    For more generic server scenarios, it can be beneficial to run
    with 4KB page sizes, so this commit allows that to be specified
    (by modifying the arch/tile/include/hv/pagesize.h header).

    As part of this change, we also re-worked the PTE management
    slightly so that PTE writes all go through a __set_pte() function
    where we can do some additional validation. The set_pte_order()
    function was eliminated since the "order" argument wasn't being used.

    One bug uncovered was in the PCI DMA code, which wasn't properly
    flushing the specified range. This was benign with 64KB pages,
    but with 4KB pages we were getting some larger flushes wrong.

    The per-cpu memory reservation code also needed updating to
    conform with the newer percpu stuff; before it always chose 64KB,
    and that was always correct, but with 4KB granularity we now have
    to pay closer attention and reserve the amount of memory that will
    be requested when the percpu code starts allocating.

    Signed-off-by: Chris Metcalf

    Chris Metcalf