]> bbs.cooldavid.org Git - net-next-2.6.git/commitdiff
Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile
authorLinus Torvalds <torvalds@linux-foundation.org>
Wed, 27 Oct 2010 00:25:38 +0000 (17:25 -0700)
committerLinus Torvalds <torvalds@linux-foundation.org>
Wed, 27 Oct 2010 00:25:38 +0000 (17:25 -0700)
* git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
  arch/tile: convert a BUG_ON to BUILD_BUG_ON
  arch/tile: make ptrace() work properly for TILE-Gx COMPAT mode
  arch/tile: support new info op generated by compiler
  arch/tile: minor whitespace/naming changes for string support files
  arch/tile: enable single-step support for TILE-Gx
  arch/tile: parameterize system PLs to support KVM port
  arch/tile: add Tilera's <arch/sim.h> header as an open-source header
  arch/tile: Bomb C99 comments to C89 comments in tile's <arch/sim_def.h>
  arch/tile: prevent corrupt top frame from causing backtracer runaway
  arch/tile: various top-level Makefile cleanups
  arch/tile: change lower bound on syscall error return to -4095
  arch/tile: properly export __mb_incoherent for modules
  arch/tile: provide a definition of MAP_STACK
  kmemleak: add TILE to the list of supported architectures.
  char: hvc: check for error case
  arch/tile: Add a warning if we try to allocate too much vmalloc memory.
  arch/tile: update some comments to clarify register usage.
  arch/tile: use better "punctuation" for VMSPLIT_3_5G and friends
  arch/tile: Use <asm-generic/syscalls.h>
  tile: replace some BUG_ON checks with BUILD_BUG_ON checks

1  2 
arch/tile/include/asm/irqflags.h
arch/tile/kernel/irq.c
lib/Kconfig.debug

index a11d4837ee4d6526137858e8fdd6226deb0a95d0,6ebdd7d1e67ac51a9fb394de37fe9422fdbd933f..641e4ff3d805aa2014d6f6df0948c80fba580947
        int __n = (n); \
        int __mask = 1 << (__n & 0x1f); \
        if (__n < 32) \
-               __insn_mtspr(SPR_INTERRUPT_MASK_SET_1_0, __mask); \
+               __insn_mtspr(SPR_INTERRUPT_MASK_SET_K_0, __mask); \
        else \
-               __insn_mtspr(SPR_INTERRUPT_MASK_SET_1_1, __mask); \
+               __insn_mtspr(SPR_INTERRUPT_MASK_SET_K_1, __mask); \
  } while (0)
  #define interrupt_mask_reset(n) do { \
        int __n = (n); \
        int __mask = 1 << (__n & 0x1f); \
        if (__n < 32) \
-               __insn_mtspr(SPR_INTERRUPT_MASK_RESET_1_0, __mask); \
+               __insn_mtspr(SPR_INTERRUPT_MASK_RESET_K_0, __mask); \
        else \
-               __insn_mtspr(SPR_INTERRUPT_MASK_RESET_1_1, __mask); \
+               __insn_mtspr(SPR_INTERRUPT_MASK_RESET_K_1, __mask); \
  } while (0)
  #define interrupt_mask_check(n) ({ \
        int __n = (n); \
        (((__n < 32) ? \
-        __insn_mfspr(SPR_INTERRUPT_MASK_1_0) : \
-        __insn_mfspr(SPR_INTERRUPT_MASK_1_1)) \
+        __insn_mfspr(SPR_INTERRUPT_MASK_K_0) : \
+        __insn_mfspr(SPR_INTERRUPT_MASK_K_1)) \
          >> (__n & 0x1f)) & 1; \
  })
  #define interrupt_mask_set_mask(mask) do { \
        unsigned long long __m = (mask); \
-       __insn_mtspr(SPR_INTERRUPT_MASK_SET_1_0, (unsigned long)(__m)); \
-       __insn_mtspr(SPR_INTERRUPT_MASK_SET_1_1, (unsigned long)(__m>>32)); \
+       __insn_mtspr(SPR_INTERRUPT_MASK_SET_K_0, (unsigned long)(__m)); \
+       __insn_mtspr(SPR_INTERRUPT_MASK_SET_K_1, (unsigned long)(__m>>32)); \
  } while (0)
  #define interrupt_mask_reset_mask(mask) do { \
        unsigned long long __m = (mask); \
