1. 01 Aug, 2008 1 commit
    • Tony Luck's avatar
      [IA64] Move include/asm-ia64 to arch/ia64/include/asm · 7f30491c
      Tony Luck authored
      
      
      After moving the the include files there were a few clean-ups:
      
      1) Some files used #include <asm-ia64/xyz.h>, changed to <asm/xyz.h>
      
      2) Some comments alerted maintainers to look at various header files to
      make matching updates if certain code were to be changed. Updated these
      comments to use the new include paths.
      
      3) Some header files mentioned their own names in initial comments. Just
      deleted these self references.
      Signed-off-by: default avatarTony Luck <tony.luck@intel.com>
      7f30491c
  2. 30 Jul, 2008 10 commits
  3. 29 Jul, 2008 2 commits
  4. 28 Jul, 2008 27 commits
    • Rusty Russell's avatar
      lguest: set max_pfn_mapped, growl loudly at Yinghai Lu · 5d006d8d
      Rusty Russell authored
      6af61a76
      
       'x86: clean up max_pfn_mapped
      usage - 32-bit' makes the following comment:
      
          XEN PV and lguest may need to assign max_pfn_mapped too.
      
      But no CC.  Yinghai, wasting fellow developers' time is a VERY bad
      habit.  If you do it again, I will hunt you down and try to extract
      the three hours of my life I just lost :)
      Signed-off-by: default avatarRusty Russell <rusty@rustcorp.com.au>
      Cc: Yinghai Lu <yhlu.kernel@gmail.com>
      5d006d8d
    • Andrea Arcangeli's avatar
      mmu-notifiers: core · cddb8a5c
      Andrea Arcangeli authored
      
      
      With KVM/GFP/XPMEM there isn't just the primary CPU MMU pointing to pages.
       There are secondary MMUs (with secondary sptes and secondary tlbs) too.
      sptes in the kvm case are shadow pagetables, but when I say spte in
      mmu-notifier context, I mean "secondary pte".  In GRU case there's no
      actual secondary pte and there's only a secondary tlb because the GRU
      secondary MMU has no knowledge about sptes and every secondary tlb miss
      event in the MMU always generates a page fault that has to be resolved by
      the CPU (this is not the case of KVM where the a secondary tlb miss will
      walk sptes in hardware and it will refill the secondary tlb transparently
      to software if the corresponding spte is present).  The same way
      zap_page_range has to invalidate the pte before freeing the page, the spte
      (and secondary tlb) must also be invalidated before any page is freed and
      reused.
      
      Currently we take a page_count pin on every page mapped by sptes, but that
      means the pages can't be swapped whenever they're mapped by any spte
      because they're part of the guest working set.  Furthermore a spte unmap
      event can immediately lead to a page to be freed when the pin is released
      (so requiring the same complex and relatively slow tlb_gather smp safe
      logic we have in zap_page_range and that can be avoided completely if the
      spte unmap event doesn't require an unpin of the page previously mapped in
      the secondary MMU).
      
      The mmu notifiers allow kvm/GRU/XPMEM to attach to the tsk->mm and know
      when the VM is swapping or freeing or doing anything on the primary MMU so
      that the secondary MMU code can drop sptes before the pages are freed,
      avoiding all page pinning and allowing 100% reliable swapping of guest
      physical address space.  Furthermore it avoids the code that teardown the
      mappings of the secondary MMU, to implement a logic like tlb_gather in
      zap_page_range that would require many IPI to flush other cpu tlbs, for
      each fixed number of spte unmapped.
      
      To make an example: if what happens on the primary MMU is a protection
      downgrade (from writeable to wrprotect) the secondary MMU mappings will be
      invalidated, and the next secondary-mmu-page-fault will call
      get_user_pages and trigger a do_wp_page through get_user_pages if it
      called get_user_pages with write=1, and it'll re-establishing an updated
      spte or secondary-tlb-mapping on the copied page.  Or it will setup a
      readonly spte or readonly tlb mapping if it's a guest-read, if it calls
      get_user_pages with write=0.  This is just an example.
      
      This allows to map any page pointed by any pte (and in turn visible in the
      primary CPU MMU), into a secondary MMU (be it a pure tlb like GRU, or an
      full MMU with both sptes and secondary-tlb like the shadow-pagetable layer
      with kvm), or a remote DMA in software like XPMEM (hence needing of
      schedule in XPMEM code to send the invalidate to the remote node, while no
      need to schedule in kvm/gru as it's an immediate event like invalidating
      primary-mmu pte).
      
      At least for KVM without this patch it's impossible to swap guests
      reliably.  And having this feature and removing the page pin allows
      several other optimizations that simplify life considerably.
      
      Dependencies:
      
      1) mm_take_all_locks() to register the mmu notifier when the whole VM
         isn't doing anything with "mm".  This allows mmu notifier users to keep
         track if the VM is in the middle of the invalidate_range_begin/end
         critical section with an atomic counter incraese in range_begin and
         decreased in range_end.  No secondary MMU page fault is allowed to map
         any spte or secondary tlb reference, while the VM is in the middle of
         range_begin/end as any page returned by get_user_pages in that critical
         section could later immediately be freed without any further
         ->invalidate_page notification (invalidate_range_begin/end works on
         ranges and ->invalidate_page isn't called immediately before freeing
         the page).  To stop all page freeing and pagetable overwrites the
         mmap_sem must be taken in write mode and all other anon_vma/i_mmap
         locks must be taken too.
      
      2) It'd be a waste to add branches in the VM if nobody could possibly
         run KVM/GRU/XPMEM on the kernel, so mmu notifiers will only enabled if
         CONFIG_KVM=m/y.  In the current kernel kvm won't yet take advantage of
         mmu notifiers, but this already allows to compile a KVM external module
         against a kernel with mmu notifiers enabled and from the next pull from
         kvm.git we'll start using them.  And GRU/XPMEM will also be able to
         continue the development by enabling KVM=m in their config, until they
         submit all GRU/XPMEM GPLv2 code to the mainline kernel.  Then they can
         also enable MMU_NOTIFIERS in the same way KVM does it (even if KVM=n).
         This guarantees nobody selects MMU_NOTIFIER=y if KVM and GRU and XPMEM
         are all =n.
      
      The mmu_notifier_register call can fail because mm_take_all_locks may be
      interrupted by a signal and return -EINTR.  Because mmu_notifier_reigster
      is used when a driver startup, a failure can be gracefully handled.  Here
      an example of the change applied to kvm to register the mmu notifiers.
      Usually when a driver startups other allocations are required anyway and
      -ENOMEM failure paths exists already.
      
       struct  kvm *kvm_arch_create_vm(void)
       {
              struct kvm *kvm = kzalloc(sizeof(struct kvm), GFP_KERNEL);
      +       int err;
      
              if (!kvm)
                      return ERR_PTR(-ENOMEM);
      
              INIT_LIST_HEAD(&kvm->arch.active_mmu_pages);
      
      +       kvm->arch.mmu_notifier.ops = &kvm_mmu_notifier_ops;
      +       err = mmu_notifier_register(&kvm->arch.mmu_notifier, current->mm);
      +       if (err) {
      +               kfree(kvm);
      +               return ERR_PTR(err);
      +       }
      +
              return kvm;
       }
      
      mmu_notifier_unregister returns void and it's reliable.
      
      The patch also adds a few needed but missing includes that would prevent
      kernel to compile after these changes on non-x86 archs (x86 didn't need
      them by luck).
      
      [akpm@linux-foundation.org: coding-style fixes]
      [akpm@linux-foundation.org: fix mm/filemap_xip.c build]
      [akpm@linux-foundation.org: fix mm/mmu_notifier.c build]
      Signed-off-by: default avatarAndrea Arcangeli <andrea@qumranet.com>
      Signed-off-by: default avatarNick Piggin <npiggin@suse.de>
      Signed-off-by: default avatarChristoph Lameter <cl@linux-foundation.org>
      Cc: Jack Steiner <steiner@sgi.com>
      Cc: Robin Holt <holt@sgi.com>
      Cc: Nick Piggin <npiggin@suse.de>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Kanoj Sarcar <kanojsarcar@yahoo.com>
      Cc: Roland Dreier <rdreier@cisco.com>
      Cc: Steve Wise <swise@opengridcomputing.com>
      Cc: Avi Kivity <avi@qumranet.com>
      Cc: Hugh Dickins <hugh@veritas.com>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Anthony Liguori <aliguori@us.ibm.com>
      Cc: Chris Wright <chrisw@redhat.com>
      Cc: Marcelo Tosatti <marcelo@kvack.org>
      Cc: Eric Dumazet <dada1@cosmosbay.com>
      Cc: "Paul E. McKenney" <paulmck@us.ibm.com>
      Cc: Izik Eidus <izike@qumranet.com>
      Cc: Anthony Liguori <aliguori@us.ibm.com>
      Cc: Rik van Riel <riel@redhat.com>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      cddb8a5c
    • David Brownell's avatar
      arm: fix HAVE_CLK merge goof · 93686ae8
      David Brownell authored
      
      
      This fixes a merge goof whereby ARCH_EP93XX got the "select HAVE_CLK" line
      which belongs instead with ARCH_AT91.
      Signed-off-by: default avatarDavid Brownell <dbrownell@users.sourceforge.net>
      Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      93686ae8
    • Bjorn Helgaas's avatar
      x86/PCI: use dev_printk when possible · 12c0b20f
      Bjorn Helgaas authored
      
      
      Convert printks to use dev_printk().
      
      I converted DBG() to dev_dbg().  This DBG() is from arch/x86/pci/pci.h and
      requires source-code modification to enable, so dev_dbg() seems roughly
      equivalent.
      Signed-off-by: default avatarBjorn Helgaas <bjorn.helgaas@hp.com>
      Signed-off-by: default avatarJesse Barnes <jbarnes@virtuousgeek.org>
      12c0b20f
    • Linus Torvalds's avatar
      cpu masks: optimize and clean up cpumask_of_cpu() · e56b3bc7
      Linus Torvalds authored
      Clean up and optimize cpumask_of_cpu(), by sharing all the zero words.
      
      Instead of stupidly generating all possible i=0...NR_CPUS 2^i patterns
      creating a huge array of constant bitmasks, realize that the zero words
      can be shared.
      
      In other words, on a 64-bit architecture, we only ever need 64 of these
      arrays - with a different bit set in one single world (with enough zero
      words around it so that we can create any bitmask by just offsetting in
      that big array). And then we just put enough zeroes around it that we
      can point every single cpumask to be one of those things.
      
      So when we have 4k CPU's, instead of having 4k arrays (of 4k bits each,
      with one bit set in each array - 2MB memory total), we have exactly 64
      arrays instead, each 8k bits in size (64kB total).
      
      And then we just point cpumask(n) to the right position (which we can
      calculate dynamically). Once we have the right arrays, getting
      "cpumask(n)" ends up being:
      
        static inline const cpumask_t *get_cpu_mask(unsigned int cpu)
        {
                const unsigned long *p = cpu_bit_bitmap[1 + cpu % BITS_PER_LONG];
                p -= cpu / BITS_PER_LONG;
                return (const cpumask_t *)p;
        }
      
      This brings other advantages and simplifications as well:
      
       - we are not wasting memory that is just filled with a single bit in
         various different places
      
       - we don't need all those games to re-create the arrays in some dense
         format, because they're already going to be dense enough.
      
      if we compile a kernel for up to 4k CPU's, "wasting" that 64kB of memory
      is a non-issue (especially since by doing this "overlapping" trick we
      probably get better cache behaviour anyway).
      
      [ mingo@elte.hu:
      
        Converted Linus's mails into a commit. See:
      
           http://lkml.org/lkml/2008/7/27/156
           http://lkml.org/lkml/2008/7/28/320
      
      
      
        Also applied a family filter - which also has the side-effect of leaving
        out the bits where Linus calls me an idio... Oh, never mind ;-)
      ]
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      Cc: Rusty Russell <rusty@rustcorp.com.au>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Al Viro <viro@ZenIV.linux.org.uk>
      Cc: Mike Travis <travis@sgi.com>
      Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
      e56b3bc7
    • Laurent Pinchart's avatar
      cpm2: Rework baud rate generators configuration to support external clocks. · dddb8d31
      Laurent Pinchart authored
      
      
      The CPM2 BRG setup functions cpm_setbrg and cpm2_fastbrg don't support
      external clocks. This patch adds a new exported __cpm2_setbrg function
      that takes the clock rate and clock source as extra parameters, and moves
      cpm_setbrg and cpm2_fastbrg to include/asm-powerpc/cpm2.h where they
      become inline wrappers around __cpm2_setbrg.
      Signed-off-by: default avatarLaurent Pinchart <laurentp@cse-semaphore.com>
      Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
      dddb8d31
    • Anton Vorontsov's avatar
      powerpc: rtc_cmos_setup: assign interrupts only if there is i8259 PIC · e517881e
      Anton Vorontsov authored
      
      
      i8259 PIC is disabled on MPC8610HPCD boards, thus currently rtc-cmos
      driver fails to probe.
      
      To fix the issue, we lookup the device tree for "chrp,iic" and
      "pnpPNP,000" compatible devices, and if not found we do not assign RTC
      IRQ and assuming that i8259 was disabled.
      
      Though this patch fixes RTC on some boards (and surely should not break
      any other), the whole approach is still broken. We can't easily fix this
      though, because old device trees do not specify i8259 interrupts for the
      cmos rtc node.
      Signed-off-by: default avatarAnton Vorontsov <avorontsov@ru.mvista.com>
      Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
      e517881e
    • Laurent Pinchart's avatar
      cpm_uart: Add generic clock API support to set baudrates · 80776554
      Laurent Pinchart authored
      
      
      This patch introduces baudrate setting support via the generic clock API.
      When present the optional device tree clock property is used instead of
      fsl-cpm-brg. Platforms can then define complex clock schemes, to output
      the serial clock on an external pin for instance.
      Signed-off-by: default avatarLaurent Pinchart <laurentp@cse-semaphore.com>
      Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
      80776554
    • Jochen Friedrich's avatar
      powerpc: implement GPIO LIB API on CPM1 Freescale SoC. · dc2380ec
      Jochen Friedrich authored
      
      
      This patch implement GPIO LIB support for the CPM1 GPIOs.
      Signed-off-by: default avatarJochen Friedrich <jochen@scram.de>
      Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
      dc2380ec
    • Laurent Pinchart's avatar
      cpm2: Implement GPIO LIB API on CPM2 Freescale SoC. · e193325e
      Laurent Pinchart authored
      
      
      This patch implement GPIO LIB support for the CPM2 GPIOs. The code can
      also be used for CPM1 GPIO port E, as both cores are compatible at the
      register level.
      
      Based on earlier work by Laurent Pinchart.
      Signed-off-by: default avatarJochen Friedrich <jochen@scram.de>
      Cc: Laurent Pinchart <laurentp@cse-semaphore.com>
      Signed-off-by: default avatarKumar Gala <galak@kernel.crashing.org>
      e193325e
    • Magnus Damm's avatar
      sh: SuperH Mobile CEU and camera platform data for AP325RXA · 8b2224dc
      Magnus Damm authored
      
      
      Add AP325RXA specific platform data for on-chip sh7723 CEU and ncm03j camera.
      Signed-off-by: default avatarMagnus Damm <damm@igel.co.jp>
      Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
      8b2224dc
    • Magnus Damm's avatar
      sh: Update smc911x platform data for AP325RXA · 4875ea22
      Magnus Damm authored
      
      
      Pass board specific smc911x parameters using struct smc911x_platdata.
      Signed-off-by: default avatarMagnus Damm <damm@igel.co.jp>
      Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
      4875ea22
    • Magnus Damm's avatar
      sh: SuperH Mobile LCDC platform data for AP325RXA · 6968980a
      Magnus Damm authored
      
      
      Add LCD panel platform data for the AP325RXA board.
      Signed-off-by: default avatarMagnus Damm <damm@igel.co.jp>
      Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
      6968980a
    • Magnus Damm's avatar
      sh: Add SuperH Mobile CEU platform data for Migo-R · 1765534c
      Magnus Damm authored
      
      
      Add Migo-R specific platform data for on-chip sh7722 CEU and ov772x camera.
      Signed-off-by: default avatarMagnus Damm <damm@igel.co.jp>
      Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
      1765534c
    • Magnus Damm's avatar
      sh: Add SuperH Mobile LCDC platform data for Migo-R · 8b1285f1
      Magnus Damm authored
      
      
      Add WVGA and QVGA LCD panel support to Migo-R.
      Signed-off-by: default avatarMagnus Damm <damm@igel.co.jp>
      Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
      8b1285f1
    • Paul Mundt's avatar
      sh: Wire up new syscalls. · 44f95989
      Paul Mundt authored
      
      
      This wires up the signalfd4, eventfd2, epoll_create1, dup3, pipe2, and
      inotify_init1 syscalls.
      Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
      44f95989
    • Yoshihiro Shimoda's avatar
      sh: fix uImage Entry Point · 82cb1f6f
      Yoshihiro Shimoda authored
      
      
      fix the problem that cannot boot using uImage when PAGE_SIZE is
      8kbyte or 64kbyte.
      Signed-off-by: default avatarYoshihiro Shimoda <shimoda.yoshihiro@renesas.com>
      Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
      82cb1f6f
    • Stuart MENEFY's avatar
      sh: Don't miss pending signals returning to user mode after signal processing · 0b1689cf
      Stuart MENEFY authored
      Without this patch, signals sent during architecture specific signal
      handling (typically as a result of the user's stack being inaccessible)
      are ignored.
      
      This is the SH version of commit c3ff8ec3
      
      
      which was for the i386.
      Signed-off-by: default avatarStuart Menefy <stuart.menefy@st.com>
      Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
      0b1689cf
    • Magnus Damm's avatar
      sh: Use clk_always_enable() on sh7366 · d7f1a9ad
      Magnus Damm authored
      
      
      Use clk_always_enable() in the sh7366 processor code.
      Signed-off-by: default avatarMagnus Damm <damm@igel.co.jp>
      Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
      d7f1a9ad
    • Magnus Damm's avatar
      sh: Use clk_always_enable() on sh7343 / SE77343 · 8fa509ab
      Magnus Damm authored
      
      
      Use clk_always_enable() on the sh7343 processor and in the board code
      for Solution Engine 7343. Remove duplicate MSTPCR register definitions.
      Signed-off-by: default avatarMagnus Damm <damm@igel.co.jp>
      Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
      8fa509ab
    • Magnus Damm's avatar
      sh: Use clk_always_enable() on sh7722 / Migo-R / SE7722 · 6c7d826c
      Magnus Damm authored
      
      
      Use clk_always_enable() on the sh7722 processor and in the board code
      for Migo-R and Solution Engine 7722. Remove duplicate MSTPCR register
      definitions.
      Signed-off-by: default avatarMagnus Damm <damm@igel.co.jp>
      Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
      6c7d826c
    • Magnus Damm's avatar
      sh: Use clk_always_enable() on sh7723 / ap325rxa · 9ca6ecac
      Magnus Damm authored
      
      
      Use clk_always_enable() on the sh7723 processor and in the ap325rxa
      board code. Remove duplicate MSTPCR register definitions.
      Signed-off-by: default avatarMagnus Damm <damm@igel.co.jp>
      Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
      9ca6ecac
    • Magnus Damm's avatar
      sh: Show all clocks and their state in /proc/clocks · 152fe36e
      Magnus Damm authored
      
      
      Show all clocks in /proc/clocks, and also show if they are enabled or
      disabled. This is useful to show MSTPCR bits on SuperH Mobile processors.
      Signed-off-by: default avatarMagnus Damm <damm@igel.co.jp>
      Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
      152fe36e
    • Magnus Damm's avatar
      sh: Merge sh7343 and sh7722 clock code · 1312994c
      Magnus Damm authored
      
      
      This code makes sh7343 share the sh7722 clock code. Instead of just using
      the good and very old sh7343 clock implmentation, switch to the new MSTPCR
      enabled clock code. SIU clocks are disabled on sh7343 for now.
      
      With this change all SuperH Mobile devices now use the same clock code.
      Signed-off-by: default avatarMagnus Damm <damm@igel.co.jp>
      Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
      1312994c
    • Magnus Damm's avatar
      sh: Add SuperH Mobile MSTPCR bits to clock framework · aea167cb
      Magnus Damm authored
      
      
      Handle module stop clock bits in MSTPCRn through the clock framework.
      The clocks are named after the bits in the data sheet. The association
      between bit number and hardware block is processor specific.
      Signed-off-by: default avatarMagnus Damm <damm@igel.co.jp>
      Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
      aea167cb
    • Magnus Damm's avatar
      sh: Use arch_flags to simplify sh7722 siu clock code · 3fec18bd
      Magnus Damm authored
      
      
      Make use of arch_flags to simplify the SIU clock code.
      Signed-off-by: default avatarMagnus Damm <damm@igel.co.jp>
      Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
      3fec18bd
    • Adrian Bunk's avatar
      fix sh ptep_get_and_clear breakage · c46acb8e
      Adrian Bunk authored
      Commit 1ea0704e
      
      
      (mm: add a ptep_modify_prot transaction abstraction)
      triggered on sh build errors like the following:
      
      <--  snip  -->
      
      ...
        CC      arch/sh/mm/pg-sh4.o
      cc1: warnings being treated as errors
      include2/asm/pgtable.h:139: error: 'ptep_get_and_clear' declared inline after being called
      include2/asm/pgtable.h:139: error: previous declaration of 'ptep_get_and_clear' was here
      make[2]: *** [arch/sh/mm/pg-sh4.o] Error 1
      
      <--  snip  -->
      
      Since there's no good reason for marking these global functions as
      "inline" this patch therefore removes the inline's.
      Signed-off-by: default avatarAdrian Bunk <bunk@kernel.org>
      Signed-off-by: default avatarPaul Mundt <lethal@linux-sh.org>
      c46acb8e