1. 22 1月, 2015 1 次提交
    • M
      s390: add SMT support · 10ad34bc
      Martin Schwidefsky 提交于
      The multi-threading facility is introduced with the z13 processor family.
      This patch adds code to detect the multi-threading facility. With the
      facility enabled each core will surface multiple hardware threads to the
      system. Each hardware threads looks like a normal CPU to the operating
      system with all its registers and properties.
      
      The SCLP interface reports the SMT topology indirectly via the maximum
      thread id. Each reported CPU in the result of a read-scp-information
      is a core representing a number of hardware threads.
      
      To reflect the reduced CPU capacity if two hardware threads run on a
      single core the MT utilization counter set is used to normalize the
      raw cputime obtained by the CPU timer deltas. This scaled cputime is
      reported via the taskstats interface. The normal /proc/stat numbers
      are based on the raw cputime and are not affected by the normalization.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      10ad34bc
  2. 27 10月, 2014 1 次提交
    • H
      s390/ftrace,kprobes: allow to patch first instruction · c933146a
      Heiko Carstens 提交于
      If the function tracer is enabled, allow to set kprobes on the first
      instruction of a function (which is the function trace caller):
      
      If no kprobe is set handling of enabling and disabling function tracing
      of a function simply patches the first instruction. Either it is a nop
      (right now it's an unconditional branch, which skips the mcount block),
      or it's a branch to the ftrace_caller() function.
      
      If a kprobe is being placed on a function tracer calling instruction
      we encode if we actually have a nop or branch in the remaining bytes
      after the breakpoint instruction (illegal opcode).
      This is possible, since the size of the instruction used for the nop
      and branch is six bytes, while the size of the breakpoint is only
      two bytes.
      Therefore the first two bytes contain the illegal opcode and the last
      four bytes contain either "0" for nop or "1" for branch. The kprobes
      code will then execute/simulate the correct instruction.
      
      Instruction patching for kprobes and function tracer is always done
      with stop_machine(). Therefore we don't have any races where an
      instruction is patched concurrently on a different cpu.
      Besides that also the program check handler which executes the function
      trace caller instruction won't be executed concurrently to any
      stop_machine() execution.
      
      This allows to keep full fault based kprobes handling which generates
      correct pt_regs contents automatically.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      c933146a
  3. 09 10月, 2014 4 次提交
    • M
      s390/kdump: add support for vector extension · a62bc073
      Michael Holzheu 提交于
      With this patch for kdump the s390 vector registers are stored into the
      prepared save areas in the old kernel and into the REGSET_VX_LOW and
      REGSET_VX_HIGH ELF notes for /proc/vmcore in the new kernel.
      
      The NT_S390_VXRS_LOW note contains the lower halves of the first 16 vector
      registers 0-15. The higher halves are stored in the floating point register
      ELF note.  The NT_S390_VXRS_HIGH contains the full vector registers 16-31.
      
      The kernel provides a save area for storing vector register in case of
      machine checks. A pointer to this save are is stored in the CPU lowcore
      at offset 0x11b0. This save area is also used to save the registers for
      kdump. In case of a dumped crashed kdump those areas are used to extract
      the registers of the production system.
      
      The vector registers for remote CPUs are stored using the "store additional
      status at address" SIGP. For the dump CPU the vector registers are stored
      with the VSTM instruction.
      
      With this patch also zfcpdump stores the vector registers.
      Reviewed-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMichael Holzheu <holzheu@linux.vnet.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      a62bc073
    • M
      s390: add support for vector extension · 80703617
      Martin Schwidefsky 提交于
      The vector extension introduces 32 128-bit vector registers and a set of
      instruction to operate on the vector registers.
      
      The kernel can control the use of vector registers for the problem state
      program with a bit in control register 0. Once enabled for a process the
      kernel needs to retain the content of the vector registers on context
      switch. The signal frame is extended to include the vector registers.
      Two new register sets NT_S390_VXRS_LOW and NT_S390_VXRS_HIGH are added
      to the regset interface for the debugger and core dumps.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      80703617
    • M
      s390/idle: consolidate idle functions and definitions · b5f87f15
      Martin Schwidefsky 提交于
      Move the C functions and definitions related to the idle state handling
      to arch/s390/include/asm/idle.h and arch/s390/kernel/idle.c. The function
      s390_get_idle_time is renamed to arch_cpu_idle_time and vtime_stop_cpu to
      enabled_wait.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      b5f87f15
    • M
      s390/nohz: use a per-cpu flag for arch_needs_cpu · fe0f4976
      Martin Schwidefsky 提交于
      Move the nohz_delay bit from the s390_idle data structure to the
      per-cpu flags. Clear the nohz delay flag in __cpu_disable and
      remove the cpu hotplug notifier that used to do this.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      fe0f4976
  4. 25 9月, 2014 1 次提交
  5. 20 5月, 2014 3 次提交
  6. 09 4月, 2014 1 次提交
    • H
      s390/smp: fix smp_stop_cpu() for !CONFIG_SMP · e7c46c66
      Heiko Carstens 提交于
      smp_stop_cpu() should stop the current cpu even for !CONFIG_SMP.
      Otherwise machine_halt() will return and and the machine generates a
      panic instread of simply stopping the current cpu:
      
      Kernel panic - not syncing: Attempted to kill init! exitcode=0x00000000
      
      CPU: 0 PID: 1 Comm: systemd-shutdow Not tainted 3.14.0-01527-g2b6ef16a6bc5 #10
      [...]
      Call Trace:
      ([<0000000000110db0>] show_trace+0xf8/0x158)
       [<0000000000110e7a>] show_stack+0x6a/0xe8
       [<000000000074dba8>] panic+0xe4/0x268
       [<0000000000140570>] do_exit+0xa88/0xb2c
       [<000000000016e12c>] SyS_reboot+0x1f0/0x234
       [<000000000075da70>] sysc_nr_ok+0x22/0x28
       [<000000007d5a09b4>] 0x7d5a09b4
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      e7c46c66
  7. 03 4月, 2014 2 次提交
    • M
      s390/mm,tlb: optimize TLB flushing for zEC12 · 1b948d6c
      Martin Schwidefsky 提交于
      The zEC12 machines introduced the local-clearing control for the IDTE
      and IPTE instruction. If the control is set only the TLB of the local
      CPU is cleared of entries, either all entries of a single address space
      for IDTE, or the entry for a single page-table entry for IPTE.
      Without the local-clearing control the TLB flush is broadcasted to all
      CPUs in the configuration, which is expensive.
      
      The reset of the bit mask of the CPUs that need flushing after a
      non-local IDTE is tricky. As TLB entries for an address space remain
      in the TLB even if the address space is detached a new bit field is
      required to keep track of attached CPUs vs. CPUs in the need of a
      flush. After a non-local flush with IDTE the bit-field of attached CPUs
      is copied to the bit-field of CPUs in need of a flush. The ordering
      of operations on cpu_attach_mask, attach_count and mm_cpumask(mm) is
      such that an underindication in mm_cpumask(mm) is prevented but an
      overindication in mm_cpumask(mm) is possible.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      1b948d6c
    • T
      s390/irq: Use defines for external interruption codes · 1dad093b
      Thomas Huth 提交于
      Use the new defines for external interruption codes to get rid
      of "magic" numbers in the s390 source code. And while we're at it,
      also rename the (un-)register_external_interrupt function to
      something shorter so that this patch does not exceed the 80
      columns all over the place.
      Signed-off-by: NThomas Huth <thuth@linux.vnet.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      1dad093b
  8. 20 3月, 2014 1 次提交
    • S
      s390, smp: Fix CPU hotplug callback registration · f4edbcd5
      Srivatsa S. Bhat 提交于
      Subsystems that want to register CPU hotplug callbacks, as well as perform
      initialization for the CPUs that are already online, often do it as shown
      below:
      
      	get_online_cpus();
      
      	for_each_online_cpu(cpu)
      		init_cpu(cpu);
      
      	register_cpu_notifier(&foobar_cpu_notifier);
      
      	put_online_cpus();
      
      This is wrong, since it is prone to ABBA deadlocks involving the
      cpu_add_remove_lock and the cpu_hotplug.lock (when running concurrently
      with CPU hotplug operations).
      
      Instead, the correct and race-free way of performing the callback
      registration is:
      
      	cpu_notifier_register_begin();
      
      	for_each_online_cpu(cpu)
      		init_cpu(cpu);
      
      	/* Note the use of the double underscored version of the API */
      	__register_cpu_notifier(&foobar_cpu_notifier);
      
      	cpu_notifier_register_done();
      
      Fix the smp code in s390 by using this latter form of callback registration.
      
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@kernel.org>
      Signed-off-by: NSrivatsa S. Bhat <srivatsa.bhat@linux.vnet.ibm.com>
      Signed-off-by: NRafael J. Wysocki <rafael.j.wysocki@intel.com>
      f4edbcd5
  9. 17 3月, 2014 1 次提交
  10. 19 12月, 2013 1 次提交
  11. 16 12月, 2013 2 次提交
  12. 31 10月, 2013 1 次提交
  13. 24 10月, 2013 2 次提交
  14. 07 9月, 2013 1 次提交
  15. 15 7月, 2013 1 次提交
    • P
      s390: delete __cpuinit usage from all s390 files · e2741f17
      Paul Gortmaker 提交于
      The __cpuinit type of throwaway sections might have made sense
      some time ago when RAM was more constrained, but now the savings
      do not offset the cost and complications.  For example, the fix in
      commit 5e427ec2 ("x86: Fix bit corruption at CPU resume time")
      is a good example of the nasty type of bugs that can be created
      with improper use of the various __init prefixes.
      
      After a discussion on LKML[1] it was decided that cpuinit should go
      the way of devinit and be phased out.  Once all the users are gone,
      we can then finally remove the macros themselves from linux/init.h.
      
      Note that some harmless section mismatch warnings may result, since
      notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
      are flagged as __cpuinit  -- so if we remove the __cpuinit from
      arch specific callers, we will also get section mismatch warnings.
      As an intermediate step, we intend to turn the linux/init.h cpuinit
      content into no-ops as early as possible, since that will get rid
      of these warnings.  In any case, they are temporary and harmless.
      
      This removes all the arch/s390 uses of the __cpuinit macros from
      all C files.  Currently s390 does not have any __CPUINIT used in
      assembly files.
      
      [1] https://lkml.org/lkml/2013/5/20/589
      
      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: NPaul Gortmaker <paul.gortmaker@windriver.com>
      e2741f17
  16. 27 6月, 2013 1 次提交
  17. 27 5月, 2013 1 次提交
    • H
      s390/smp: lost IPIs on cpu hotplug · 9acf73b7
      Heiko Carstens 提交于
      IPIs might be lost when a cpu gets brought offline:
      
      When stop_machine executes its state machine there is a race window
      for the state STOPMACHINE_DISABLE_IRQ where the to be brought offline
      cpu might already have irqs disabled but a different cpu still may
      have irqs enabled.
      If the enabled cpu receives an interrupt and as a result sends an IPI
      to the to be offlined cpu in its bottom halve context, the IPI won't
      be noticed before the cpu is offline.
      
      In fact the race window is much larger since there is no guarantee
      when an IPI will be received.
      
      To fix this check for enqueued but not yet received IPIs in the
      cpu_disable() path and call the respective handlers before the cpu
      is marked offline.
      Reported-by: NJuergen Doelle <juergen.doelle@de.ibm.com>
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      9acf73b7
  18. 17 5月, 2013 1 次提交
    • M
      s390/smp: fix cpu re-scan vs. cpu state · a4eeea4e
      Martin Schwidefsky 提交于
      The cpu-info array starts with a list of cpus in configured state,
      followed by the cpus in standby state. The comparison to decide which
      state a cpu has is incorrect, this causes configured cpus appear as
      standby cpus. The correct comparison is the index of the new cpu in
      the cpu-info array vs. the number of configured cpus.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      a4eeea4e
  19. 26 4月, 2013 1 次提交
  20. 08 4月, 2013 1 次提交
  21. 14 2月, 2013 1 次提交
  22. 08 1月, 2013 3 次提交
  23. 04 1月, 2013 1 次提交
    • G
      ARCH: drivers remove __dev* attributes. · b881bc46
      Greg Kroah-Hartman 提交于
      This fixes up all of the smaller arches that had __dev* markings for
      their platform-specific drivers.
      
      CONFIG_HOTPLUG is going away as an option.  As a result, the __dev*
      markings need to be removed.
      
      This change removes the use of __devinit, __devexit_p, __devinitdata,
      __devinitconst, and __devexit from these drivers.
      
      Based on patches originally written by Bill Pemberton, but redone by me
      in order to handle some of the coding style issues better, by hand.
      
      Cc: Bill Pemberton <wfp5p@virginia.edu>
      Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Arnaldo Carvalho de Melo <acme@ghostprotocols.net>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Haavard Skinnemoen <hskinnemoen@gmail.com>
      Cc: Hans-Christian Egtvedt <egtvedt@samfundet.no>
      Cc: Mike Frysinger <vapier@gentoo.org>
      Cc: Mikael Starvik <starvik@axis.com>
      Cc: Jesper Nilsson <jesper.nilsson@axis.com>
      Cc: David Howells <dhowells@redhat.com>
      Cc: Hirokazu Takata <takata@linux-m32r.org>
      Cc: Geert Uytterhoeven <geert@linux-m68k.org>
      Cc: Michal Simek <monstr@monstr.eu>
      Cc: Koichi Yasutake <yasutake.koichi@jp.panasonic.com>
      Cc: Jonas Bonn <jonas@southpole.se>
      Cc: "James E.J. Bottomley" <jejb@parisc-linux.org>
      Cc: Helge Deller <deller@gmx.de>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Chen Liqin <liqin.chen@sunplusct.com>
      Cc: Lennox Wu <lennox.wu@gmail.com>
      Cc: Paul Mundt <lethal@linux-sh.org>
      Cc: Chris Metcalf <cmetcalf@tilera.com>
      Cc: Guan Xuetao <gxt@mprc.pku.edu.cn>
      Cc: Bob Liu <lliubbo@gmail.com>
      Cc: Srinivas Kandagatla <srinivas.kandagatla@st.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: Myron Stowe <myron.stowe@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Andi Kleen <ak@linux.intel.com>
      Cc: Jesse Barnes <jbarnes@virtuousgeek.org>
      Cc: Sebastian Andrzej Siewior <sebastian@breakpoint.cc>
      Cc: Yinghai Lu <yinghai@kernel.org>
      Cc: Thierry Reding <thierry.reding@avionic-design.de>
      Cc: Greg Ungerer <gerg@uclinux.org>
      Cc: Grant Likely <grant.likely@secretlab.ca>
      Cc: "Srivatsa S. Bhat" <srivatsa.bhat@linux.vnet.ibm.com>
      Cc: Mark Salter <msalter@redhat.com>
      Cc: Yong Zhang <yong.zhang0@gmail.com>
      Cc: Michael Holzheu <holzheu@linux.vnet.ibm.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Cc: Jan Glauber <jang@linux.vnet.ibm.com>
      Cc: Wei Yongjun <yongjun_wei@trendmicro.com.cn>
      Cc: Nobuhiro Iwamatsu <nobuhiro.iwamatsu.yj@renesas.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      b881bc46
  24. 26 9月, 2012 5 次提交
  25. 20 7月, 2012 2 次提交
    • M
      s390/vtimer: rework virtual timer interface · 27f6b416
      Martin Schwidefsky 提交于
      The current virtual timer interface is inherently per-cpu and hard to
      use. The sole user of the interface is appldata which uses it to execute
      a function after a specific amount of cputime has been used over all cpus.
      
      Rework the virtual timer interface to hook into the cputime accounting.
      This makes the interface independent from the CPU timer interrupts, and
      makes the virtual timers global as opposed to per-cpu.
      Overall the code is greatly simplified. The downside is that the accuracy
      is not as good as the original implementation, but it is still good enough
      for appldata.
      Reviewed-by: NJan Glauber <jang@linux.vnet.ibm.com>
      Reviewed-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      27f6b416
    • H
      s390/comments: unify copyright messages and remove file names · a53c8fab
      Heiko Carstens 提交于
      Remove the file name from the comment at top of many files. In most
      cases the file name was wrong anyway, so it's rather pointless.
      
      Also unify the IBM copyright statement. We did have a lot of sightly
      different statements and wanted to change them one after another
      whenever a file gets touched. However that never happened. Instead
      people start to take the old/"wrong" statements to use as a template
      for new files.
      So unify all of them in one go.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      a53c8fab