1. 23 8月, 2017 1 次提交
  2. 26 7月, 2017 1 次提交
    • M
      s390/time: add support for the TOD clock epoch extension · 6e2ef5e4
      Martin Schwidefsky 提交于
      The TOD epoch extension adds 8 epoch bits to the TOD clock to provide
      a continuous clock after 2042/09/17. The store-clock-extended (STCKE)
      instruction will store the epoch index in the first byte of the
      16 bytes stored by the instruction. The read_boot_clock64 and the
      read_presistent_clock64 functions need to take the additional bits
      into account to give the correct result after 2042/09/17.
      
      The clock-comparator register will stay 64 bit wide. The comparison
      of the clock-comparator with the TOD clock is limited to bytes
      1 to 8 of the extended TOD format. To deal with the overflow problem
      due to an epoch change the clock-comparator sign control in CR0 can
      be used to switch the comparison of the 64-bit TOD clock with the
      clock-comparator to a signed comparison.
      
      The decision between the signed vs. unsigned clock-comparator
      comparisons is done at boot time. Only if the TOD clock is in the
      second half of a 142 year epoch the signed comparison is used.
      This solves the epoch overflow issue as long as the machine is
      booted at least once in an epoch.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      6e2ef5e4
  3. 12 4月, 2017 1 次提交
  4. 22 3月, 2017 4 次提交
    • H
      s390/dump_stack: use control program identification string · 2f8876f9
      Heiko Carstens 提交于
      If running within a level 3 hypervisor, the hypervisor provides a
      SYSIB block which contains a control program indentifier string. Use
      this string instead of the simple KVM and z/VM strings only. In case
      of z/VM this provides addtional information: the z/VM version.
      
      The new string looks similar to this:
      
      Hardware name: IBM 2964 N96 702 (z/VM 6.4.0)
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      2f8876f9
    • H
      s390/dump_stack: remove whitespace from arch description · d2f03974
      Heiko Carstens 提交于
      The arch description provided for the "Hardware name:" contains lots
      of extra whitespace due to the way the SYSIB contents are defined
      (strings aren't zero terminated).
      This looks a bit odd and therefore remove the extra whitespace
      characters. This also gives the opportunity to add more information,
      if required, without hitting the magic 80 characters per line limit.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      d2f03974
    • H
      s390/topology: fix typo in early topology code · 4fd4dd8b
      Heiko Carstens 提交于
      Use MACHINE_FLAG_TOPOLOGY instead of MACHINE_HAS_TOPOLOGY when
      clearing the bit that indicates if the machine provides topology
      information (and if it should be used). Currently works anyway.
      
      Fixes: 68cc795d ("s390/topology: make "topology=off" parameter work")
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      4fd4dd8b
    • M
      s390: add a system call for guarded storage · 916cda1a
      Martin Schwidefsky 提交于
      This adds a new system call to enable the use of guarded storage for
      user space processes. The system call takes two arguments, a command
      and pointer to a guarded storage control block:
      
          s390_guarded_storage(int command, struct gs_cb *gs_cb);
      
      The second argument is relevant only for the GS_SET_BC_CB command.
      
      The commands in detail:
      
      0 - GS_ENABLE
          Enable the guarded storage facility for the current task. The
          initial content of the guarded storage control block will be
          all zeros. After the enablement the user space code can use
          load-guarded-storage-controls instruction (LGSC) to load an
          arbitrary control block. While a task is enabled the kernel
          will save and restore the current content of the guarded
          storage registers on context switch.
      1 - GS_DISABLE
          Disables the use of the guarded storage facility for the current
          task. The kernel will cease to save and restore the content of
          the guarded storage registers, the task specific content of
          these registers is lost.
      2 - GS_SET_BC_CB
          Set a broadcast guarded storage control block. This is called
          per thread and stores a specific guarded storage control block
          in the task struct of the current task. This control block will
          be used for the broadcast event GS_BROADCAST.
      3 - GS_CLEAR_BC_CB
          Clears the broadcast guarded storage control block. The guarded-
          storage control block is removed from the task struct that was
          established by GS_SET_BC_CB.
      4 - GS_BROADCAST
          Sends a broadcast to all thread siblings of the current task.
          Every sibling that has established a broadcast guarded storage
          control block will load this control block and will be enabled
          for guarded storage. The broadcast guarded storage control block
          is used up, a second broadcast without a refresh of the stored
          control block with GS_SET_BC_CB will not have any effect.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      916cda1a
  5. 08 2月, 2017 1 次提交
    • M
      s390: add no-execute support · 57d7f939
      Martin Schwidefsky 提交于
      Bit 0x100 of a page table, segment table of region table entry
      can be used to disallow code execution for the virtual addresses
      associated with the entry.
      
      There is one tricky bit, the system call to return from a signal
      is part of the signal frame written to the user stack. With a
      non-executable stack this would stop working. To avoid breaking
      things the protection fault handler checks the opcode that caused
      the fault for 0x0a77 (sys_sigreturn) and 0x0aad (sys_rt_sigreturn)
      and injects a system call. This is preferable to the alternative
      solution with a stub function in the vdso because it works for
      vdso=off and statically linked binaries as well.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      57d7f939
  6. 16 1月, 2017 1 次提交
    • H
      s390/topology: make "topology=off" parameter work · 68cc795d
      Heiko Carstens 提交于
      The "topology=off" kernel parameter is supposed to prevent the kernel
      to use hardware topology information to generate scheduling domains
      etc.
      For an unknown reason I implemented this in a very odd way back then:
      instead of simply clearing the MACHINE_HAS_TOPOLOGY flag within the
      lowcore I added a second variable which indicated that topology
      information should not be used. This is more than suboptimal since it
      partially doesn't work.  For the fake NUMA case topology information
      is still considered and scheduling domains will be created based on
      this.
      To fix this and to simplify the code get rid of the extra variable and
      implement the "topology=off" case like it is done for other features.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      68cc795d
  7. 14 12月, 2016 1 次提交
  8. 12 12月, 2016 1 次提交
  9. 11 11月, 2016 1 次提交
    • M
      s390/preempt: move preempt_count to the lowcore · c360192b
      Martin Schwidefsky 提交于
      Convert s390 to use a field in the struct lowcore for the CPU
      preemption count. It is a bit cheaper to access a lowcore field
      compared to a thread_info variable and it removes the depencency
      on a task related structure.
      
      bloat-o-meter on the vmlinux image for the default configuration
      (CONFIG_PREEMPT_NONE=y) reports a small reduction in text size:
      
      add/remove: 0/0 grow/shrink: 18/578 up/down: 228/-5448 (-5220)
      
      A larger improvement is achieved with the default configuration
      but with CONFIG_PREEMPT=y and CONFIG_DEBUG_PREEMPT=n:
      
      add/remove: 2/6 grow/shrink: 59/4477 up/down: 1618/-228762 (-227144)
      Reviewed-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      c360192b
  10. 28 10月, 2016 1 次提交
  11. 20 9月, 2016 1 次提交
    • P
      s390: migrate exception table users off module.h and onto extable.h · dcc096c5
      Paul Gortmaker 提交于
      These files were only including module.h for exception table
      related functions.  We've now separated that content out into its
      own file "extable.h" so now move over to that and avoid all the
      extra header content in module.h that we don't really need to compile
      these files.
      
      The additions of uaccess.h are to deal with implict includes like:
      
      arch/s390/kernel/traps.c: In function 'do_report_trap':
      arch/s390/kernel/traps.c:56:4: error: implicit declaration of function 'extable_fixup' [-Werror=implicit-function-declaration]
      arch/s390/kernel/traps.c: In function 'illegal_op':
      arch/s390/kernel/traps.c:173:3: error: implicit declaration of function 'get_user' [-Werror=implicit-function-declaration]
      
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: linux-s390@vger.kernel.org
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      dcc096c5
  12. 13 6月, 2016 2 次提交
  13. 09 2月, 2016 1 次提交
  14. 19 1月, 2016 2 次提交
  15. 27 11月, 2015 1 次提交
    • M
      s390/dump: rework CPU register dump code · 1a36a39e
      Martin Schwidefsky 提交于
      To collect the CPU registers of the crashed system allocated a single
      page with memblock_alloc_base and use it as a copy buffer. Replace the
      stop-and-store-status sigp with a store-status-at-address sigp in
      smp_save_dump_cpus() and smp_store_status(). In both cases the target
      CPU is already stopped and store-status-at-address avoids the detour
      via the absolute zero page.
      
      For kexec simplify s390_reset_system and call store_status() before
      the prefix register of the boot CPU has been set to zero. Use STPX
      to store the prefix register and remove dump_prefix_page.
      Acked-by: NMichael Holzheu <holzheu@linux.vnet.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      1a36a39e
  16. 14 10月, 2015 2 次提交
  17. 25 3月, 2015 1 次提交
    • H
      s390: remove 31 bit support · 5a79859a
      Heiko Carstens 提交于
      Remove the 31 bit support in order to reduce maintenance cost and
      effectively remove dead code. Since a couple of years there is no
      distribution left that comes with a 31 bit kernel.
      
      The 31 bit kernel also has been broken since more than a year before
      anybody noticed. In addition I added a removal warning to the kernel
      shown at ipl for 5 minutes: a960062e ("s390: add 31 bit warning
      message") which let everybody know about the plan to remove 31 bit
      code. We didn't get any response.
      
      Given that the last 31 bit only machine was introduced in 1999 let's
      remove the code.
      Anybody with 31 bit user space code can still use the compat mode.
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      5a79859a
  18. 20 2月, 2015 1 次提交
  19. 23 1月, 2015 1 次提交
    • M
      s390/spinlock: add compare-and-delay to lock wait loops · 2c72a44e
      Martin Schwidefsky 提交于
      Add the compare-and-delay instruction to the spin-lock and rw-lock
      retry loops. A CPU executing the compare-and-delay instruction stops
      until the lock value has changed. This is done to make the locking
      code for contended locks to behave better in regard to the multi-
      hreading facility. A thread of a core executing a compare-and-delay
      will allow the other threads of a core to get a larger share of the
      core resources.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      2c72a44e
  20. 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
  21. 09 10月, 2014 1 次提交
    • 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
  22. 09 9月, 2014 1 次提交
  23. 20 5月, 2014 1 次提交
  24. 03 4月, 2014 1 次提交
    • 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
  25. 21 2月, 2014 1 次提交
  26. 15 11月, 2013 2 次提交
  27. 24 10月, 2013 1 次提交
    • M
      s390/mm: do not initialize storage keys · 127c1fef
      Martin Schwidefsky 提交于
      With dirty and referenced bits implemented in software it is unnecessary
      to initialize the storage key for every page. With this patch not a single
      storage key operation is done for a system that does not use KVM.
      For KVM set_pte_at/pgste_set_key will do the initialization for the guest
      view of the storage key when the mapping for the page is established in
      the host.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      127c1fef
  28. 02 5月, 2013 1 次提交
  29. 14 2月, 2013 2 次提交
  30. 09 10月, 2012 3 次提交