1. 03 4月, 2014 1 次提交
  2. 01 4月, 2014 1 次提交
    • H
      s390/bitops,atomic: add missing memory barriers · 0ccc8b7a
      Heiko Carstens 提交于
      When reworking the bitops and atomic ops I missed that those instructions
      that got atomic behaviour only perform a "specific-operand-serialization"
      instead of a full "serialization".
      The compare-and-swap instruction used before performs a full serialization
      before and after the instruction is executed, which means it has full
      memory barrier semantics.
      In order to give the new bitops and atomic ops functions also full memory
      barrier semantics add a "bcr 14,0" before and after each of those new
      instructions which performs full serialization as well.
      
      This restores memory barrier semantics for bitops and atomic ops functions
      which return values, like e.g. atomic_add_return(), but not for functions
      which do not return a value, like e.g. atomic_add().
      This is consistent to other architectures and what common code requires.
      
      Cc: stable@vger.kernel.org # v3.13+
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      0ccc8b7a
  3. 21 3月, 2014 2 次提交
  4. 17 3月, 2014 1 次提交
  5. 14 3月, 2014 1 次提交
  6. 06 3月, 2014 2 次提交
    • H
      s390/compat: build error for large compat syscall args · 9a205286
      Heiko Carstens 提交于
      Enforce 32 bit types for all compat syscall argument types.
      
      This way we can make sure that all arguments get correct sign
      or zero extension. Otherwise incorrect code would be generated.
      
      E.g. for a 'long' type the COMPAT_SYSCALL_DEFINE macro wouldn't
      generate code that would cause sign extension of the passed in 32
      bit user space parameter.
      This can cause quite subtle bugs like e.g. the one that was fixed
      with dfd948e3 "fs/compat: fix parameter handling for compat
      readv/writev syscalls".
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      9a205286
    • H
      fs/compat: convert to COMPAT_SYSCALL_DEFINE with changing parameter types · 932602e2
      Heiko Carstens 提交于
      Some fs compat system calls have unsigned long parameters instead of
      compat_ulong_t.
      In order to allow the COMPAT_SYSCALL_DEFINE macro generate code that
      performs proper zero and sign extension convert all 64 bit parameters
      their corresponding 32 bit counterparts.
      
      compat_sys_io_getevents() is a bit different: the non-compat version
      has signed parameters for the "min_nr" and "nr" parameters while the
      compat version has unsigned parameters.
      So change this as well. For all practical purposes this shouldn't make
      any difference (doesn't fix a real bug).
      Also introduce a generic compat_aio_context_t type which can be used
      everywhere.
      The access_ok() check within compat_sys_io_getevents() got also removed
      since the non-compat sys_io_getevents() should be able to handle
      everything anyway.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      932602e2
  7. 04 3月, 2014 1 次提交
  8. 25 2月, 2014 2 次提交
  9. 21 2月, 2014 12 次提交
  10. 10 2月, 2014 2 次提交
    • T
      locking/mcs: Allow architecture specific asm files to be used for contended case · ddf1d169
      Tim Chen 提交于
      This patch allows each architecture to add its specific assembly optimized
      arch_mcs_spin_lock_contended and arch_mcs_spinlock_uncontended for
      MCS lock and unlock functions.
      Signed-off-by: NTim Chen <tim.c.chen@linux.intel.com>
      Cc: Scott J Norton <scott.norton@hp.com>
      Cc: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
      Cc: AswinChandramouleeswaran <aswin@hp.com>
      Cc: George Spelvin <linux@horizon.com>
      Cc: Rik vanRiel <riel@redhat.com>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: MichelLespinasse <walken@google.com>
      Cc: Peter Hurley <peter@hurleysoftware.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Alex Shi <alex.shi@linaro.org>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Tim Chen <tim.c.chen@linux.intel.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: "Figo.zhang" <figo1802@gmail.com>
      Cc: "Paul E.McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Davidlohr Bueso <davidlohr.bueso@hp.com>
      Cc: Waiman Long <waiman.long@hp.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Matthew R Wilcox <matthew.r.wilcox@intel.com>
      Signed-off-by: NPeter Zijlstra <peterz@infradead.org>
      Link: http://lkml.kernel.org/r/1390347382.3138.67.camel@schen9-DESKSigned-off-by: NIngo Molnar <mingo@kernel.org>
      ddf1d169
    • T
      locking/mcs: Order the header files in Kbuild of each architecture in alphabetical order · b119fa61
      Tim Chen 提交于
      We perform a clean up of the Kbuid files in each architecture.
      We order the files in each Kbuild in alphabetical order
      by running the below script.
      
      for i in arch/*/include/asm/Kbuild
      do
              cat $i | gawk '/^generic-y/ {
                      i = 3;
                      do {
                              for (; i <= NF; i++) {
                                      if ($i == "\\") {
                                              getline;
                                              i = 1;
                                              continue;
                                      }
                                      if ($i != "")
                                              hdr[$i] = $i;
                              }
                              break;
                      } while (1);
                      next;
              }
              // {
                      print $0;
              }
              END {
                      n = asort(hdr);
                      for (i = 1; i <= n; i++)
                              print "generic-y += " hdr[i];
              }' > ${i}.sorted;
              mv ${i}.sorted $i;
      done
      Signed-off-by: NTim Chen <tim.c.chen@linux.intel.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Matthew R Wilcox <matthew.r.wilcox@intel.com>
      Cc: AswinChandramouleeswaran <aswin@hp.com>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: "Paul E.McKenney" <paulmck@linux.vnet.ibm.com>
      Cc: Scott J Norton <scott.norton@hp.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: "Figo.zhang" <figo1802@gmail.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Rik van Riel <riel@redhat.com>
      Cc: Waiman Long <waiman.long@hp.com>
      Cc: Peter Hurley <peter@hurleysoftware.com>
      Cc: Andrea Arcangeli <aarcange@redhat.com>
      Cc: Tim Chen <tim.c.chen@linux.intel.com>
      Cc: Alex Shi <alex.shi@linaro.org>
      Cc: Raghavendra K T <raghavendra.kt@linux.vnet.ibm.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: George Spelvin <linux@horizon.com>
      Cc: MichelLespinasse <walken@google.com>
      Cc: Ingo Molnar <mingo@elte.hu>
      Cc: "H. Peter Anvin" <hpa@zytor.com>
      Cc: Davidlohr Bueso <davidlohr.bueso@hp.com>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NPeter Zijlstra <peterz@infradead.org>
      [ Fixed build bug. ]
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      b119fa61
  11. 24 1月, 2014 1 次提交
  12. 22 1月, 2014 1 次提交
    • H
      s390/32bit: fix cmpxchg64 · 38ea1f35
      Heiko Carstens 提交于
      Fix broken inline assembly contraints for cmpxchg64 on 32bit.
      
      Fixes this crash:
      
      specification exception: 0006 [#1] SMP
      CPU: 0 PID: 0 Comm: swapper/0 Not tainted 3.13.0 #4
      task: 005a16c8 ti: 00592000 task.ti: 00592000
      Krnl PSW : 070ce000 8029abd6 (lockref_get+0x3e/0x9c)
      ...
      Krnl Code: 8029abcc: a71a0001           ahi     %r1,1
                 8029abd0: 1852               lr      %r5,%r2
                #8029abd2: bb40f064           cds     %r4,%r0,100(%r15)
                >8029abd6: 1943               cr      %r4,%r3
                 8029abd8: 1815               lr      %r1,%r5
      Call Trace:
      ([<0000000078e01870>] 0x78e01870)
       [<000000000021105a>] sysfs_mount+0xd2/0x1c8
       [<00000000001b551e>] mount_fs+0x3a/0x134
       [<00000000001ce768>] vfs_kern_mount+0x44/0x11c
       [<00000000001ce864>] kern_mount_data+0x24/0x3c
       [<00000000005cc4b8>] sysfs_init+0x74/0xd4
       [<00000000005cb5b4>] mnt_init+0xe0/0x1fc
       [<00000000005cb16a>] vfs_caches_init+0xb6/0x14c
       [<00000000005be794>] start_kernel+0x318/0x33c
       [<000000000010001c>] _stext+0x1c/0x80
      Reported-by: NMike Frysinger <vapier@gentoo.org>
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      38ea1f35
  13. 17 1月, 2014 1 次提交
    • M
      KVM: s390: enable Transactional Execution · 7feb6bb8
      Michael Mueller 提交于
      This patch enables transactional execution for KVM guests
      on s390 systems zec12 or later.
      
      We rework the allocation of the page containing the sie_block
      to also back the Interception Transaction Diagnostic Block.
      If available the TE facilities will be enabled.
      
      Setting bit 73 and 50 in vfacilities bitmask reveals the HW
      facilities Transactional Memory and Constraint Transactional
      Memory respectively to the KVM guest.
      
      Furthermore, the patch restores the Program-Interruption TDB
      from the Interception TDB in case a program interception has
      occurred and the ITDB has a valid format.
      Signed-off-by: NMichael Mueller <mimu@linux.vnet.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      7feb6bb8
  14. 16 1月, 2014 2 次提交
  15. 14 1月, 2014 2 次提交
  16. 13 1月, 2014 1 次提交
  17. 12 1月, 2014 1 次提交
    • P
      arch: Introduce smp_load_acquire(), smp_store_release() · 47933ad4
      Peter Zijlstra 提交于
      A number of situations currently require the heavyweight smp_mb(),
      even though there is no need to order prior stores against later
      loads.  Many architectures have much cheaper ways to handle these
      situations, but the Linux kernel currently has no portable way
      to make use of them.
      
      This commit therefore supplies smp_load_acquire() and
      smp_store_release() to remedy this situation.  The new
      smp_load_acquire() primitive orders the specified load against
      any subsequent reads or writes, while the new smp_store_release()
      primitive orders the specifed store against any prior reads or
      writes.  These primitives allow array-based circular FIFOs to be
      implemented without an smp_mb(), and also allow a theoretical
      hole in rcu_assign_pointer() to be closed at no additional
      expense on most architectures.
      
      In addition, the RCU experience transitioning from explicit
      smp_read_barrier_depends() and smp_wmb() to rcu_dereference()
      and rcu_assign_pointer(), respectively resulted in substantial
      improvements in readability.  It therefore seems likely that
      replacing other explicit barriers with smp_load_acquire() and
      smp_store_release() will provide similar benefits.  It appears
      that roughly half of the explicit barriers in core kernel code
      might be so replaced.
      
      [Changelog by PaulMck]
      Reviewed-by: N"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
      Signed-off-by: NPeter Zijlstra <peterz@infradead.org>
      Acked-by: NWill Deacon <will.deacon@arm.com>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Frederic Weisbecker <fweisbec@gmail.com>
      Cc: Mathieu Desnoyers <mathieu.desnoyers@polymtl.ca>
      Cc: Michael Ellerman <michael@ellerman.id.au>
      Cc: Michael Neuling <mikey@neuling.org>
      Cc: Russell King <linux@arm.linux.org.uk>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Victor Kaplansky <VICTORK@il.ibm.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Link: http://lkml.kernel.org/r/20131213150640.908486364@infradead.orgSigned-off-by: NIngo Molnar <mingo@kernel.org>
      47933ad4
  18. 11 1月, 2014 1 次提交
    • T
      s390: use device_remove_file_self() instead of device_schedule_callback() · bdbb0a13
      Tejun Heo 提交于
      driver-core now supports synchrnous self-deletion of attributes and
      the asynchrnous removal mechanism is scheduled for removal.  Use it
      instead of device_schedule_callback().
      
      * Conversions in arch/s390/pci/pci_sysfs.c and
        drivers/s390/block/dcssblk.c are straightforward.
      
      * drivers/s390/cio/ccwgroup.c is a bit more tricky because
        ccwgroup_notifier() was (ab)using device_schedule_callback() to
        purely obtain a process context to kick off ungroup operation which
        may block from a notifier callback.
      
        Rename ccwgroup_ungroup_callback() to ccwgroup_ungroup() and make it
        take ccwgroup_device * instead.  The new function is now called
        directly from ccwgroup_ungroup_store().
      
        ccwgroup_notifier() chain is updated to explicitly bounce through
        ccwgroup_device->ungroup_work.  This also removes possible failure
        from memory pressure.
      
      Only compile-tested.
      Signed-off-by: NTejun Heo <tj@kernel.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: linux390@de.ibm.com
      Cc: linux-s390@vger.kernel.org
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      bdbb0a13
  19. 19 12月, 2013 1 次提交
  20. 18 12月, 2013 1 次提交
  21. 16 12月, 2013 3 次提交
    • H
      s390/cpum_sf: Add flag to process full SDBs only · d7528862
      Hendrik Brueckner 提交于
      Add the PERF_CPUM_SF_FULL_BLOCKS flag to process only sample-data-blocks that
      have the block-full-indicator bit set.  Sample-data-blocks that are partially
      filled are discarded.  Use this flag if the sampling buffer is likely to be
      shared among perf events that use different sampling modes.  In such
      environments, flushing sample-data-blocks that are not completely filled, might
      cause invalid-data-formats.
      
      Setting PERF_CPUM_SF_FULL_BLOCKS prevents potentially invalid sampling data to
      be processed but, in contrast, also discards valid samples in partially filled
      sample-data-blocks.  Note that sample-data-blocks might not become full for
      small sampling frequencies or for workload that is scheduled for tiny intervals.
      
      To sample with the PERF_CPUM_SF_FULL_BLOCKS flag, set the perf->attr.config1
      to 0x0004.  For example:
      
      	perf record -e cpum_sf/config=0xB000,config1=0x0004/
      Signed-off-by: NHendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      d7528862
    • H
      s390/cpum_sf: Add raw data sampling to support the diagnostic-sampling function · 7e75fc3f
      Hendrik Brueckner 提交于
      Also support the diagnostic-sampling function in addition to the basic-sampling
      function.  Diagnostic-sampling data entries contain hardware model specific
      sampling data and additional programs are required to analyze the data.
      
      To deliver diagnostic-sampling, as well, as basis-sampling data entries to user
      space, introduce support for sampling "raw data".  If this particular perf
      sampling type (PERF_SAMPLE_RAW) is used, sampling data entries are copied
      to user space.  External programs can then analyze these data.
      Signed-off-by: NHendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      7e75fc3f
    • H
      s390/cpum_sf: Detect KVM guest samples · 443e802b
      Hendrik Brueckner 提交于
      The host-program-parameter (hpp) value of basic sample-data-entries designates
      a SIE control block that is set by the LPP instruction in sie64a().
      Non-zero values indicate guest samples, a value of zero indicates a host sample.
      
      For perf samples, host and guest samples are distinguished using particular
      PERF_MISC_* flags.  The perf layer calls perf_misc_flags() to set the flags
      based on the pt_regs content.  For each sample-data-entry, the cpum_sf PMU
      creates a pt_regs structure with the sample-data information.  An additional
      flag structure is added to easily distinguish between host and guest samples.
      Signed-off-by: NHendrik Brueckner <brueckner@linux.vnet.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      443e802b