1. 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
  2. 31 May, 2018 15 commits
  3. 29 May, 2018 2 commits
  4. 23 May, 2018 3 commits
  5. 22 May, 2018 1 commit
  6. 21 May, 2018 7 commits
  7. 17 May, 2018 10 commits