1. 30 9月, 2021 3 次提交
  2. 22 9月, 2021 1 次提交
  3. 21 8月, 2021 1 次提交
    • V
      KVM: x86: hyper-v: Deactivate APICv only when AutoEOI feature is in use · 0f250a64
      Vitaly Kuznetsov 提交于
      APICV_INHIBIT_REASON_HYPERV is currently unconditionally forced upon
      SynIC activation as SynIC's AutoEOI is incompatible with APICv/AVIC. It is,
      however, possible to track whether the feature was actually used by the
      guest and only inhibit APICv/AVIC when needed.
      
      TLFS suggests a dedicated 'HV_DEPRECATING_AEOI_RECOMMENDED' flag to let
      Windows know that AutoEOI feature should be avoided. While it's up to
      KVM userspace to set the flag, KVM can help a bit by exposing global
      APICv/AVIC enablement.
      
      Maxim:
         - always set HV_DEPRECATING_AEOI_RECOMMENDED in kvm_get_hv_cpuid,
           since this feature can be used regardless of AVIC
      
      Paolo:
         - use arch.apicv_update_lock to protect the hv->synic_auto_eoi_used
           instead of atomic ops
      Signed-off-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: NMaxim Levitsky <mlevitsk@redhat.com>
      Message-Id: <20210810205251.424103-12-mlevitsk@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      0f250a64
  4. 13 8月, 2021 1 次提交
  5. 03 8月, 2021 3 次提交
  6. 18 6月, 2021 30 次提交
  7. 27 5月, 2021 1 次提交
    • W
      KVM: X86: hyper-v: Task srcu lock when accessing kvm_memslots() · da6d63a0
      Wanpeng Li 提交于
         WARNING: suspicious RCU usage
         5.13.0-rc1 #4 Not tainted
         -----------------------------
         ./include/linux/kvm_host.h:710 suspicious rcu_dereference_check() usage!
      
        other info that might help us debug this:
      
        rcu_scheduler_active = 2, debug_locks = 1
         1 lock held by hyperv_clock/8318:
          #0: ffffb6b8cb05a7d8 (&hv->hv_lock){+.+.}-{3:3}, at: kvm_hv_invalidate_tsc_page+0x3e/0xa0 [kvm]
      
        stack backtrace:
        CPU: 3 PID: 8318 Comm: hyperv_clock Not tainted 5.13.0-rc1 #4
        Call Trace:
         dump_stack+0x87/0xb7
         lockdep_rcu_suspicious+0xce/0xf0
         kvm_write_guest_page+0x1c1/0x1d0 [kvm]
         kvm_write_guest+0x50/0x90 [kvm]
         kvm_hv_invalidate_tsc_page+0x79/0xa0 [kvm]
         kvm_gen_update_masterclock+0x1d/0x110 [kvm]
         kvm_arch_vm_ioctl+0x2a7/0xc50 [kvm]
         kvm_vm_ioctl+0x123/0x11d0 [kvm]
         __x64_sys_ioctl+0x3ed/0x9d0
         do_syscall_64+0x3d/0x80
         entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      kvm_memslots() will be called by kvm_write_guest(), so we should take the srcu lock.
      
      Fixes: e880c6ea (KVM: x86: hyper-v: Prevent using not-yet-updated TSC page by secondary CPUs)
      Reviewed-by: NVitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: NWanpeng Li <wanpengli@tencent.com>
      Message-Id: <1621339235-11131-4-git-send-email-wanpengli@tencent.com>
      Reviewed-by: NSean Christopherson <seanjc@google.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      da6d63a0