1. 14 Sep, 2022 6 commits
    • Alexander Gordeev's avatar
      s390/dump: save IPL CPU registers once DAT is available · 14a3a262
      Alexander Gordeev authored
      Function smp_save_dump_cpus() collects CPU state of a crashed
      system for secondary CPUs and for the IPL CPU very differently.
      The Signal Processor stop-and-store-status orders are used for
      the former while Hardware System Area requests and memcpy_real()
      routine are called for the latter. In addition a system reset is
      triggered, which pins smp_save_dump_cpus() function call before
      CPU and device initialization.
      
      Move the collection of IPL CPU state to a later stage when DAT
      becomes available. That is needed to allow a follow-up rework of
      memcpy_real() routine.
      Reviewed-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      14a3a262
    • Niklas Schnelle's avatar
      s390/pci: convert high_memory to physical address · 2187582c
      Niklas Schnelle authored
      We use high_memory as a measure for amount of memory available in
      determining the required minimum size of our IOVA space with the
      assumption that one rarely maps more than the available memory for DMA.
      In special cases like mapping significant amounts of memory more than
      once this can still be tuned with the s390_iommu_apterture kernel
      parameter. In this use case high_memory is treated as a physical
      address. As high_memory is a virtual address however this means we need
      to convert it using virt_to_phys() before use
      
      Note that at the moment physical and virtual addresses are identical so
      this mismatch does not currently cause trouble.
      Reviewed-by: default avatarMatthew Rosato <mjrosato@linux.ibm.com>
      Signed-off-by: default avatarNiklas Schnelle <schnelle@linux.ibm.com>
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      2187582c
    • Alexander Gordeev's avatar
      s390/smp,ptdump: add absolute lowcore markers · 50787755
      Alexander Gordeev authored
      Add "Lowcore Area Start" and "Lowcore Area End" markers
      that fence pages where absolute lowcore resides.
      Reviewed-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      50787755
    • Alexander Gordeev's avatar
      s390/smp: rework absolute lowcore access · 4df29d2b
      Alexander Gordeev authored
      Temporary unsetting of the prefix page in memcpy_absolute() routine
      poses a risk of executing code path with unexpectedly disabled prefix
      page. This rework avoids the prefix page uninstalling and disabling
      of normal and machine check interrupts when accessing the absolute
      zero memory.
      
      Although memcpy_absolute() routine can access the whole memory, it is
      only used to update the absolute zero lowcore. This rework therefore
      introduces a new mechanism for the absolute zero lowcore access and
      scraps memcpy_absolute() routine for good.
      
      Instead, an area is reserved in the virtual memory that is used for
      the absolute lowcore access only. That area holds an array of 8KB
      virtual mappings - one per CPU. Whenever a CPU is brought online, the
      corresponding item is mapped to the real address of the previously
      installed prefix page.
      
      The absolute zero lowcore access works like this: a CPU calls the
      new primitive get_abs_lowcore() to obtain its 8KB mapping as a
      pointer to the struct lowcore. Virtual address references to that
      pointer get translated to the real addresses of the prefix page,
      which in turn gets swapped with the absolute zero memory addresses
      due to prefixing. Once the pointer is not needed it must be released
      with put_abs_lowcore() primitive:
      
      	struct lowcore *abs_lc;
      	unsigned long flags;
      
      	abs_lc = get_abs_lowcore(&flags);
      	abs_lc->... = ...;
      	put_abs_lowcore(abs_lc, flags);
      
      To ensure the described mechanism works large segment- and region-
      table entries must be avoided for the 8KB mappings. Failure to do
      so results in usage of Region-Frame Absolute Address (RFAA) or
      Segment-Frame Absolute Address (SFAA) large page fields. In that
      case absolute addresses would be used to address the prefix page
      instead of the real ones and the prefixing would get bypassed.
      Reviewed-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      4df29d2b
    • Alexander Gordeev's avatar
      s390/smp: call smp_reinit_ipl_cpu() before scheduler is available · 6cbd7cc2
      Alexander Gordeev authored
      Currently smp_reinit_ipl_cpu() is a pre-SMP early initcall.
      That ensures no CPU is running in parallel, but still not
      enough to assume the code is exclusive, since the scheduling
      is already available.
      
      Move the function call to arch_call_rest_init() callback
      to ensure no thread could be preempted and allow lockless
      allocation of the kernel page tables. That is needed to
      allow a follow-up rework of the absolute lowcore access
      mechanism.
      Suggested-by: default avatarHeiko Carstens <hca@linux.ibm.com>
      Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      6cbd7cc2
    • Vasily Gorbik's avatar
      Merge branch 'fixes' into features · d61bb30e
      Vasily Gorbik authored
      * fixes:
        s390/smp: enforce lowcore protection on CPU restart
        s390/boot: fix absolute zero lowcore corruption on boot
        s390/hugetlb: fix prepare_hugepage_range() check for 2 GB hugepages
        s390: update defconfigs
        s390: fix nospec table alignments
        s390/mm: remove useless hugepage address alignment
      Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
      d61bb30e
  2. 07 Sep, 2022 4 commits
  3. 30 Aug, 2022 7 commits
  4. 28 Aug, 2022 23 commits