1. 21 Sep, 2020 1 commit
  2. 17 Sep, 2020 5 commits
  3. 16 Sep, 2020 8 commits
    • Vasily Gorbik's avatar
      s390/kasan: support protvirt with 4-level paging · c360c9a2
      Vasily Gorbik authored
      Currently the kernel crashes in Kasan instrumentation code if
      CONFIG_KASAN_S390_4_LEVEL_PAGING is used on protected virtualization
      capable machine where the ultravisor imposes addressing limitations on
      the host and those limitations are lower then KASAN_SHADOW_OFFSET.
      
      The problem is that Kasan has to know in advance where vmalloc/modules
      areas would be. With protected virtualization enabled vmalloc/modules
      areas are moved down to the ultravisor secure storage limit while kasan
      still expects them at the very end of 4-level paging address space.
      
      To fix that make Kasan recognize when protected virtualization is enabled
      and predefine vmalloc/modules areas position which are compliant with
      ultravisor secure storage limit.
      
      Kasan shadow itself stays in place and might reside above that ultravisor
      secure storage limit.
      
      One slight difference compaired to a kernel without Kasan enabled is that
      vmalloc/modules areas position is not reverted to default if ultravisor
      initialization fails. It would still be below the ultravisor secure
      storage limit.
      
      Kernel layout with kasan, 4-level paging and protected virtualization
      enabled (ultravisor secure storage limit is at 0x0000800000000000):
      ---[ vmemmap Area Start ]---
      0x0000400000000000-0x0000400080000000
      ---[ vmemmap Area End ]---
      ---[ vmalloc Area Start ]---
      0x00007fe000000000-0x00007fff80000000
      ---[ vmalloc Area End ]---
      ---[ Modules Area Start ]---
      0x00007fff80000000-0x0000800000000000
      ---[ Modules Area End ]---
      ---[ Kasan Shadow Start ]---
      0x0018000000000000-0x001c000000000000
      ---[ Kasan Shadow End ]---
      0x001c000000000000-0x0020000000000000         1P PGD I
      
      Kernel layout with kasan, 4-level paging and protected virtualization
      disabled/unsupported:
      ---[ vmemmap Area Start ]---
      0x0000400000000000-0x0000400060000000
      ---[ vmemmap Area End ]---
      ---[ Kasan Shadow Start ]---
      0x0018000000000000-0x001c000000000000
      ---[ Kasan Shadow End ]---
      ---[ vmalloc Area Start ]---
      0x001fffe000000000-0x001fffff80000000
      ---[ vmalloc Area End ]---
      ---[ Modules Area Start ]---
      0x001fffff80000000-0x0020000000000000
      ---[ Modules Area End ]---
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      c360c9a2
    • Vasily Gorbik's avatar
      s390/protvirt: support ultravisor without secure storage limit · c2314cb2
      Vasily Gorbik authored
      Avoid potential crash due to lack of secure storage limit. Check that
      max_sec_stor_addr is not 0 before adjusting vmalloc position.
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      c2314cb2
    • Vasily Gorbik's avatar
      s390/protvirt: parse prot_virt option in the decompressor · 1d6671ae
      Vasily Gorbik authored
      To make early kernel address space layout definition possible parse
      prot_virt option in the decompressor and pass it to the uncompressed
      kernel. This enables kasan to take ultravisor secure storage limit into
      consideration and pre-define vmalloc position correctly.
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      1d6671ae
    • Vasily Gorbik's avatar
      s390/kasan: avoid unnecessary moving of vmemmap · 8f78657c
      Vasily Gorbik authored
      Currently vmemmap area is unconditionally moved beyond Kasan shadow
      memory. When Kasan is not enabled vmemmap area position is calculated
      in setup_memory_end() and depends on limiting factors like ultravisor
      secure storage limit. Try to follow the same logic with Kasan enabled
      as well and avoid unnecessary vmemmap area position changes unless it
      really intersects with Kasan shadow.
      Reviewed-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      8f78657c
    • Vasily Gorbik's avatar
      s390/mm,ptdump: sort markers · ee4b2ce6
      Vasily Gorbik authored
      Kasan configuration options and size of physical memory present could
      affect kernel memory layout. In particular vmemmap, vmalloc and modules
      might come before kasan shadow or after it. To make ptdump correctly
      output markers in the right order markers have to be sorted.
      
      To preserve the original order of markers with the same start address
      avoid using sort() from lib/sort.c (which is not stable sorting algorithm)
      and sort markers in place.
      Reviewed-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      ee4b2ce6
    • Niklas Schnelle's avatar
      s390/pci: add missing pci_iov.h include · 4904e194
      Niklas Schnelle authored
      this fixes a missing prototype compiler warning spotted by the kernel
      test robot.
      
      Fixes: abb95b75 ("s390/pci: consolidate SR-IOV specific code")
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarNiklas Schnelle <schnelle@linux.ibm.com>
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      4904e194
    • Heiko Carstens's avatar
      s390/mm,ptdump: add proper ifdefs · 48111b48
      Heiko Carstens authored
      Use ifdefs instead of IS_ENABLED() to avoid compile error
      for !PTDUMP_DEBUGFS:
      
      arch/s390/mm/dump_pagetables.c: In function ‘pt_dump_init’:
      arch/s390/mm/dump_pagetables.c:248:64: error: ‘ptdump_fops’ undeclared (first use in this function); did you mean ‘pidfd_fops’?
         debugfs_create_file("kernel_page_tables", 0400, NULL, NULL, &ptdump_fops);
      Reported-by: default avatarJulian Wiedmann <jwi@linux.ibm.com>
      Fixes: 08c8e685 ("s390: add ARCH_HAS_DEBUG_WX support")
      Signed-off-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      48111b48
    • Alexander Egorenkov's avatar
      s390/boot: enable .bss section for compressed kernel · 980d5f9a
      Alexander Egorenkov authored
      - Support static uninitialized variables in compressed kernel.
      - Remove chkbss script
      - Get rid of workarounds for not having .bss section
      Signed-off-by: default avatarAlexander Egorenkov <egorenar@linux.ibm.com>
      Reviewed-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      980d5f9a
  4. 14 Sep, 2020 19 commits
  5. 26 Aug, 2020 6 commits
  6. 23 Aug, 2020 1 commit