-       __insn_mtspr(SPR_INTERRUPT_MASK_RESET_1_0, (unsigned long)(__m)); \
-       __insn_mtspr(SPR_INTERRUPT_MASK_RESET_1_1, (unsigned long)(__m>>32)); \
+       __insn_mtspr(SPR_INTERRUPT_MASK_RESET_K_0, (unsigned long)(__m)); \
+       __insn_mtspr(SPR_INTERRUPT_MASK_RESET_K_1, (unsigned long)(__m>>32)); \
  } while (0)
  #else
  #define interrupt_mask_set(n) \
-       __insn_mtspr(SPR_INTERRUPT_MASK_SET_1, (1UL << (n)))
+       __insn_mtspr(SPR_INTERRUPT_MASK_SET_K, (1UL << (n)))
  #define interrupt_mask_reset(n) \
-       __insn_mtspr(SPR_INTERRUPT_MASK_RESET_1, (1UL << (n)))
+       __insn_mtspr(SPR_INTERRUPT_MASK_RESET_K, (1UL << (n)))
  #define interrupt_mask_check(n) \
-       ((__insn_mfspr(SPR_INTERRUPT_MASK_1) >> (n)) & 1)
+       ((__insn_mfspr(SPR_INTERRUPT_MASK_K) >> (n)) & 1)
  #define interrupt_mask_set_mask(mask) \
-       __insn_mtspr(SPR_INTERRUPT_MASK_SET_1, (mask))
+       __insn_mtspr(SPR_INTERRUPT_MASK_SET_K, (mask))
  #define interrupt_mask_reset_mask(mask) \
-       __insn_mtspr(SPR_INTERRUPT_MASK_RESET_1, (mask))
+       __insn_mtspr(SPR_INTERRUPT_MASK_RESET_K, (mask))
  #endif
  
  /*
   * The set of interrupts we want active if irqs are enabled.
   * Note that in particular, the tile timer interrupt comes and goes
   * from this set, since we have no other way to turn off the timer.
-  * Likewise, INTCTRL_1 is removed and re-added during device
+  * Likewise, INTCTRL_K is removed and re-added during device
   * interrupts, as is the the hardwall UDN_FIREWALL interrupt.
   * We use a low bit (MEM_ERROR) as our sentinel value and make sure it
   * is always claimed as an "active interrupt" so we can query that bit
@@@ -103,57 -103,55 +103,57 @@@ DECLARE_PER_CPU(unsigned long long, int
  #define INITIAL_INTERRUPTS_ENABLED INT_MASK(INT_MEM_ERROR)
  
  /* Disable interrupts. */
 -#define raw_local_irq_disable() \
 +#define arch_local_irq_disable() \
        interrupt_mask_set_mask(LINUX_MASKABLE_INTERRUPTS)
  
  /* Disable all interrupts, including NMIs. */
 -#define raw_local_irq_disable_all() \
 +#define arch_local_irq_disable_all() \
        interrupt_mask_set_mask(-1UL)
  
  /* Re-enable all maskable interrupts. */
 -#define raw_local_irq_enable() \
 +#define arch_local_irq_enable() \
        interrupt_mask_reset_mask(__get_cpu_var(interrupts_enabled_mask))
  
  /* Disable or enable interrupts based on flag argument. */
 -#define raw_local_irq_restore(disabled) do { \
 +#define arch_local_irq_restore(disabled) do { \
        if (disabled) \
 -              raw_local_irq_disable(); \
 +              arch_local_irq_disable(); \
        else \
 -              raw_local_irq_enable(); \
 +              arch_local_irq_enable(); \
  } while (0)
  
  /* Return true if "flags" argument means interrupts are disabled. */
 -#define raw_irqs_disabled_flags(flags) ((flags) != 0)
 +#define arch_irqs_disabled_flags(flags) ((flags) != 0)
  
  /* Return true if interrupts are currently disabled. */
 -#define raw_irqs_disabled() interrupt_mask_check(INT_MEM_ERROR)
 +#define arch_irqs_disabled() interrupt_mask_check(INT_MEM_ERROR)
  
  /* Save whether interrupts are currently disabled. */
 -#define raw_local_save_flags(flags) ((flags) = raw_irqs_disabled())
 +#define arch_local_save_flags() arch_irqs_disabled()
  
  /* Save whether interrupts are currently disabled, then disable them. */
 -#define raw_local_irq_save(flags) \
 -      do { raw_local_save_flags(flags); raw_local_irq_disable(); } while (0)
 +#define arch_local_irq_save() ({ \
 +      unsigned long __flags = arch_local_save_flags(); \
 +      arch_local_irq_disable(); \
 +      __flags; })
  
  /* Prevent the given interrupt from being enabled next time we enable irqs. */
 -#define raw_local_irq_mask(interrupt) \
 +#define arch_local_irq_mask(interrupt) \
        (__get_cpu_var(interrupts_enabled_mask) &= ~INT_MASK(interrupt))
  
  /* Prevent the given interrupt from being enabled immediately. */
 -#define raw_local_irq_mask_now(interrupt) do { \
 -      raw_local_irq_mask(interrupt); \
 +#define arch_local_irq_mask_now(interrupt) do { \
 +      arch_local_irq_mask(interrupt); \
        interrupt_mask_set(interrupt); \
  } while (0)
  
  /* Allow the given interrupt to be enabled next time we enable irqs. */
 -#define raw_local_irq_unmask(interrupt) \
 +#define arch_local_irq_unmask(interrupt) \
        (__get_cpu_var(interrupts_enabled_mask) |= INT_MASK(interrupt))
  
  /* Allow the given interrupt to be enabled immediately, if !irqs_disabled. */
 -#define raw_local_irq_unmask_now(interrupt) do { \
 -      raw_local_irq_unmask(interrupt); \
 +#define arch_local_irq_unmask_now(interrupt) do { \
 +      arch_local_irq_unmask(interrupt); \
        if (!irqs_disabled()) \
                interrupt_mask_reset(interrupt); \
  } while (0)
  
  /* Return 0 or 1 to indicate whether interrupts are currently disabled. */
  #define IRQS_DISABLED(tmp)                                    \
