1. 07 Dec, 2016 8 commits
    • Heiko Carstens's avatar
      s390/numa: establish cpu to node mapping early · 8c910580
      Heiko Carstens authored
      Initialize the cpu topology and therefore also the cpu to node mapping
      much earlier. Fixes this warning and subsequent crashes when using the
      fake numa emulation mode on s390:
      
      WARNING: CPU: 0 PID: 1 at include/linux/cpumask.h:121 select_task_rq+0xe6/0x1a8
      CPU: 0 PID: 1 Comm: swapper/0 Not tainted 4.6.0-rc6-00001-ge9d867a6-dirty #28
      task: 00000001dd270008 ti: 00000001eccb4000 task.ti: 00000001eccb4000
      Krnl PSW : 0404c00180000000 0000000000176c56 (select_task_rq+0xe6/0x1a8)
                 R:0 T:1 IO:0 EX:0 Key:0 M:1 W:0 P:0 AS:3 CC:0 PM:0 RI:0 EA:3
      Call Trace:
      ([<0000000000176c30>] select_task_rq+0xc0/0x1a8)
      ([<0000000000177d64>] try_to_wake_up+0x2e4/0x478)
      ([<000000000015d46c>] create_worker+0x174/0x1c0)
      ([<0000000000161a98>] alloc_unbound_pwq+0x360/0x438)
      ([<0000000000162550>] apply_wqattrs_prepare+0x200/0x2a0)
      ([<000000000016266a>] apply_workqueue_attrs_locked+0x7a/0xb0)
      ([<0000000000162af0>] apply_workqueue_attrs+0x50/0x78)
      ([<000000000016441c>] __alloc_workqueue_key+0x304/0x520)
      ([<0000000000ee3706>] default_bdi_init+0x3e/0x70)
      ([<0000000000100270>] do_one_initcall+0x140/0x1d8)
      ([<0000000000ec9da8>] kernel_init_freeable+0x220/0x2d8)
      ([<0000000000984a7a>] kernel_init+0x2a/0x150)
      ([<00000000009913fa>] kernel_thread_starter+0x6/0xc)
      ([<00000000009913f4>] kernel_thread_starter+0x0/0xc)
      Reviewed-by: default avatarMichael Holzheu <holzheu@linux.vnet.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      8c910580
    • Heiko Carstens's avatar
      s390/topology: use cpu_topology array instead of per cpu variable · 30fc4ca2
      Heiko Carstens authored
      CPU topology information like cpu to node mapping must be setup in
      setup_arch already. Topology information is currently made available
      with a per cpu variable; this however will not work when the
      initialization will be moved to setup_arch, since the generic percpu
      setup will be done much later.
      
      Therefore convert back to a cpu_topology array.
      Reviewed-by: default avatarMichael Holzheu <holzheu@linux.vnet.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      30fc4ca2
    • Heiko Carstens's avatar
      s390/smp: initialize cpu_present_mask in setup_arch · af51160e
      Heiko Carstens authored
      In order to be able to setup the cpu to node mappings early it is a
      prerequisite to know which cpus are present. Therefore cpus must be
      detected much earlier than before.
      
      For sclp based cpu detection this requires yet another early sclp
      call, since the system is not ready to use the regular interrupt and
      memory allocations.
      Reviewed-by: default avatarMichael Holzheu <holzheu@linux.vnet.ibm.com>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      af51160e
    • Heiko Carstens's avatar
      s390/topology: always use s390 specific sched_domain_topology_level · ebb299a5
      Heiko Carstens authored
      The s390 specific sched_domain_topology_level should always be used,
      not only if the machine provides topology information. Luckily this
      odd behaviour, that was by accident introduced with git commit
      d05d15da ("s390/topology: delay initialization of topology cpu
      masks") has currently no side effect.
      
      Fixes: d05d15da ("s390/topology: delay initialization of topology cpumasks")
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      ebb299a5
    • Heiko Carstens's avatar
    • Heiko Carstens's avatar
      s390/numa: always use logical cpu and core ids · 307b3114
      Heiko Carstens authored
      The toptree algorithm uses the physical core ids to create a mapping
      between cores and nodes (to_node_id array within emu_cores structure).
      The core ids are used as an index into an array which size depends on
      CONFIG_NR_CPUS. If the physical core ids are larger, this will result
      in out-of-bounds write accesses.
      
      Generate logical core ids instead to avoid this.
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      307b3114
    • Michael Holzheu's avatar
      s390: Remove VLAIS in ptff() and clear_table() · 11a247e3
      Michael Holzheu authored
      The ptff() and clear_table() functions use the gcc extension "variable
      length arrays in structures" (VLAIS) to define in the inline assembler
      constraints the area of the clobbered memory. This extension will most
      likely never be supported by LLVM/Clang.
      
      Since currently BPF programs are compiled with LLVM, this leads to the
      following compile errors:
      
       $ cd samples/bpf
       $ make
      
       In file included from /root/linux-master/samples/bpf/tracex1_kern.c:8:
       In file included from ./include/linux/netdevice.h:44:
       ...
       In file included from ./arch/s390/include/asm/mmu_context.h:10:
        ./arch/s390/include/asm/pgalloc.h:30:24: error: fields must have a
        constant size: 'variable length array in structure' extension will never
        be supported
               typedef struct { char _[n]; } addrtype;
      
       In file included from /root/linux-master/samples/bpf/tracex1_kern.c:7:
       In file included from ./include/linux/skbuff.h:18:
       ...
       In file included from ./include/linux/jiffies.h:8:
       In file included from ./include/linux/timex.h:65:
        ./arch/s390/include/asm/timex.h:105:24: error: fields must have a
        constant size: 'variable length array in structure' extension will never
        be supported
              typedef struct { char _[len]; } addrtype;
      
      To fix this do the following:
      
       - Convert ptff() into a macro that then uses a fixed size array
         when expanded.
       - Convert the clear_table() function and use an inline assembly
         with fixed size array in a loop.
         The runtime performance of the new version is even better than
         the old version (tested with EC12/z13 and gcc 4.8.5/6.2.1 with
         "-march=z196 -O2").
      Reported-by: default avatarZvonko Kosic <zvonko.kosic@de.ibm.com>
      Signed-off-by: default avatarMichael Holzheu <holzheu@linux.vnet.ibm.com>
      Acked-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      11a247e3
    • Martin Schwidefsky's avatar
      s390: fix machine check panic stack switch · ce4dda3f
      Martin Schwidefsky authored
      For system damage machine checks or machine checks due to invalid PSW
      fields the system will be stopped. In order to get an oops message out
      before killing the system the machine check handler branches to
      .Lmcck_panic, switches to the panic stack and then does the usual
      machine check handling.
      
      The switch to the panic stack is incomplete, the stack pointer in %r15
      is replaced, but the pt_regs pointer in %r11 is not. The result is
      a program check which will kill the system in a slightly different way.
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      ce4dda3f
  2. 02 Dec, 2016 3 commits
    • Heiko Carstens's avatar
      s390/setup: fix memblock usage · db7ad636
      Heiko Carstens authored
      When converting from bootmem to memblock I missed a subtle difference:
      the memblock_alloc() functions return uninitialized memory, while the
      memblock_virt_alloc() functions return zeroed memory.
      
      This led to quite random early boot crashes.
      
      Therefore use the correct version everywhere now.
      Hopefully.
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      db7ad636
    • Lars-Peter Clausen's avatar
      s390/zcrypt: Convert to PM ops · 3e488c95
      Lars-Peter Clausen authored
      Switch the zcrypt bus from legacy suspend/resume callbacks to dev_pm_ops.
      The conversion is straight forward with the help of SIMPLE_DEV_PM_OPS().
      The new dev_pm_ops based version is functionally equivalent to the legacy
      callbacks version.
      
      This will allow to eventually remove support for legacy suspend/resume
      callbacks from the kernel altogether.
      Signed-off-by: default avatarLars-Peter Clausen <lars@metafoo.de>
      Signed-off-by: default avatarHarald Freudenberger <freude@linux.vnet.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      3e488c95
    • Heiko Carstens's avatar
      s390/kexec: use node 0 when re-adding crash kernel memory · 9f88eb4d
      Heiko Carstens authored
      When re-adding crash kernel memory within setup_resources() the
      function memblock_add() is used. That function will add memory by
      default to node "MAX_NUMNODES" instead of node 0, like the memory
      detection code does. In case of !NUMA this will trigger this warning
      when the kernel generates the vmemmap:
      
      Usage of MAX_NUMNODES is deprecated. Use NUMA_NO_NODE instead
      WARNING: CPU: 0 PID: 0 at mm/memblock.c:1261 memblock_virt_alloc_internal+0x76/0x220
      CPU: 0 PID: 0 Comm: swapper Not tainted 4.9.0-rc6 #16
      Call Trace:
       [<0000000000d0b2e8>] memblock_virt_alloc_try_nid+0x88/0xc8
       [<000000000083c8ea>] __earlyonly_bootmem_alloc.constprop.1+0x42/0x50
       [<000000000083e7f4>] vmemmap_populate+0x1ac/0x1e0
       [<0000000000840136>] sparse_mem_map_populate+0x46/0x68
       [<0000000000d0c59c>] sparse_init+0x184/0x238
       [<0000000000cf45f6>] paging_init+0xbe/0xf8
       [<0000000000cf1d4a>] setup_arch+0xa02/0xae0
       [<0000000000ced75a>] start_kernel+0x72/0x450
       [<0000000000100020>] _stext+0x20/0x80
      
      If NUMA is selected numa_setup_memory() will fix the node assignments
      before the vmemmap will be populated; so this warning will only appear
      if NUMA is not selected.
      
      To fix this simply use memblock_add_node() and re-add crash kernel
      memory explicitly to node 0.
      Reported-and-tested-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
      Fixes: 4e042af4 ("s390/kexec: fix crash on resize of reserved memory")
      Cc: <stable@vger.kernel.org> # v4.8+
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      9f88eb4d
  3. 29 Nov, 2016 4 commits
  4. 25 Nov, 2016 2 commits
  5. 23 Nov, 2016 6 commits
  6. 17 Nov, 2016 5 commits
  7. 15 Nov, 2016 1 commit
  8. 11 Nov, 2016 6 commits
  9. 08 Nov, 2016 1 commit
  10. 07 Nov, 2016 2 commits
  11. 31 Oct, 2016 2 commits
    • Paul Gortmaker's avatar
      s390: virtio: make ccw explicitly non-modular · acc50ec7
      Paul Gortmaker authored
      The Kconfig currently controlling compilation of this code is:
      
      arch/s390/Kconfig:config S390_GUEST
      arch/s390/Kconfig:      def_bool y
      
      ...meaning that it currently is not being built as a module by anyone.
      
      Lets remove the modular code that is essentially orphaned, so that
      when reading the driver there is no doubt it is builtin-only.
      
      Since module_init translates to device_initcall in the non-modular
      case, the init ordering remains unchanged with this commit.
      
      Also note that MODULE_DEVICE_TABLE is a no-op for non-modular code.
      
      We replace module.h with moduleparam.h since the file does declare
      some module_param() and leaving that as-is is currently the easiest
      way to remain compatible with existing boot arg use cases.
      
      Cc: Christian Borntraeger <borntraeger@de.ibm.com>
      Cc: Cornelia Huck <cornelia.huck@de.ibm.com>
      Cc: linux-s390@vger.kernel.org
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      acc50ec7
    • Paul Gortmaker's avatar
      s390: hotplug: make pci_hpc explicitly non-modular · 0729dcf2
      Paul Gortmaker authored
      The Kconfig currently controlling compilation of this code is:
      
      drivers/pci/hotplug/Kconfig:config HOTPLUG_PCI_S390
      drivers/pci/hotplug/Kconfig:    bool "System z PCI Hotplug Support"
      
      ...meaning that it currently is not being built as a module by anyone.
      
      Lets remove the couple traces of modular infrastructure use, so that
      when reading the driver there is no doubt it is builtin-only.
      
      We also delete the MODULE_LICENSE tag etc. since all that information
      was (or is now) contained at the top of the file in the comments.
      
      We don't exchange module.h for init.h or export.h since the file
      does not contain any initcalls or EXPORT of symbols.
      
      Cc: Sebastian Ott <sebott@linux.vnet.ibm.com>
      Cc: Gerald Schaefer <gerald.schaefer@de.ibm.com>
      Cc: Bjorn Helgaas <bhelgaas@google.com>
      Cc: linux-s390@vger.kernel.org
      Signed-off-by: default avatarPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
      0729dcf2