1. 14 12月, 2017 1 次提交
  2. 06 12月, 2017 3 次提交
  3. 28 11月, 2017 1 次提交
    • J
      KVM: Let KVM_SET_SIGNAL_MASK work as advertised · 20b7035c
      Jan H. Schönherr 提交于
      KVM API says for the signal mask you set via KVM_SET_SIGNAL_MASK, that
      "any unblocked signal received [...] will cause KVM_RUN to return with
      -EINTR" and that "the signal will only be delivered if not blocked by
      the original signal mask".
      
      This, however, is only true, when the calling task has a signal handler
      registered for a signal. If not, signal evaluation is short-circuited for
      SIG_IGN and SIG_DFL, and the signal is either ignored without KVM_RUN
      returning or the whole process is terminated.
      
      Make KVM_SET_SIGNAL_MASK behave as advertised by utilizing logic similar
      to that in do_sigtimedwait() to avoid short-circuiting of signals.
      Signed-off-by: NJan H. Schönherr <jschoenh@amazon.de>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      20b7035c
  4. 09 11月, 2017 1 次提交
  5. 09 10月, 2017 1 次提交
  6. 28 9月, 2017 1 次提交
  7. 29 8月, 2017 3 次提交
  8. 08 8月, 2017 2 次提交
  9. 25 7月, 2017 1 次提交
    • C
      KVM: s390: take srcu lock when getting/setting storage keys · 4f899147
      Christian Borntraeger 提交于
      The following warning was triggered by missing srcu locks around
      the storage key handling functions.
      
      =============================
      WARNING: suspicious RCU usage
      4.12.0+ #56 Not tainted
      -----------------------------
      ./include/linux/kvm_host.h:572 suspicious rcu_dereference_check() usage!
      rcu_scheduler_active = 2, debug_locks = 1
       1 lock held by live_migration/4936:
        #0:  (&mm->mmap_sem){++++++}, at: [<0000000000141be0>]
      kvm_arch_vm_ioctl+0x6b8/0x22d0
      
       CPU: 8 PID: 4936 Comm: live_migration Not tainted 4.12.0+ #56
       Hardware name: IBM 2964 NC9 704 (LPAR)
       Call Trace:
       ([<000000000011378a>] show_stack+0xea/0xf0)
        [<000000000055cc4c>] dump_stack+0x94/0xd8
        [<000000000012ee70>] gfn_to_memslot+0x1a0/0x1b8
        [<0000000000130b76>] gfn_to_hva+0x2e/0x48
        [<0000000000141c3c>] kvm_arch_vm_ioctl+0x714/0x22d0
        [<000000000013306c>] kvm_vm_ioctl+0x11c/0x7b8
        [<000000000037e2c0>] do_vfs_ioctl+0xa8/0x6c8
        [<000000000037e984>] SyS_ioctl+0xa4/0xb8
        [<00000000008b20a4>] system_call+0xc4/0x27c
       1 lock held by live_migration/4936:
        #0:  (&mm->mmap_sem){++++++}, at: [<0000000000141be0>]
      kvm_arch_vm_ioctl+0x6b8/0x22d0
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Reviewed-by: Pierre Morel<pmorel@linux.vnet.ibm.com>
      4f899147
  10. 28 6月, 2017 1 次提交
    • Q
      KVM: s390: Inject machine check into the guest · 4d62fcc0
      QingFeng Hao 提交于
      If the exit flag of SIE indicates that a machine check has happened
      during guest's running and needs to be injected, inject it to the guest
      accordingly.
      But some machine checks, e.g. Channel Report Pending (CRW), refer to
      host conditions only (the guest's channel devices are not managed by
      the kernel directly) and are therefore not injected into the guest.
      External Damage (ED) is also not reinjected into the guest because ETR
      conditions are gone in Linux and STP conditions are not enabled in the
      guest, and ED contains only these 8 ETR and STP conditions.
      In general, instruction-processing damage, system recovery,
      storage error, service-processor damage and channel subsystem damage
      will be reinjected into the guest, and the remain (System damage,
      timing-facility damage, warning, ED and CRW) will be handled on the host.
      Signed-off-by: NQingFeng Hao <haoqf@linux.vnet.ibm.com>
      Acked-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      4d62fcc0
  11. 27 6月, 2017 1 次提交
    • Q
      KVM: s390: Backup the guest's machine check info · da72ca4d
      QingFeng Hao 提交于
      When a machine check happens in the guest, related mcck info (mcic,
      external damage code, ...) is stored in the vcpu's lowcore on the host.
      Then the machine check handler's low-level part is executed, followed
      by the high-level part.
      
      If the high-level part's execution is interrupted by a new machine check
      happening on the same vcpu on the host, the mcck info in the lowcore is
      overwritten with the new machine check's data.
      
      If the high-level part's execution is scheduled to a different cpu,
      the mcck info in the lowcore is uncertain.
      
      Therefore, for both cases, the further reinjection to the guest will use
      the wrong data.
      Let's backup the mcck info in the lowcore to the sie page
      for further reinjection, so that the right data will be used.
      
      Add new member into struct sie_page to store related machine check's
      info of mcic, failing storage address and external damage code.
      Signed-off-by: NQingFeng Hao <haoqf@linux.vnet.ibm.com>
      Acked-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      da72ca4d
  12. 22 6月, 2017 2 次提交
  13. 04 6月, 2017 1 次提交
  14. 01 6月, 2017 1 次提交
  15. 09 5月, 2017 1 次提交
    • M
      treewide: use kv[mz]alloc* rather than opencoded variants · 752ade68
      Michal Hocko 提交于
      There are many code paths opencoding kvmalloc.  Let's use the helper
      instead.  The main difference to kvmalloc is that those users are
      usually not considering all the aspects of the memory allocator.  E.g.
      allocation requests <= 32kB (with 4kB pages) are basically never failing
      and invoke OOM killer to satisfy the allocation.  This sounds too
      disruptive for something that has a reasonable fallback - the vmalloc.
      On the other hand those requests might fallback to vmalloc even when the
      memory allocator would succeed after several more reclaim/compaction
      attempts previously.  There is no guarantee something like that happens
      though.
      
      This patch converts many of those places to kv[mz]alloc* helpers because
      they are more conservative.
      
      Link: http://lkml.kernel.org/r/20170306103327.2766-2-mhocko@kernel.orgSigned-off-by: NMichal Hocko <mhocko@suse.com>
      Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com> # Xen bits
      Acked-by: NKees Cook <keescook@chromium.org>
      Acked-by: NVlastimil Babka <vbabka@suse.cz>
      Acked-by: Andreas Dilger <andreas.dilger@intel.com> # Lustre
      Acked-by: Christian Borntraeger <borntraeger@de.ibm.com> # KVM/s390
      Acked-by: Dan Williams <dan.j.williams@intel.com> # nvdim
      Acked-by: David Sterba <dsterba@suse.com> # btrfs
      Acked-by: Ilya Dryomov <idryomov@gmail.com> # Ceph
      Acked-by: Tariq Toukan <tariqt@mellanox.com> # mlx4
      Acked-by: Leon Romanovsky <leonro@mellanox.com> # mlx5
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
      Cc: Herbert Xu <herbert@gondor.apana.org.au>
      Cc: Anton Vorontsov <anton@enomsg.org>
      Cc: Colin Cross <ccross@android.com>
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: "Rafael J. Wysocki" <rjw@rjwysocki.net>
      Cc: Ben Skeggs <bskeggs@redhat.com>
      Cc: Kent Overstreet <kent.overstreet@gmail.com>
      Cc: Santosh Raspatur <santosh@chelsio.com>
      Cc: Hariprasad S <hariprasad@chelsio.com>
      Cc: Yishai Hadas <yishaih@mellanox.com>
      Cc: Oleg Drokin <oleg.drokin@intel.com>
      Cc: "Yan, Zheng" <zyan@redhat.com>
      Cc: Alexander Viro <viro@zeniv.linux.org.uk>
      Cc: Alexei Starovoitov <ast@kernel.org>
      Cc: Eric Dumazet <eric.dumazet@gmail.com>
      Cc: David Miller <davem@davemloft.net>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      752ade68
  16. 27 4月, 2017 1 次提交
  17. 26 4月, 2017 2 次提交
  18. 25 4月, 2017 1 次提交
  19. 21 4月, 2017 1 次提交
  20. 07 4月, 2017 1 次提交
  21. 06 4月, 2017 1 次提交
    • F
      KVM: s390: introduce ais mode modify function · 51978393
      Fei Li 提交于
      Provide an interface for userspace to modify AIS
      (adapter-interruption-suppression) mode state, and add documentation
      for the interface. Allowed target modes are ALL-Interruptions mode
      and SINGLE-Interruption mode.
      
      We introduce the 'simm' and 'nimm' fields in kvm_s390_float_interrupt
      to store interruption modes for each ISC. Each bit in 'simm' and
      'nimm' targets to one ISC, and collaboratively indicate three modes:
      ALL-Interruptions, SINGLE-Interruption and NO-Interruptions. This
      interface can initiate most transitions between the states; transition
      from SINGLE-Interruption to NO-Interruptions via adapter interrupt
      injection will be introduced in a following patch. The meaningful
      combinations are as follows:
      
          interruption mode | simm bit | nimm bit
          ------------------|----------|----------
                   ALL      |    0     |     0
                 SINGLE     |    1     |     0
                   NO       |    1     |     1
      
      Besides, add tracepoint to track AIS mode transitions.
      Co-Authored-By: NYi Min Zhao <zyimin@linux.vnet.ibm.com>
      Signed-off-by: NYi Min Zhao <zyimin@linux.vnet.ibm.com>
      Signed-off-by: NFei Li <sherrylf@linux.vnet.ibm.com>
      Reviewed-by: NCornelia Huck <cornelia.huck@de.ibm.com>
      Signed-off-by: NChristian Borntraeger <borntraeger@de.ibm.com>
      51978393
  22. 23 3月, 2017 1 次提交
  23. 16 3月, 2017 2 次提交
  24. 02 3月, 2017 1 次提交
  25. 17 2月, 2017 2 次提交
    • P
      KVM: race-free exit from KVM_RUN without POSIX signals · 460df4c1
      Paolo Bonzini 提交于
      The purpose of the KVM_SET_SIGNAL_MASK API is to let userspace "kick"
      a VCPU out of KVM_RUN through a POSIX signal.  A signal is attached
      to a dummy signal handler; by blocking the signal outside KVM_RUN and
      unblocking it inside, this possible race is closed:
      
                VCPU thread                     service thread
         --------------------------------------------------------------
              check flag
                                                set flag
                                                raise signal
              (signal handler does nothing)
              KVM_RUN
      
      However, one issue with KVM_SET_SIGNAL_MASK is that it has to take
      tsk->sighand->siglock on every KVM_RUN.  This lock is often on a
      remote NUMA node, because it is on the node of a thread's creator.
      Taking this lock can be very expensive if there are many userspace
      exits (as is the case for SMP Windows VMs without Hyper-V reference
      time counter).
      
      As an alternative, we can put the flag directly in kvm_run so that
      KVM can see it:
      
                VCPU thread                     service thread
         --------------------------------------------------------------
                                                raise signal
              signal handler
                set run->immediate_exit
              KVM_RUN
                check run->immediate_exit
      Reviewed-by: NRadim Krčmář <rkrcmar@redhat.com>
      Reviewed-by: NDavid Hildenbrand <david@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      460df4c1
    • P
      s390: Audit and remove any remaining unnecessary uses of module.h · d3217967
      Paul Gortmaker 提交于
      Historically a lot of these existed because we did not have
      a distinction between what was modular code and what was providing
      support to modules via EXPORT_SYMBOL and friends.  That changed
      when we forked out support for the latter into the export.h file.
      
      This means we should be able to reduce the usage of module.h
      in code that is obj-y Makefile or bool Kconfig.  The advantage
      in doing so is that module.h itself sources about 15 other headers;
      adding significantly to what we feed cpp, and it can obscure what
      headers we are effectively using.
      
      Since module.h was the source for init.h (for __init) and for
      export.h (for EXPORT_SYMBOL) we consider each change instance
      for the presence of either and replace as needed.  An instance
      where module_param was used without moduleparam.h was also fixed,
      as well as implicit use of ptrace.h and string.h headers.
      Signed-off-by: NPaul Gortmaker <paul.gortmaker@windriver.com>
      Signed-off-by: NHeiko Carstens <heiko.carstens@de.ibm.com>
      Signed-off-by: NMartin Schwidefsky <schwidefsky@de.ibm.com>
      d3217967
  26. 06 2月, 2017 1 次提交
  27. 30 1月, 2017 5 次提交