-       mfspr   tmp, INTERRUPT_MASK_1;                          \
+       mfspr   tmp, SPR_INTERRUPT_MASK_K;                      \
        andi    tmp, tmp, 1
  
  /* Load up a pointer to &interrupts_enabled_mask. */
  #define GET_INTERRUPTS_ENABLED_MASK_PTR(reg)                  \
-       moveli reg, hw2_last(interrupts_enabled_mask); \
-       shl16insli reg, reg, hw1(interrupts_enabled_mask); \
-       shl16insli reg, reg, hw0(interrupts_enabled_mask); \
+       moveli reg, hw2_last(interrupts_enabled_mask);          \
+       shl16insli reg, reg, hw1(interrupts_enabled_mask);      \
+       shl16insli reg, reg, hw0(interrupts_enabled_mask);      \
        add     reg, reg, tp
  
  /* Disable interrupts. */
        moveli  tmp0, hw2_last(LINUX_MASKABLE_INTERRUPTS);      \
        shl16insli tmp0, tmp0, hw1(LINUX_MASKABLE_INTERRUPTS);  \
        shl16insli tmp0, tmp0, hw0(LINUX_MASKABLE_INTERRUPTS);  \
-       mtspr   INTERRUPT_MASK_SET_1, tmp0
+       mtspr   SPR_INTERRUPT_MASK_SET_K, tmp0
  
  /* Disable ALL synchronous interrupts (used by NMI entry). */
  #define IRQ_DISABLE_ALL(tmp)                                  \
        movei   tmp, -1;                                        \
-       mtspr   INTERRUPT_MASK_SET_1, tmp
+       mtspr   SPR_INTERRUPT_MASK_SET_K, tmp
  
  /* Enable interrupts. */
  #define IRQ_ENABLE(tmp0, tmp1)                                        \
        GET_INTERRUPTS_ENABLED_MASK_PTR(tmp0);                  \
        ld      tmp0, tmp0;                                     \
