1. 06 12月, 2018 1 次提交
  2. 31 10月, 2018 2 次提交
  3. 09 10月, 2018 4 次提交
    • V
      s390/kasan: add option for 4-level paging support · 5dff0381
      Vasily Gorbik 提交于
      By default 3-level paging is used when the kernel is compiled with
      kasan support. Add 4-level paging option to support systems with more
      then 3TB of physical memory and to cover 4-level paging specific code
      with kasan as well.
      Reviewed-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      5dff0381
    • V
      s390/kasan: enable stack and global variables access checks · 5e785963
      Vasily Gorbik 提交于
      By defining KASAN_SHADOW_OFFSET in Kconfig stack and global variables
      memory access check instrumentation is enabled. gcc version 4.9.2 or
      newer is also required.
      Reviewed-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      5e785963
    • V
      s390/kasan: add initialization code and enable it · 42db5ed8
      Vasily Gorbik 提交于
      Kasan needs 1/8 of kernel virtual address space to be reserved as the
      shadow area. And eventually it requires the shadow memory offset to be
      known at compile time (passed to the compiler when full instrumentation
      is enabled).  Any value picked as the shadow area offset for 3-level
      paging would eat up identity mapping on 4-level paging (with 1PB
      shadow area size). So, the kernel sticks to 3-level paging when kasan
      is enabled. 3TB border is picked as the shadow offset.  The memory
      layout is adjusted so, that physical memory border does not exceed
      KASAN_SHADOW_START and vmemmap does not go below KASAN_SHADOW_END.
      
      Due to the fact that on s390 paging is set up very late and to cover
      more code with kasan instrumentation, temporary identity mapping and
      final shadow memory are set up early. The shadow memory mapping is
      later carried over to init_mm.pgd during paging_init.
      
      For the needs of paging structures allocation and shadow memory
      population a primitive allocator is used, which simply chops off
      memory blocks from the end of the physical memory.
      
      Kasan currenty doesn't track vmemmap and vmalloc areas.
      
      Current memory layout (for 3-level paging, 2GB physical memory).
      
      ---[ Identity Mapping ]---
      0x0000000000000000-0x0000000000100000
      ---[ Kernel Image Start ]---
      0x0000000000100000-0x0000000002b00000
      ---[ Kernel Image End ]---
      0x0000000002b00000-0x0000000080000000        2G <- physical memory border
      0x0000000080000000-0x0000030000000000     3070G PUD I
      ---[ Kasan Shadow Start ]---
      0x0000030000000000-0x0000030010000000      256M PMD RW X  <- shadow for 2G memory
      0x0000030010000000-0x0000037ff0000000   523776M PTE RO NX <- kasan zero ro page
      0x0000037ff0000000-0x0000038000000000      256M PMD RW X  <- shadow for 2G modules
      ---[ Kasan Shadow End ]---
      0x0000038000000000-0x000003d100000000      324G PUD I
      ---[ vmemmap Area ]---
      0x000003d100000000-0x000003e080000000
      ---[ vmalloc Area ]---
      0x000003e080000000-0x000003ff80000000
      ---[ Modules Area ]---
      0x000003ff80000000-0x0000040000000000        2G
      Acked-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      42db5ed8
    • M
      s390: add support for virtually mapped kernel stacks · ce3dc447
      Martin Schwidefsky 提交于
      With virtually mapped kernel stacks the kernel stack overflow detection
      is now fault based, every stack has a guard page in the vmalloc space.
      The panic_stack is renamed to nodat_stack and is used for all function
      that need to run without DAT, e.g. memcpy_real or do_start_kdump.
      
      The main effect is a reduction in the kernel image size as with vmap
      stacks the old style overflow checking that adds two instructions per
      function is not needed anymore. Result from bloat-o-meter:
      
      add/remove: 20/1 grow/shrink: 13/26854 up/down: 2198/-216240 (-214042)
      
      In regard to performance the micro-benchmark for fork has a hit of a
      few microseconds, allocating 4 pages in vmalloc space is more expensive
      compare to an order-2 page allocation. But with real workload I could
      not find a noticeable difference.
      Acked-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      ce3dc447
  4. 27 9月, 2018 2 次提交
  5. 16 8月, 2018 1 次提交
  6. 14 8月, 2018 1 次提交
  7. 11 8月, 2018 1 次提交
  8. 02 8月, 2018 3 次提交
  9. 25 7月, 2018 2 次提交
    • M
      s390: reenable gcc plugins · 6eedfaac
      Martin Schwidefsky 提交于
      Now that the early boot rework is upstream we can enable the gcc plugins
      again. See git commit 72f108b308707f21499e0ac05bf7370360cf06d8
      "s390: disable gcc plugins" for reference.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      6eedfaac
    • M
      s390: disable gcc plugins · 2a6777a1
      Martin Schwidefsky 提交于
      The s390 build currently fails with the latent entropy plugin:
      
      arch/s390/kernel/als.o: In function `verify_facilities':
      als.c:(.init.text+0x24): undefined reference to `latent_entropy'
      als.c:(.init.text+0xae): undefined reference to `latent_entropy'
      make[3]: *** [arch/s390/boot/compressed/vmlinux] Error 1
      make[2]: *** [arch/s390/boot/compressed/vmlinux] Error 2
      make[1]: *** [bzImage] Error 2
      
      This will be fixed with the early boot rework from Vasily, which
      is planned for the 4.19 merge window.
      
      For 4.18 the simplest solution is to disable the gcc plugins and
      reenable them after the early boot rework is upstream.
      Reported-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      (cherry picked from commit 2fba3573)
      2a6777a1
  10. 24 7月, 2018 1 次提交
    • M
      s390: disable gcc plugins · 2fba3573
      Martin Schwidefsky 提交于
      The s390 build currently fails with the latent entropy plugin:
      
      arch/s390/kernel/als.o: In function `verify_facilities':
      als.c:(.init.text+0x24): undefined reference to `latent_entropy'
      als.c:(.init.text+0xae): undefined reference to `latent_entropy'
      make[3]: *** [arch/s390/boot/compressed/vmlinux] Error 1
      make[2]: *** [arch/s390/boot/compressed/vmlinux] Error 2
      make[1]: *** [bzImage] Error 2
      
      This will be fixed with the early boot rework from Vasily, which
      is planned for the 4.19 merge window.
      
      For 4.18 the simplest solution is to disable the gcc plugins and
      reenable them after the early boot rework is upstream.
      Reported-by: NGuenter Roeck <linux@roeck-us.net>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      2fba3573
  11. 04 7月, 2018 1 次提交
  12. 25 6月, 2018 1 次提交
  13. 08 6月, 2018 1 次提交
    • L
      mm: introduce ARCH_HAS_PTE_SPECIAL · 3010a5ea
      Laurent Dufour 提交于
      Currently the PTE special supports is turned on in per architecture
      header files.  Most of the time, it is defined in
      arch/*/include/asm/pgtable.h depending or not on some other per
      architecture static definition.
      
      This patch introduce a new configuration variable to manage this
      directly in the Kconfig files.  It would later replace
      __HAVE_ARCH_PTE_SPECIAL.
      
      Here notes for some architecture where the definition of
      __HAVE_ARCH_PTE_SPECIAL is not obvious:
      
      arm
       __HAVE_ARCH_PTE_SPECIAL which is currently defined in
      arch/arm/include/asm/pgtable-3level.h which is included by
      arch/arm/include/asm/pgtable.h when CONFIG_ARM_LPAE is set.
      So select ARCH_HAS_PTE_SPECIAL if ARM_LPAE.
      
      powerpc
      __HAVE_ARCH_PTE_SPECIAL is defined in 2 files:
       - arch/powerpc/include/asm/book3s/64/pgtable.h
       - arch/powerpc/include/asm/pte-common.h
      The first one is included if (PPC_BOOK3S & PPC64) while the second is
      included in all the other cases.
      So select ARCH_HAS_PTE_SPECIAL all the time.
      
      sparc:
      __HAVE_ARCH_PTE_SPECIAL is defined if defined(__sparc__) &&
      defined(__arch64__) which are defined through the compiler in
      sparc/Makefile if !SPARC32 which I assume to be if SPARC64.
      So select ARCH_HAS_PTE_SPECIAL if SPARC64
      
      There is no functional change introduced by this patch.
      
      Link: http://lkml.kernel.org/r/1523433816-14460-2-git-send-email-ldufour@linux.vnet.ibm.comSigned-off-by: NLaurent Dufour <ldufour@linux.vnet.ibm.com>
      Suggested-by: NJerome Glisse <jglisse@redhat.com>
      Reviewed-by: NJerome Glisse <jglisse@redhat.com>
      Acked-by: NDavid Rientjes <rientjes@google.com>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: "Aneesh Kumar K . V" <aneesh.kumar@linux.vnet.ibm.com>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Jonathan Corbet <corbet@lwn.net>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will.deacon@arm.com>
      Cc: Yoshinori Sato <ysato@users.sourceforge.jp>
      Cc: Rich Felker <dalias@libc.org>
      Cc: David S. Miller <davem@davemloft.net>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Vineet Gupta <vgupta@synopsys.com>
      Cc: Palmer Dabbelt <palmer@sifive.com>
      Cc: Albert Ou <albert@sifive.com>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: David Rientjes <rientjes@google.com>
      Cc: Robin Murphy <robin.murphy@arm.com>
      Cc: Christophe LEROY <christophe.leroy@c-s.fr>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      3010a5ea
  14. 30 5月, 2018 1 次提交
    • U
      s390/net: add pnetid support · b6ef86e9
      Ursula Braun 提交于
      s390 hardware supports the definition of a so-call Physical NETwork
      IDentifier (short PNETID) per network device port. These PNETIDS
      can be used to identify network devices that are attached to the same
      physical network (broadcast domain).
      
      This patch provides the interface to extract the PNETID of a port of
      a device attached to the ccw-bus or pci-bus.
      
      Parts of this patch are based on an initial implementation by
      Thomas Richter.
      Signed-off-by: NUrsula Braun <ubraun@linux.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      b6ef86e9
  15. 25 5月, 2018 1 次提交
    • U
      s390/net: add pnetid support · 866f4c8e
      Ursula Braun 提交于
      s390 hardware supports the definition of a so-call Physical NETwork
      IDentifier (short PNETID) per network device port. These PNETIDS
      can be used to identify network devices that are attached to the same
      physical network (broadcast domain).
      
      This patch provides the interface to extract the PNETID of a port of
      a device attached to the ccw-bus or pci-bus.
      
      Parts of this patch are based on an initial implementation by
      Thomas Richter.
      Signed-off-by: NUrsula Braun <ubraun@linux.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      866f4c8e
  16. 09 5月, 2018 4 次提交
  17. 08 5月, 2018 1 次提交
  18. 16 4月, 2018 4 次提交
  19. 28 3月, 2018 2 次提交
  20. 08 2月, 2018 1 次提交
  21. 07 2月, 2018 1 次提交
    • M
      s390: introduce execute-trampolines for branches · f19fbd5e
      Martin Schwidefsky 提交于
      Add CONFIG_EXPOLINE to enable the use of the new -mindirect-branch= and
      -mfunction_return= compiler options to create a kernel fortified against
      the specte v2 attack.
      
      With CONFIG_EXPOLINE=y all indirect branches will be issued with an
      execute type instruction. For z10 or newer the EXRL instruction will
      be used, for older machines the EX instruction. The typical indirect
      call
      
      	basr	%r14,%r1
      
      is replaced with a PC relative call to a new thunk
      
      	brasl	%r14,__s390x_indirect_jump_r1
      
      The thunk contains the EXRL/EX instruction to the indirect branch
      
      __s390x_indirect_jump_r1:
      	exrl	0,0f
      	j	.
      0:	br	%r1
      
      The detour via the execute type instruction has a performance impact.
      To get rid of the detour the new kernel parameter "nospectre_v2" and
      "spectre_v2=[on,off,auto]" can be used. If the parameter is specified
      the kernel and module code will be patched at runtime.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      f19fbd5e
  22. 05 2月, 2018 1 次提交
  23. 01 2月, 2018 1 次提交
  24. 15 1月, 2018 1 次提交
  25. 16 11月, 2017 1 次提交