1. 30 4月, 2019 2 次提交
  2. 29 4月, 2019 2 次提交
    • B
      arm64: mmap: Ensure file offset is treated as unsigned · f08cae2f
      Boyang Zhou 提交于
      The file offset argument to the arm64 sys_mmap() implementation is
      scaled from bytes to pages by shifting right by PAGE_SHIFT.
      Unfortunately, the offset is passed in as a signed 'off_t' type and
      therefore large offsets (i.e. with the top bit set) are incorrectly
      sign-extended by the shift. This has been observed to cause false mmap()
      failures when mapping GPU doorbells on an arm64 server part.
      
      Change the type of the file offset argument to sys_mmap() from 'off_t'
      to 'unsigned long' so that the shifting scales the value as expected.
      
      Cc: <stable@vger.kernel.org>
      Signed-off-by: NBoyang Zhou <zhouby_cn@126.com>
      [will: rewrote commit message]
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      f08cae2f
    • W
      arm64: Kconfig: Tidy up errata workaround help text · bc15cf70
      Will Deacon 提交于
      The nature of silicon errata means that the Kconfig help text for our
      various software workarounds has been written by many different people.
      Along the way, we've accumulated typos and inconsistencies which make
      the options needlessly difficult to read.
      
      Fix up minor issues with the help text.
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      bc15cf70
  3. 25 4月, 2019 1 次提交
    • K
      arm64: sysreg: Make mrs_s and msr_s macros work with Clang and LTO · be604c61
      Kees Cook 提交于
      Clang's integrated assembler does not allow assembly macros defined
      in one inline asm block using the .macro directive to be used across
      separate asm blocks. LLVM developers consider this a feature and not a
      bug, recommending code refactoring:
      
        https://bugs.llvm.org/show_bug.cgi?id=19749
      
      As binutils doesn't allow macros to be redefined, this change uses
      UNDEFINE_MRS_S and UNDEFINE_MSR_S to define corresponding macros
      in-place and workaround gcc and clang limitations on redefining macros
      across different assembler blocks.
      
      Specifically, the current state after preprocessing looks like this:
      
      asm volatile(".macro mXX_s ... .endm");
      void f()
      {
      	asm volatile("mXX_s a, b");
      }
      
      With GCC, it gives macro redefinition error because sysreg.h is included
      in multiple source files, and assembler code for all of them is later
      combined for LTO (I've seen an intermediate file with hundreds of
      identical definitions).
      
      With clang, it gives macro undefined error because clang doesn't allow
      sharing macros between inline asm statements.
      
      I also seem to remember catching another sort of undefined error with
      GCC due to reordering of macro definition asm statement and generated
      asm code for function that uses the macro.
      
      The solution with defining and undefining for each use, while certainly
      not elegant, satisfies both GCC and clang, LTO and non-LTO.
      Co-developed-by: NAlex Matveev <alxmtvv@gmail.com>
      Co-developed-by: NYury Norov <ynorov@caviumnetworks.com>
      Co-developed-by: NSami Tolvanen <samitolvanen@google.com>
      Reviewed-by: NNick Desaulniers <ndesaulniers@google.com>
      Reviewed-by: NMark Rutland <mark.rutland@arm.com>
      Signed-off-by: NKees Cook <keescook@chromium.org>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      be604c61
  4. 24 4月, 2019 6 次提交
  5. 17 4月, 2019 1 次提交
  6. 16 4月, 2019 9 次提交
  7. 13 4月, 2019 1 次提交
  8. 12 4月, 2019 1 次提交
    • M
      arm64: vdso: use $(LD) instead of $(CC) to link VDSO · 691efbed
      Masahiro Yamada 提交于
      We use $(LD) to link vmlinux, modules, decompressors, etc.
      
      VDSO is the only exceptional case where $(CC) is used as the linker
      driver, but I do not know why we need to do so. VDSO uses a special
      linker script, and does not link standard libraries at all.
      
      I changed the Makefile to use $(LD) rather than $(CC). I tested this,
      and VDSO worked for me.
      
      Users will be able to use their favorite linker (e.g. lld instead of
      of bfd) by passing LD= from the command line.
      
      My plan is to rewrite all VDSO Makefiles to use $(LD), then delete
      cc-ldoption.
      Signed-off-by: NMasahiro Yamada <yamada.masahiro@socionext.com>
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      691efbed
  9. 11 4月, 2019 1 次提交
    • V
      arm64: compat: Reduce address limit · d2631193
      Vincenzo Frascino 提交于
      Currently, compat tasks running on arm64 can allocate memory up to
      TASK_SIZE_32 (UL(0x100000000)).
      
      This means that mmap() allocations, if we treat them as returning an
      array, are not compliant with the sections 6.5.8 of the C standard
      (C99) which states that: "If the expression P points to an element of
      an array object and the expression Q points to the last element of the
      same array object, the pointer expression Q+1 compares greater than P".
      
      Redefine TASK_SIZE_32 to address the issue.
      
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Jann Horn <jannh@google.com>
      Cc: <stable@vger.kernel.org>
      Reported-by: NJann Horn <jannh@google.com>
      Signed-off-by: NVincenzo Frascino <vincenzo.frascino@arm.com>
      [will: fixed typo in comment]
      Signed-off-by: NWill Deacon <will.deacon@arm.com>
      d2631193
  10. 09 4月, 2019 16 次提交