1. 23 11月, 2020 1 次提交
    • H
      s390/mm: remove set_fs / rework address space handling · 87d59863
      Heiko Carstens 提交于
      Remove set_fs support from s390. With doing this rework address space
      handling and simplify it. As a result address spaces are now setup
      like this:
      
      CPU running in              | %cr1 ASCE | %cr7 ASCE | %cr13 ASCE
      ----------------------------|-----------|-----------|-----------
      user space                  |  user     |  user     |  kernel
      kernel, normal execution    |  kernel   |  user     |  kernel
      kernel, kvm guest execution |  gmap     |  user     |  kernel
      
      To achieve this the getcpu vdso syscall is removed in order to avoid
      secondary address mode and a separate vdso address space in for user
      space. The getcpu vdso syscall will be implemented differently with a
      subsequent patch.
      
      The kernel accesses user space always via secondary address space.
      This happens in different ways:
      - with mvcos in home space mode and directly read/write to secondary
        address space
      - with mvcs/mvcp in primary space mode and copy from primary space to
        secondary space or vice versa
      - with e.g. cs in secondary space mode and access secondary space
      
      Switching translation modes happens with sacf before and after
      instructions which access user space, like before.
      
      Lazy handling of control register reloading is removed in the hope to
      make everything simpler, but at the cost of making kernel entry and
      exit a bit slower. That is: on kernel entry the primary asce is always
      changed to contain the kernel asce, and on kernel exit the primary
      asce is changed again so it contains the user asce.
      
      In kernel mode there is only one exception to the primary asce: when
      kvm guests are executed the primary asce contains the gmap asce (which
      describes the guest address space). The primary asce is reset to
      kernel asce whenever kvm guest execution is interrupted, so that this
      doesn't has to be taken into account for any user space accesses.
      Reviewed-by: NSven Schnelle <svens@linux.ibm.com>
      Signed-off-by: NHeiko Carstens <hca@linux.ibm.com>
      87d59863
  2. 21 11月, 2020 4 次提交
  3. 18 11月, 2020 1 次提交
    • S
      s390/sclp: provide extended sccb support · b971cbd0
      Sumanth Korikkar 提交于
      As the number of cpus increases, the sccb response can exceed 4k for
      read cpu and read scp info sclp commands. Hence, all cpu info entries
      cant be embedded within a sccb response
      
      Solution:
      To overcome this limitation, extended sccb facility is provided by sclp.
      
      1. Check if the extended sccb facility is installed.
      2. If extended sccb is installed, perform the read scp and read cpu
         command considering a max sccb length of three page size. This max
         length is based on factors like max cpus, sccb header.
      3. If extended sccb is not installed, perform the read scp and read cpu
         sclp command considering a max sccb length of one page size.
      Signed-off-by: NSumanth Korikkar <sumanthk@linux.ibm.com>
      Reviewed-by: NVasily Gorbik <gor@linux.ibm.com>
      Signed-off-by: NHeiko Carstens <hca@linux.ibm.com>
      b971cbd0
  4. 12 11月, 2020 1 次提交
  5. 09 11月, 2020 7 次提交
  6. 03 11月, 2020 2 次提交
  7. 26 10月, 2020 2 次提交
  8. 10 10月, 2020 2 次提交
  9. 08 10月, 2020 3 次提交
  10. 02 10月, 2020 3 次提交
  11. 30 9月, 2020 3 次提交
    • V
      s390: remove orphaned function declarations · 402e9228
      Vasily Gorbik 提交于
      arch/s390/pci/pci_bus.h: zpci_bus_init - only declaration left after
      commit 05bc1be6 ("s390/pci: create zPCI bus")
      
      arch/s390/include/asm/gmap.h: gmap_pte_notify - only declaration left
      after commit 4be130a0 ("s390/mm: add shadow gmap support")
      
      arch/s390/include/asm/pgalloc.h: rcu_table_freelist_finish - only
      declaration left after commit 36409f63 ("[S390] use generic RCU
      page-table freeing code")
      
      arch/s390/include/asm/tlbflush.h: smp_ptlb_all - only declaration left
      after commit 5a79859a ("s390: remove 31 bit support")
      
      arch/s390/include/asm/vtimer.h: init_cpu_vtimer - only declaration left
      after commit b5f87f15 ("s390/idle: consolidate idle functions and
      definitions")
      
      arch/s390/include/asm/pci.h: zpci_debug_info - only declaration left
      after commit 386aa051 ("s390/pci: remove per device debug attribute")
      
      arch/s390/include/asm/vdso.h: vdso_alloc_boot_cpu - only declaration
      left after commit 4bff8cb5 ("s390: convert to GENERIC_VDSO")
      
      arch/s390/include/asm/smp.h: smp_vcpu_scheduled - only declaration left
      after commit 67626fad ("s390: enforce CONFIG_SMP")
      
      arch/s390/kernel/entry.h: restart_call_handler - only declaration left
      after commit 8b646bd7 ("[S390] rework smp code")
      
      arch/s390/kernel/entry.h: startup_init_nobss - only declaration left
      after commit 2e83e0eb ("s390: clean .bss before running uncompressed
      kernel")
      
      arch/s390/kernel/entry.h: s390_early_resume - only declaration left after
      commit 39421627 ("s390: remove broken hibernate / power management
      support")
      
      drivers/s390/char/raw3270.h: raw3270_request_alloc_bootmem - only
      declaration left after commit 33403dcf ("[S390] 3270 console:
      convert from bootmem to slab")
      
      drivers/s390/cio/device.h: ccw_device_schedule_sch_unregister - only
      declaration left after commit 37de53bb ("[S390] cio: introduce ccw
      device todos")
      
      drivers/s390/char/tape.h: tape_hotplug_event - has only declaration
      since recorded git history.
      
      drivers/s390/char/tape.h: tape_oper_handler - has only declaration since
      recorded git history.
      
      drivers/s390/char/tape.h: tape_noper_handler - has only declaration
      since recorded git history.
      
      drivers/s390/char/tape_std.h: tape_std_check_locate - only declaration
      left after commit 161beff8 ("s390/tape: remove tape block leftovers")
      
      drivers/s390/char/tape_std.h: tape_std_default_handler - has only
      declaration since recorded git history.
      
      drivers/s390/char/tape_std.h: tape_std_unexpect_uchk_handler - has only
      declaration since recorded git history.
      
      drivers/s390/char/tape_std.h: tape_std_irq - has only declaration since
      recorded git history.
      
      drivers/s390/char/tape_std.h: tape_std_error_recovery - has only
      declaration since recorded git history.
      
      drivers/s390/char/tape_std.h: tape_std_error_recovery_has_failed -
      has only declaration since recorded git history.
      
      drivers/s390/char/tape_std.h: tape_std_error_recovery_succeded - has
      only declaration since recorded git history.
      
      drivers/s390/char/tape_std.h: tape_std_error_recovery_do_retry - has
      only declaration since recorded git history.
      
      drivers/s390/char/tape_std.h: tape_std_error_recovery_read_opposite -
      has only declaration since recorded git history.
      
      drivers/s390/char/tape_std.h: tape_std_error_recovery_HWBUG - has only
      declaration since recorded git history.
      Reviewed-by: NSven Schnelle <svens@linux.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      402e9228
    • V
      s390/vdso: remove orphaned declarations · 3731ac57
      Vasily Gorbik 提交于
      Remove couple of declarations which are unused since commit 4bff8cb5
      ("s390: convert to GENERIC_VDSO").
      Acked-by: NSven Schnelle <svens@linux.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      3731ac57
    • V
      s390/cio: remove unused channel_subsystem_reinit · 54530ce6
      Vasily Gorbik 提交于
      Added with commit 77e844b9 ("s390/hibernate: add early resume
      function") unused since commit 39421627 ("s390: remove broken
      hibernate / power management support").
      Reviewed-by: NVineeth Vijayan <vneethv@linux.ibm.com>
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      54530ce6
  12. 29 9月, 2020 1 次提交
  13. 27 9月, 2020 1 次提交
    • V
      mm/gup: fix gup_fast with dynamic page table folding · d3f7b1bb
      Vasily Gorbik 提交于
      Currently to make sure that every page table entry is read just once
      gup_fast walks perform READ_ONCE and pass pXd value down to the next
      gup_pXd_range function by value e.g.:
      
        static int gup_pud_range(p4d_t p4d, unsigned long addr, unsigned long end,
                                 unsigned int flags, struct page **pages, int *nr)
        ...
                pudp = pud_offset(&p4d, addr);
      
      This function passes a reference on that local value copy to pXd_offset,
      and might get the very same pointer in return.  This happens when the
      level is folded (on most arches), and that pointer should not be
      iterated.
      
      On s390 due to the fact that each task might have different 5,4 or
      3-level address translation and hence different levels folded the logic
      is more complex and non-iteratable pointer to a local copy leads to
      severe problems.
      
      Here is an example of what happens with gup_fast on s390, for a task
      with 3-level paging, crossing a 2 GB pud boundary:
      
        // addr = 0x1007ffff000, end = 0x10080001000
        static int gup_pud_range(p4d_t p4d, unsigned long addr, unsigned long end,
                                 unsigned int flags, struct page **pages, int *nr)
        {
              unsigned long next;
              pud_t *pudp;
      
              // pud_offset returns &p4d itself (a pointer to a value on stack)
              pudp = pud_offset(&p4d, addr);
              do {
                      // on second iteratation reading "random" stack value
                      pud_t pud = READ_ONCE(*pudp);
      
                      // next = 0x10080000000, due to PUD_SIZE/MASK != PGDIR_SIZE/MASK on s390
                      next = pud_addr_end(addr, end);
                      ...
              } while (pudp++, addr = next, addr != end); // pudp++ iterating over stack
      
              return 1;
        }
      
      This happens since s390 moved to common gup code with commit
      d1874a0c ("s390/mm: make the pxd_offset functions more robust") and
      commit 1a42010c ("s390/mm: convert to the generic
      get_user_pages_fast code").
      
      s390 tried to mimic static level folding by changing pXd_offset
      primitives to always calculate top level page table offset in pgd_offset
      and just return the value passed when pXd_offset has to act as folded.
      
      What is crucial for gup_fast and what has been overlooked is that
      PxD_SIZE/MASK and thus pXd_addr_end should also change correspondingly.
      And the latter is not possible with dynamic folding.
      
      To fix the issue in addition to pXd values pass original pXdp pointers
      down to gup_pXd_range functions.  And introduce pXd_offset_lockless
      helpers, which take an additional pXd entry value parameter.  This has
      already been discussed in
      
        https://lkml.kernel.org/r/20190418100218.0a4afd51@mschwideX1
      
      Fixes: 1a42010c ("s390/mm: convert to the generic get_user_pages_fast code")
      Signed-off-by: NVasily Gorbik <gor@linux.ibm.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Reviewed-by: NGerald Schaefer <gerald.schaefer@linux.ibm.com>
      Reviewed-by: NAlexander Gordeev <agordeev@linux.ibm.com>
      Reviewed-by: NJason Gunthorpe <jgg@nvidia.com>
      Reviewed-by: NMike Rapoport <rppt@linux.ibm.com>
      Reviewed-by: NJohn Hubbard <jhubbard@nvidia.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Dave Hansen <dave.hansen@intel.com>
      Cc: Russell King <linux@armlinux.org.uk>
      Cc: Catalin Marinas <catalin.marinas@arm.com>
      Cc: Will Deacon <will@kernel.org>
      Cc: Michael Ellerman <mpe@ellerman.id.au>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Jeff Dike <jdike@addtoit.com>
      Cc: Richard Weinberger <richard@nod.at>
      Cc: Dave Hansen <dave.hansen@linux.intel.com>
      Cc: Andy Lutomirski <luto@kernel.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
      Cc: Heiko Carstens <hca@linux.ibm.com>
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Claudio Imbrenda <imbrenda@linux.ibm.com>
      Cc: <stable@vger.kernel.org>	[5.2+]
      Link: https://lkml.kernel.org/r/patch.git-943f1e5dcff2.your-ad-here.call-01599856292-ext-8676@work.hoursSigned-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      d3f7b1bb
  14. 26 9月, 2020 3 次提交
  15. 21 9月, 2020 1 次提交
  16. 18 9月, 2020 1 次提交
  17. 17 9月, 2020 1 次提交
  18. 16 9月, 2020 3 次提交
    • V
      s390/kasan: support protvirt with 4-level paging · c360c9a2
      Vasily Gorbik 提交于
      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: NVasily Gorbik <gor@linux.ibm.com>
      c360c9a2
    • A
      s390/cio: Helper functions to read CSSID, IID, and CHID · b983aa1f
      Alexandra Winter 提交于
      Add helper functions to expose Channel Subsystem ID (CSSID), MIF Image Id
      (IID), Channel ID (CHID) and Channel Path ID (CHPID).
      These values are required by the qeth driver's exploitation of network-
      address-change-notifications to determine which entries belong to this
      interface.
      
      Store the Partition identifier in System log, as this may be used to map
      a Linux view to a Hardware view for debugging purpose.
      Signed-off-by: NAlexandra Winter <wintera@linux.ibm.com>
      Reviewed-by: NVineeth Vijayan <vneethv@linux.ibm.com>
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Acked-by: NHeiko Carstens <hca@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      b983aa1f
    • A
      s390/cio: Add new Operation Code OC3 to PNSO · 4fea49a7
      Alexandra Winter 提交于
      Add support for operation code 3 (OC3) of the
      Perform-Network-Subchannel-Operations (PNSO) function
      of the Channel-Subsystem-Call (CHSC) instruction.
      
      PNSO provides 2 operation codes:
      OC0 - BRIDGE_INFO
      OC3 - ADDR_INFO (new)
      
      Extend the function calls to *pnso* to pass the OC and
      add new response code 0108.
      
      Support for OC3 is indicated by a flag in the css_general_characteristics.
      Signed-off-by: NAlexandra Winter <wintera@linux.ibm.com>
      Reviewed-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Reviewed-by: NPeter Oberparleiter <oberpar@linux.ibm.com>
      Reviewed-by: NVineeth Vijayan <vneethv@linux.ibm.com>
      Signed-off-by: NJulian Wiedmann <jwi@linux.ibm.com>
      Acked-by: NHeiko Carstens <hca@linux.ibm.com>
      Signed-off-by: NDavid S. Miller <davem@davemloft.net>
      4fea49a7