1. 30 Aug, 2022 2 commits
    • Josh Poimboeuf's avatar
      s390: fix nospec table alignments · c9305b6c
      Josh Poimboeuf authored
      Add proper alignment for .nospec_call_table and .nospec_return_table in
      vmlinux.
      
      [hca@linux.ibm.com]: The problem with the missing alignment of the nospec
      tables exist since a long time, however only since commit e6ed91fd
      ("s390/alternatives: remove padding generation code") and with
      CONFIG_RELOCATABLE=n the kernel may also crash at boot time.
      
      The above named commit reduced the size of struct alt_instr by one byte,
      so its new size is 11 bytes. Therefore depending on the number of cpu
      alternatives the size of the __alt_instructions array maybe odd, which
      again also causes that the addresses of the nospec tables will be odd.
      
      If the address of __nospec_call_start is odd and the kernel is compiled
      With CONFIG_RELOCATABLE=n the compiler may generate code that loads the
      address of __nospec_call_start with a 'larl' instruction.
      
      This will generate incorrect code since the 'larl' instruction only works
      with even addresses. In result the members of the nospec tables will be
      accessed with an off-by-one offset, which subsequently may lead to
      addressing exceptions within __nospec_revert().
      
      Fixes: f19fbd5e ("s390: introduce execute-trampolines for branches")
      Signed-off-by: default avatarJosh Poimboeuf <jpoimboe@kernel.org>
      Link: https://lore.kernel.org/r/8719bf1ce4a72ebdeb575200290094e9ce047bcc.1661557333.git.jpoimboe@kernel.org
      Cc: <stable@vger.kernel.org> # 4.16
      Reviewed-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      c9305b6c
    • Gerald Schaefer's avatar
      s390/mm: remove useless hugepage address alignment · ff03b884
      Gerald Schaefer authored
      The failing address alignment to HPAGE_MASK in do_exception(), for
      hugetlb faults, was useless from the beginning. With 2 GB hugepage
      support it became wrong, but w/o further negative impact. Now it
      could have negative performance impact because it breaks the cacheline
      optimization for process_huge_page().
      
      Therefore, remove it.
      
      Note that we still have failing address alignment by HW to PAGE_SIZE,
      for all page faults, not just hugetlb faults. So this patch will not
      fix UFFD_FEATURE_EXACT_ADDRESS for userfaultfd handling. It will just
      move the failing address for hugetlb faults a bit closer to the real
      address, at 4K page granularity, similar to normal page faults.
      Reviewed-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      Signed-off-by: default avatarGerald Schaefer <gerald.schaefer@linux.ibm.com>
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      ff03b884
  2. 28 Aug, 2022 25 commits
  3. 27 Aug, 2022 13 commits