-       mtspr   INTERRUPT_MASK_RESET_1, tmp0
+       mtspr   SPR_INTERRUPT_MASK_RESET_K, tmp0
  
  #else /* !__tilegx__ */
  
   * (making the original code's write of the "high" mask word idempotent).
   */
  #define IRQS_DISABLED(tmp)                                    \
-       mfspr   tmp, INTERRUPT_MASK_1_0;                        \
+       mfspr   tmp, SPR_INTERRUPT_MASK_K_0;                    \
        shri    tmp, tmp, INT_MEM_ERROR;                        \
        andi    tmp, tmp, 1
  
  /* Load up a pointer to &interrupts_enabled_mask. */
  #define GET_INTERRUPTS_ENABLED_MASK_PTR(reg)                  \
-       moveli  reg, lo16(interrupts_enabled_mask);     \
-       auli    reg, reg, ha16(interrupts_enabled_mask);\
+       moveli  reg, lo16(interrupts_enabled_mask);             \
+       auli    reg, reg, ha16(interrupts_enabled_mask);        \
        add     reg, reg, tp
  
  /* Disable interrupts. */
         moveli tmp1, lo16(LINUX_MASKABLE_INTERRUPTS)           \
        };                                                      \
        {                                                       \
-        mtspr  INTERRUPT_MASK_SET_1_0, tmp0;                   \
+        mtspr  SPR_INTERRUPT_MASK_SET_K_0, tmp0;               \
         auli   tmp1, tmp1, ha16(LINUX_MASKABLE_INTERRUPTS)     \
        };                                                      \
-       mtspr   INTERRUPT_MASK_SET_1_1, tmp1
+       mtspr   SPR_INTERRUPT_MASK_SET_K_1, tmp1
  
  /* Disable ALL synchronous interrupts (used by NMI entry). */
  #define IRQ_DISABLE_ALL(tmp)                                  \
        movei   tmp, -1;                                        \
-       mtspr   INTERRUPT_MASK_SET_1_0, tmp;                    \
-       mtspr   INTERRUPT_MASK_SET_1_1, tmp
+       mtspr   SPR_INTERRUPT_MASK_SET_K_0, tmp;                \
+       mtspr   SPR_INTERRUPT_MASK_SET_K_1, tmp
  
  /* Enable interrupts. */
  #define IRQ_ENABLE(tmp0, tmp1)                                        \
         addi   tmp1, tmp0, 4                                   \
        };                                                      \
        lw      tmp1, tmp1;                                     \
-       mtspr   INTERRUPT_MASK_RESET_1_0, tmp0;                 \
-       mtspr   INTERRUPT_MASK_RESET_1_1, tmp1
+       mtspr   SPR_INTERRUPT_MASK_RESET_K_0, tmp0;             \
+       mtspr   SPR_INTERRUPT_MASK_RESET_K_1, tmp1
  #endif
  
  /*
diff --combined arch/tile/kernel/irq.c
index 9a27d563fc30968ce3efb46ac11ce241e10d8cc0,394d554f21aa5e21bce4de758e5778e5b688f53f..e63917687e998907824a62b1783ffef599418818
@@@ -61,9 -61,9 +61,9 @@@ static DEFINE_SPINLOCK(available_irqs_l
  
  #if CHIP_HAS_IPI()
  /* Use SPRs to manipulate device interrupts. */
- #define mask_irqs(irq_mask) __insn_mtspr(SPR_IPI_MASK_SET_1, irq_mask)
- #define unmask_irqs(irq_mask) __insn_mtspr(SPR_IPI_MASK_RESET_1, irq_mask)
- #define clear_irqs(irq_mask) __insn_mtspr(SPR_IPI_EVENT_RESET_1, irq_mask)
+ #define mask_irqs(irq_mask) __insn_mtspr(SPR_IPI_MASK_SET_K, irq_mask)
+ #define unmask_irqs(irq_mask) __insn_mtspr(SPR_IPI_MASK_RESET_K, irq_mask)
+ #define clear_irqs(irq_mask) __insn_mtspr(SPR_IPI_EVENT_RESET_K, irq_mask)
  #else
  /* Use HV to manipulate device interrupts. */
  #define mask_irqs(irq_mask) hv_disable_intr(irq_mask)
