1. 08 Jun, 2018 1 commit
    • Dave Martin's avatar
      arm64: Fix syscall restarting around signal suppressed by tracer · 0fe42512
      Dave Martin authored
      Commit 17c28958 ("arm64: Abstract syscallno manipulation") abstracts
      out the pt_regs.syscallno value for a syscall cancelled by a tracer
      as NO_SYSCALL, and provides helpers to set and check for this
      condition.  However, the way this was implemented has the
      unintended side-effect of disabling part of the syscall restart
      logic.
      
      This comes about because the second in_syscall() check in
      do_signal() re-evaluates the "in a syscall" condition based on the
      updated pt_regs instead of the original pt_regs.  forget_syscall()
      is explicitly called prior to the second check in order to prevent
      restart logic in the ret_to_user path being spuriously triggered,
      which means that the second in_syscall() check always yields false.
      
      This triggers a failure in
      tools/testing/selftests/seccomp/seccomp_bpf.c, when using ptrace to
      suppress a signal that interrups a nanosleep() syscall.
      
      Misbehaviour of this type is only expected in the case where a
      tracer suppresses a signal and the target process is either being
      single-stepped or the interrupted syscall attempts to restart via
      -ERESTARTBLOCK.
      
      This patch restores the old behaviour by performing the
      in_syscall() check only once at the start of the function.
      
      Fixes: 17c28958 ("arm64: Abstract syscallno manipulation")
      Signed-off-by: default avatarDave Martin <Dave.Martin@arm.com>
      Reported-by: default avatarSumit Semwal <sumit.semwal@linaro.org>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: <stable@vger.kernel.org> # 4.14.x-
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      0fe42512
  2. 07 Jun, 2018 1 commit
    • Jeremy Linton's avatar
      arm64: topology: Avoid checking numa mask for scheduler MC selection · e156ab71
      Jeremy Linton authored
      The numa mask subset check can often lead to system hang or crash during
      CPU hotplug and system suspend operation if NUMA is disabled. This is
      mostly observed on HMP systems where the CPU compute capacities are
      different and ends up in different scheduler domains. Since
      cpumask_of_node is returned instead core_sibling, the scheduler is
      confused with incorrect cpumasks(e.g. one CPU in two different sched
      domains at the same time) on CPU hotplug.
      
      Lets disable the NUMA siblings checks for the time being, as NUMA in
      socket machines have LLC's that will assure that the scheduler topology
      isn't "borken".
      
      The NUMA check exists to assure that if a LLC within a socket crosses
      NUMA nodes/chiplets the scheduler domains remain consistent. This code will
      likely have to be re-enabled in the near future once the NUMA mask story
      is sorted.  At the moment its not necessary because the NUMA in socket
      machines LLC's are contained within the NUMA domains.
      
      Further, as a defensive mechanism during hot-plug, lets assure that the
      LLC siblings are also masked.
      Reported-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Reviewed-by: default avatarSudeep Holla <sudeep.holla@arm.com>
      Tested-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Signed-off-by: default avatarJeremy Linton <jeremy.linton@arm.com>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      e156ab71
  3. 05 Jun, 2018 2 commits
  4. 02 Jun, 2018 1 commit
  5. 01 Jun, 2018 2 commits
    • Dave Martin's avatar
      arm64: signal: Report signal frame size to userspace via auxv · 94b07c1f
      Dave Martin authored
      Stateful CPU architecture extensions may require the signal frame
      to grow to a size that exceeds the arch's MINSIGSTKSZ #define.
      However, changing this #define is an ABI break.
      
      To allow userspace the option of determining the signal frame size
      in a more forwards-compatible way, this patch adds a new auxv entry
      tagged with AT_MINSIGSTKSZ, which provides the maximum signal frame
      size that the process can observe during its lifetime.
      
      If AT_MINSIGSTKSZ is absent from the aux vector, the caller can
      assume that the MINSIGSTKSZ #define is sufficient.  This allows for
      a consistent interface with older kernels that do not provide
      AT_MINSIGSTKSZ.
      
      The idea is that libc could expose this via sysconf() or some
      similar mechanism.
      
      There is deliberately no AT_SIGSTKSZ.  The kernel knows nothing
      about userspace's own stack overheads and should not pretend to
      know.
      
      For arm64:
      
      The primary motivation for this interface is the Scalable Vector
      Extension, which can require at least 4KB or so of extra space
      in the signal frame for the largest hardware implementations.
      
      To determine the correct value, a "Christmas tree" mode (via the
      add_all argument) is added to setup_sigframe_layout(), to simulate
      addition of all possible records to the signal frame at maximum
      possible size.
      
      If this procedure goes wrong somehow, resulting in a stupidly large
      frame layout and hence failure of sigframe_alloc() to allocate a
      record to the frame, then this is indicative of a kernel bug.  In
      this case, we WARN() and no attempt is made to populate
      AT_MINSIGSTKSZ for userspace.
      
      For arm64 SVE:
      
      The SVE context block in the signal frame needs to be considered
      too when computing the maximum possible signal frame size.
      
      Because the size of this block depends on the vector length, this
      patch computes the size based not on the thread's current vector
      length but instead on the maximum possible vector length: this
      determines the maximum size of SVE context block that can be
      observed in any signal frame for the lifetime of the process.
      Signed-off-by: default avatarDave Martin <Dave.Martin@arm.com>
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Cc: Ard Biesheuvel <ard.biesheuvel@linaro.org>
      Cc: Alex Bennée <alex.bennee@linaro.org>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      94b07c1f
    • Dave Martin's avatar
      arm64/sve: Thin out initialisation sanity-checks for sve_max_vl · 87c021a8
      Dave Martin authored
      Now that the kernel SVE support is reasonably mature, it is
      excessive to default sve_max_vl to the invalid value -1 and then
      sprinkle WARN_ON()s around the place to make sure it has been
      initialised before use.  The cpufeatures code already runs pretty
      early, and will ensure sve_max_vl gets initialised.
      
      This patch initialises sve_max_vl to something sane that will be
      supported by every SVE implementation, and removes most of the
      sanity checks.
      
      The checks in find_supported_vector_length() are retained for now.
      If anything goes horribly wrong, we are likely to trip a check here
      sooner or later.
      Signed-off-by: default avatarDave Martin <Dave.Martin@arm.com>
      Acked-by: default avatarWill Deacon <will.deacon@arm.com>
      Signed-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
      87c021a8
  6. 31 May, 2018 15 commits
  7. 29 May, 2018 2 commits
  8. 23 May, 2018 3 commits
  9. 22 May, 2018 1 commit
  10. 21 May, 2018 7 commits
  11. 17 May, 2018 5 commits