1. 27 6月, 2017 1 次提交
  2. 09 5月, 2017 2 次提交
  3. 21 4月, 2017 1 次提交
  4. 15 4月, 2017 1 次提交
    • N
      s390/time: Set ->min_delta_ticks and ->max_delta_ticks · 06c54611
      Nicolai Stange 提交于
      In preparation for making the clockevents core NTP correction aware,
      all clockevent device drivers must set ->min_delta_ticks and
      ->max_delta_ticks rather than ->min_delta_ns and ->max_delta_ns: a
      clockevent device's rate is going to change dynamically and thus, the
      ratio of ns to ticks ceases to stay invariant.
      
      Currently, the s390's CPU timer clockevent device is initialized as
      follows:
      
        cd->min_delta_ns    = 1;
        cd->max_delta_ns    = LONG_MAX;
      
      Note that the device's time to cycle conversion factor, i.e.
      cd->mult / (2^cd->shift), is approx. equal to 4.
      
      Hence, this would translate to
      
        cd->min_delta_ticks = 4;
        cd->max_delta_ticks = 4 * LONG_MAX;
      
      However, a minimum value of 1ns is in the range of noise anyway and the
      clockevent core will take care of this by increasing it to 1us or so.
      Furthermore, 4*LONG_MAX would overflow the unsigned long argument the
      clockevent devices gets programmed with.
      
      Thus, initialize ->min_delta_ticks with 1 and ->max_delta_ticks with
      ULONG_MAX.
      
      This patch alone doesn't introduce any change in functionality as the
      clockevents core still looks exclusively at the (untouched) ->min_delta_ns
      and ->max_delta_ns. As soon as this has changed, a followup patch will
      purge the initialization of ->min_delta_ns and ->max_delta_ns from this
      driver.
      
      Cc: Ingo Molnar <mingo@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Prarit Bhargava <prarit@redhat.com>
      Cc: Stephen Boyd <sboyd@codeaurora.org>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: David Hildenbrand <dahi@linux.vnet.ibm.com>
      Cc: linux-s390@vger.kernel.org
      Signed-off-by: NNicolai Stange <nicstange@gmail.com>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      06c54611
  5. 12 4月, 2017 1 次提交
  6. 05 4月, 2017 2 次提交
    • M
      s390/cpumf: simplify detection of guest samples · df26c2e8
      Martin Schwidefsky 提交于
      There are three different code levels in regard to the identification
      of guest samples. They differ in the way the LPP instruction is used.
      
      1) Old kernels without the LPP instruction. The guest program parameter
         is always zero.
      2) Newer kernels load the process pid into the program parameter with LPP.
         The guest program parameter is non-zero if the guest executes in a
         process != idle.
      3) The latest kernels load ((1UL << 31) | pid) with LPP to make the value
         non-zero even for the idle task. The guest program parameter is non-zero
         if the guest is running.
      
      All kernels load the process pid to CR4 on context switch. The CPU sampling
      code uses the value in CR4 to decide between guest and host samples in case
      the guest program parameter is zero. The three cases:
      
      1) CR4==pid, gpp==0
      2) CR4==pid, gpp==pid
      3) CR4==pid, gpp==((1UL << 31) | pid)
      
      The load-control instruction to load the pid into CR4 is expensive and the
      goal is to remove it. To distinguish the host CR4 from the guest pid for
      the idle process the maximum value 0xffff for the PASN is used.
      This adds a fourth case for a guest OS with an updated kernel:
      
      4) CR4==0xffff, gpp=((1UL << 31) | pid)
      
      The host kernel will have CR4==0xffff and will use (gpp!=0 || CR4!==0xffff)
      to identify guest samples. This works nicely with all 4 cases, the only
      possible issue would be a guest with an old kernel (gpp==0) and a process
      pid of 0xffff. Well, don't do that..
      Suggested-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Reviewed-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      df26c2e8
    • M
      s390: use 64-bit lctlg to load task pid to cr4 on context switch · cab36c26
      Martin Schwidefsky 提交于
      The 32-bit lctl instruction is quite a bit slower than the 64-bit
      counter part lctlg. Use the faster instruction.
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      cab36c26
  7. 01 4月, 2017 1 次提交
  8. 31 3月, 2017 6 次提交
  9. 28 3月, 2017 1 次提交
    • M
      s390/kdump: Add final note · dcc00b79
      Michael Holzheu 提交于
      Since linux v3.14 with commit 38dfac84 ("vmcore: prevent PT_NOTE
      p_memsz overflow during header update") on s390 we get the following
      message in the kdump kernel:
      
        Warning: Exceeded p_memsz, dropping PT_NOTE entry n_namesz=0x6b6b6b6b,
        n_descsz=0x6b6b6b6b
      
      The reason for this is that we don't create a final zero note in
      the ELF header which the proc/vmcore code uses to find out the end
      of the notes section (see also kernel/kexec_core.c:final_note()).
      
      It still worked on s390 by chance because we (most of the time?) have the
      byte pattern 0x6b6b6b6b after the notes section which also makes the notes
      parsing code stop in update_note_header_size_elf64() because 0x6b6b6b6b is
      interpreded as note size:
      
        if ((real_sz + sz) > max_sz) {
                pr_warn("Warning: Exceeded p_memsz, dropping P ...);
                break;
        }
      
      So fix this and add the missing final note to the ELF header.
      We don't have to adjust the memory size for ELF header ("alloc_size")
      because the new ELF note still fits into the 0x1000 base memory.
      
      Cc: stable@vger.kernel.org # v4.4+
      Signed-off-by: NMichael Holzheu <holzheu@linux.vnet.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      dcc00b79
  10. 22 3月, 2017 12 次提交
  11. 10 3月, 2017 1 次提交
  12. 08 3月, 2017 1 次提交
    • M
      livepatch/s390: add TIF_PATCH_PENDING thread flag · 2f09ca60
      Miroslav Benes 提交于
      Update a task's patch state when returning from a system call or user
      space interrupt, or after handling a signal.
      
      This greatly increases the chances of a patch operation succeeding.  If
      a task is I/O bound, it can be patched when returning from a system
      call.  If a task is CPU bound, it can be patched when returning from an
      interrupt.  If a task is sleeping on a to-be-patched function, the user
      can send SIGSTOP and SIGCONT to force it to switch.
      
      Since there are two ways the syscall can be restarted on return from a
      signal handling process, it is important to clear the flag before
      do_signal() is called. Otherwise we could miss the migration if we used
      SIGSTOP/SIGCONT procedure or fake signal to migrate patching blocking
      tasks. If we place our hook to sysc_work label in entry before
      TIF_SIGPENDING is evaluated we kill two birds with one stone. The task
      is correctly migrated in all return paths from a syscall.
      Signed-off-by: NMiroslav Benes <mbenes@suse.cz>
      Signed-off-by: NJosh Poimboeuf <jpoimboe@redhat.com>
      Acked-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NJiri Kosina <jkosina@suse.cz>
      2f09ca60
  13. 03 3月, 2017 2 次提交
    • I
      sched/headers: Move task->mm handling methods to <linux/sched/mm.h> · 68e21be2
      Ingo Molnar 提交于
      Move the following task->mm helper APIs into a new header file,
      <linux/sched/mm.h>, to further reduce the size and complexity
      of <linux/sched.h>.
      
      Here are how the APIs are used in various kernel files:
      
        # mm_alloc():
        arch/arm/mach-rpc/ecard.c
        fs/exec.c
        include/linux/sched/mm.h
        kernel/fork.c
      
        # __mmdrop():
        arch/arc/include/asm/mmu_context.h
        include/linux/sched/mm.h
        kernel/fork.c
      
        # mmdrop():
        arch/arm/mach-rpc/ecard.c
        arch/m68k/sun3/mmu_emu.c
        arch/x86/mm/tlb.c
        drivers/gpu/drm/amd/amdkfd/kfd_process.c
        drivers/gpu/drm/i915/i915_gem_userptr.c
        drivers/infiniband/hw/hfi1/file_ops.c
        drivers/vfio/vfio_iommu_spapr_tce.c
        fs/exec.c
        fs/proc/base.c
        fs/proc/task_mmu.c
        fs/proc/task_nommu.c
        fs/userfaultfd.c
        include/linux/mmu_notifier.h
        include/linux/sched/mm.h
        kernel/fork.c
        kernel/futex.c
        kernel/sched/core.c
        mm/khugepaged.c
        mm/ksm.c
        mm/mmu_context.c
        mm/mmu_notifier.c
        mm/oom_kill.c
        virt/kvm/kvm_main.c
      
        # mmdrop_async_fn():
        include/linux/sched/mm.h
      
        # mmdrop_async():
        include/linux/sched/mm.h
        kernel/fork.c
      
        # mmget_not_zero():
        fs/userfaultfd.c
        include/linux/sched/mm.h
        mm/oom_kill.c
      
        # mmput():
        arch/arc/include/asm/mmu_context.h
        arch/arc/kernel/troubleshoot.c
        arch/frv/mm/mmu-context.c
        arch/powerpc/platforms/cell/spufs/context.c
        arch/sparc/include/asm/mmu_context_32.h
        drivers/android/binder.c
        drivers/gpu/drm/etnaviv/etnaviv_gem.c
        drivers/gpu/drm/i915/i915_gem_userptr.c
        drivers/infiniband/core/umem.c
        drivers/infiniband/core/umem_odp.c
        drivers/infiniband/core/uverbs_main.c
        drivers/infiniband/hw/mlx4/main.c
        drivers/infiniband/hw/mlx5/main.c
        drivers/infiniband/hw/usnic/usnic_uiom.c
        drivers/iommu/amd_iommu_v2.c
        drivers/iommu/intel-svm.c
        drivers/lguest/lguest_user.c
        drivers/misc/cxl/fault.c
        drivers/misc/mic/scif/scif_rma.c
        drivers/oprofile/buffer_sync.c
        drivers/vfio/vfio_iommu_type1.c
        drivers/vhost/vhost.c
        drivers/xen/gntdev.c
        fs/exec.c
        fs/proc/array.c
        fs/proc/base.c
        fs/proc/task_mmu.c
        fs/proc/task_nommu.c
        fs/userfaultfd.c
        include/linux/sched/mm.h
        kernel/cpuset.c
        kernel/events/core.c
        kernel/events/uprobes.c
        kernel/exit.c
        kernel/fork.c
        kernel/ptrace.c
        kernel/sys.c
        kernel/trace/trace_output.c
        kernel/tsacct.c
        mm/memcontrol.c
        mm/memory.c
        mm/mempolicy.c
        mm/migrate.c
        mm/mmu_notifier.c
        mm/nommu.c
        mm/oom_kill.c
        mm/process_vm_access.c
        mm/rmap.c
        mm/swapfile.c
        mm/util.c
        virt/kvm/async_pf.c
      
        # mmput_async():
        include/linux/sched/mm.h
        kernel/fork.c
        mm/oom_kill.c
      
        # get_task_mm():
        arch/arc/kernel/troubleshoot.c
        arch/powerpc/platforms/cell/spufs/context.c
        drivers/android/binder.c
        drivers/gpu/drm/etnaviv/etnaviv_gem.c
        drivers/infiniband/core/umem.c
        drivers/infiniband/core/umem_odp.c
        drivers/infiniband/hw/mlx4/main.c
        drivers/infiniband/hw/mlx5/main.c
        drivers/infiniband/hw/usnic/usnic_uiom.c
        drivers/iommu/amd_iommu_v2.c
        drivers/iommu/intel-svm.c
        drivers/lguest/lguest_user.c
        drivers/misc/cxl/fault.c
        drivers/misc/mic/scif/scif_rma.c
        drivers/oprofile/buffer_sync.c
        drivers/vfio/vfio_iommu_type1.c
        drivers/vhost/vhost.c
        drivers/xen/gntdev.c
        fs/proc/array.c
        fs/proc/base.c
        fs/proc/task_mmu.c
        include/linux/sched/mm.h
        kernel/cpuset.c
        kernel/events/core.c
        kernel/exit.c
        kernel/fork.c
        kernel/ptrace.c
        kernel/sys.c
        kernel/trace/trace_output.c
        kernel/tsacct.c
        mm/memcontrol.c
        mm/memory.c
        mm/mempolicy.c
        mm/migrate.c
        mm/mmu_notifier.c
        mm/nommu.c
        mm/util.c
      
        # mm_access():
        fs/proc/base.c
        include/linux/sched/mm.h
        kernel/fork.c
        mm/process_vm_access.c
      
        # mm_release():
        arch/arc/include/asm/mmu_context.h
        fs/exec.c
        include/linux/sched/mm.h
        include/uapi/linux/sched.h
        kernel/exit.c
        kernel/fork.c
      Acked-by: NLinus Torvalds <torvalds@linux-foundation.org>
      Cc: Mike Galbraith <efault@gmx.de>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      68e21be2
    • H
      s390/ipl: always use load normal for CCW-type re-IPL · 7afbeb6d
      Heiko Carstens 提交于
      commit 14890678687c ("s390/ipl: use load normal for LPAR re-ipl")
      missed to convert one code path to use load normal semantics for
      re-IPL. Convert the missing code path as well.
      
      Fixes: 14890678687c ("s390/ipl: use load normal for LPAR re-ipl")
      Reported-by: NMichael Holzheu <holzheu@linux.vnet.ibm.com>
      Acked-by: NMichael Holzheu <holzheu@linux.vnet.ibm.com>
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      7afbeb6d
  14. 02 3月, 2017 8 次提交