@@@ -89,16 -89,16 +89,16 @@@ void tile_dev_intr(struct pt_regs *regs
         * masked by a previous interrupt.  Then, mask out the ones
         * we're going to handle.
         */
-       unsigned long masked = __insn_mfspr(SPR_IPI_MASK_1);
-       original_irqs = __insn_mfspr(SPR_IPI_EVENT_1) & ~masked;
-       __insn_mtspr(SPR_IPI_MASK_SET_1, original_irqs);
+       unsigned long masked = __insn_mfspr(SPR_IPI_MASK_K);
+       original_irqs = __insn_mfspr(SPR_IPI_EVENT_K) & ~masked;
+       __insn_mtspr(SPR_IPI_MASK_SET_K, original_irqs);
  #else
        /*
         * Hypervisor performs the equivalent of the Gx code above and
         * then puts the pending interrupt mask into a system save reg
         * for us to find.
         */
-       original_irqs = __insn_mfspr(SPR_SYSTEM_SAVE_1_3);
+       original_irqs = __insn_mfspr(SPR_SYSTEM_SAVE_K_3);
  #endif
        remaining_irqs = original_irqs;
  
@@@ -208,7 -208,7 +208,7 @@@ static void tile_irq_chip_eoi(unsigned 
  }
  
  static struct irq_chip tile_irq_chip = {
 -      .typename = "tile_irq_chip",
 +      .name = "tile_irq_chip",
        .ack = tile_irq_chip_ack,
        .eoi = tile_irq_chip_eoi,
        .mask = tile_irq_chip_mask,
@@@ -225,7 -225,7 +225,7 @@@ void __cpuinit setup_irq_regs(void
        /* Enable interrupt delivery. */
        unmask_irqs(~0UL);
  #if CHIP_HAS_IPI()
-       raw_local_irq_unmask(INT_IPI_1);
+       raw_local_irq_unmask(INT_IPI_K);
  #endif
  }
  
@@@ -288,7 -288,7 +288,7 @@@ int show_interrupts(struct seq_file *p
                for_each_online_cpu(j)
                        seq_printf(p, "%10u ", kstat_irqs_cpu(i, j));
  #endif
 -              seq_printf(p, " %14s", irq_desc[i].chip->typename);
 +              seq_printf(p, " %14s", irq_desc[i].chip->name);
                seq_printf(p, "  %s", action->name);
  
                for (action = action->next; action; action = action->next)
diff --combined lib/Kconfig.debug
index 95bda87a3e84d415aa31662622b4de22041f1fe1,9f211b2642f5f6f15025c4327b51ef09edc7059b..995840664a5f388b1248bb5b5b363daa1e89948e
@@@ -317,14 -317,6 +317,14 @@@ config DEBUG_OBJECTS_RCU_HEA
        help
          Enable this to turn on debugging of RCU list heads (call_rcu() usage).
  
 +config DEBUG_OBJECTS_PERCPU_COUNTER
 +      bool "Debug percpu counter objects"
 +      depends on DEBUG_OBJECTS
 +      help
 +        If you say Y here, additional code will be inserted into the
 +        percpu counter routines to track the life time of percpu counter
 +        objects and validate the percpu counter operations.
 +
  config DEBUG_OBJECTS_ENABLE_DEFAULT
        int "debug_objects bootup default value (0-1)"
          range 0 1
@@@ -361,7 -353,7 +361,7 @@@ config SLUB_DEBUG_O
  config SLUB_STATS
        default n
        bool "Enable SLUB performance statistics"
 -      depends on SLUB && SLUB_DEBUG && SYSFS
 +      depends on SLUB && SYSFS
        help
          SLUB statistics are useful to debug SLUBs allocation behavior in
          order find ways to optimize the allocator. This should never be
  config DEBUG_KMEMLEAK
        bool "Kernel memory leak detector"
        depends on DEBUG_KERNEL && EXPERIMENTAL && !MEMORY_HOTPLUG && \
-               (X86 || ARM || PPC || S390 || SPARC64 || SUPERH || MICROBLAZE)
+               (X86 || ARM || PPC || S390 || SPARC64 || SUPERH || MICROBLAZE || TILE)
  
        select DEBUG_FS if SYSFS
        select STACKTRACE if STACKTRACE_SUPPORT
@@@ -469,15 -461,6 +469,15 @@@ config DEBUG_MUTEXE
         This feature allows mutex semantics violations to be detected and
         reported.
  
 +config BKL
 +      bool "Big Kernel Lock" if (SMP || PREEMPT)
 +      default y
 +      help
 +        This is the traditional lock that is used in old code instead
 +        of proper locking. All drivers that use the BKL should depend
 +        on this symbol.
 +        Say Y here unless you are working on removing the BKL.
 +
  config DEBUG_LOCK_ALLOC
        bool "Lock debugging: detect incorrect freeing of live locks"
        depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
@@@ -499,7 -482,6 +499,7 @@@ config PROVE_LOCKIN
        select DEBUG_SPINLOCK
        select DEBUG_MUTEXES
        select DEBUG_LOCK_ALLOC
 +      select TRACE_IRQFLAGS
        default n
        help
         This feature enables the kernel to prove that all locking
@@@ -557,23 -539,6 +557,23 @@@ config PROVE_RCU_REPEATEDL
         disabling, allowing multiple RCU-lockdep warnings to be printed
         on a single reboot.
  
 +       Say Y to allow multiple RCU-lockdep warnings per boot.
 +
 +       Say N if you are unsure.
 +
 +config SPARSE_RCU_POINTER
 +      bool "RCU debugging: sparse-based checks for pointer usage"
 +      default n
 +      help
 +       This feature enables the __rcu sparse annotation for
 +       RCU-protected pointers.  This annotation will cause sparse
 +       to flag any non-RCU used of annotated pointers.  This can be
 +       helpful when debugging RCU usage.  Please note that this feature
 +       is not intended to enforce code cleanliness; it is instead merely
 +       a debugging aid.
 +
 +       Say Y to make sparse flag questionable use of RCU-protected pointers
 +
         Say N if you are unsure.
  
  config LOCKDEP
@@@ -614,10 -579,11 +614,10 @@@ config DEBUG_LOCKDE
          of more runtime overhead.
  
  config TRACE_IRQFLAGS
 -      depends on DEBUG_KERNEL
        bool
 -      default y
 -      depends on TRACE_IRQFLAGS_SUPPORT
 -      depends on PROVE_LOCKING
 +      help
 +        Enables hooks to interrupt enabling and disabling for
 +        either tracing or lock debugging.
  
  config DEBUG_SPINLOCK_SLEEP
        bool "Spinlock debugging: sleep-inside-spinlock checking"
@@@ -748,15 -714,6 +748,15 @@@ config DEBUG_LIS
  
          If unsure, say N.
  
 +config TEST_LIST_SORT
 +      bool "Linked list sorting test"
 +      depends on DEBUG_KERNEL
 +      help
 +        Enable this to turn on 'list_sort()' function test. This test is
 +        executed only once during system boot, so affects only boot time.
 +
 +        If unsure, say N.
 +
  config DEBUG_SG
        bool "Debug SG table operations"
        depends on DEBUG_KERNEL
@@@ -875,30 -832,6 +875,30 @@@ config RCU_CPU_STALL_DETECTO
  
          Say Y if you are unsure.
  
 +config RCU_CPU_STALL_TIMEOUT
 +      int "RCU CPU stall timeout in seconds"
 +      depends on RCU_CPU_STALL_DETECTOR
 +      range 3 300
 +      default 60
 +      help
 +        If a given RCU grace period extends more than the specified
 +        number of seconds, a CPU stall warning is printed.  If the
 +        RCU grace period persists, additional CPU stall warnings are
 +        printed at more widely spaced intervals.
 +
 +config RCU_CPU_STALL_DETECTOR_RUNNABLE
 +      bool "RCU CPU stall checking starts automatically at boot"
 +      depends on RCU_CPU_STALL_DETECTOR
 +      default y
 +      help
 +        If set, start checking for RCU CPU stalls immediately on
 +        boot.  Otherwise, RCU CPU stall checking must be manually
 +        enabled.
 +
 +        Say Y if you are unsure.
 +
 +        Say N if you wish to suppress RCU CPU stall checking during boot.
 +
  config RCU_CPU_STALL_VERBOSE
        bool "Print additional per-task information for RCU_CPU_STALL_DETECTOR"
        depends on RCU_CPU_STALL_DETECTOR && TREE_PREEMPT_RCU