1. 03 Mar, 2020 1 commit
    • Vitaly Kuznetsov's avatar
      KVM: x86: clear stale x86_emulate_ctxt->intercept value · 342993f9
      Vitaly Kuznetsov authored
      After commit 07721fee ("KVM: nVMX: Don't emulate instructions in guest
      mode") Hyper-V guests on KVM stopped booting with:
      
       kvm_nested_vmexit:    rip fffff802987d6169 reason EPT_VIOLATION info1 181
          info2 0 int_info 0 int_info_err 0
       kvm_page_fault:       address febd0000 error_code 181
       kvm_emulate_insn:     0:fffff802987d6169: f3 a5
       kvm_emulate_insn:     0:fffff802987d6169: f3 a5 FAIL
       kvm_inj_exception:    #UD (0x0)
      
      "f3 a5" is a "rep movsw" instruction, which should not be intercepted
      at all.  Commit c44b4c6a ("KVM: emulate: clean up initializations in
      init_decode_cache") reduced the number of fields cleared by
      init_decode_cache() claiming that they are being cleared elsewhere,
      'intercept', however, is left uncleared if the instruction does not have
      any of the "slow path" flags (NotImpl, Stack, Op3264, Sse, Mmx, CheckPerm,
      NearBranch, No16 and of course Intercept itself).
      
      Fixes: c44b4c6a ("KVM: emulate: clean up initializations in init_decode_cache")
      Fixes: 07721fee ("KVM: nVMX: Don't emulate instructions in guest mode")
      Cc: stable@vger.kernel.org
      Suggested-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Reviewed-by: default avatarSean Christopherson <sean.j.christopherson@intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      342993f9
  2. 02 Mar, 2020 2 commits
    • Haiwei Li's avatar
      KVM: SVM: Fix the svm vmexit code for WRMSR · aaca2100
      Haiwei Li authored
      In svm, exit_code for MSR writes is not EXIT_REASON_MSR_WRITE which
      belongs to vmx.
      
      According to amd manual, SVM_EXIT_MSR(7ch) is the exit_code of VMEXIT_MSR
      due to RDMSR or WRMSR access to protected MSR. Additionally, the processor
      indicates in the VMCB's EXITINFO1 whether a RDMSR(EXITINFO1=0) or
      WRMSR(EXITINFO1=1) was intercepted.
      Signed-off-by: default avatarHaiwei Li <lihaiwei@tencent.com>
      Fixes: 1e9e2622 ("KVM: VMX: FIXED+PHYSICAL mode single target IPI fastpath", 2019-11-21)
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      aaca2100
    • Wanpeng Li's avatar
      KVM: X86: Fix dereference null cpufreq policy · 9a11997e
      Wanpeng Li authored
      Naresh Kamboju reported:
      
         Linux version 5.6.0-rc4 (oe-user@oe-host) (gcc version
        (GCC)) #1 SMP Sun Mar 1 22:59:08 UTC 2020
         kvm: no hardware support
         BUG: kernel NULL pointer dereference, address: 000000000000028c
         #PF: supervisor read access in kernel mode
         #PF: error_code(0x0000) - not-present page
         PGD 0 P4D 0
         Oops: 0000 [#1] SMP NOPTI
         CPU: 0 PID: 1 Comm: swapper/0 Not tainted 5.6.0-rc4 #1
         Hardware name: QEMU Standard PC (i440FX + PIIX, 1996),
        04/01/2014
         RIP: 0010:kobject_put+0x12/0x1c0
         Call Trace:
          cpufreq_cpu_put+0x15/0x20
          kvm_arch_init+0x1f6/0x2b0
          kvm_init+0x31/0x290
          ? svm_check_processor_compat+0xd/0xd
          ? svm_check_processor_compat+0xd/0xd
          svm_init+0x21/0x23
          do_one_initcall+0x61/0x2f0
          ? rdinit_setup+0x30/0x30
          ? rcu_read_lock_sched_held+0x4f/0x80
          kernel_init_freeable+0x219/0x279
          ? rest_init+0x250/0x250
          kernel_init+0xe/0x110
          ret_from_fork+0x27/0x50
         Modules linked in:
         CR2: 000000000000028c
         ---[ end trace 239abf40c55c409b ]---
         RIP: 0010:kobject_put+0x12/0x1c0
      
      cpufreq policy which is get by cpufreq_cpu_get() can be NULL if it is failure,
      this patch takes care of it.
      
      Fixes: aaec7c03 (KVM: x86: avoid useless copy of cpufreq policy)
      Reported-by: default avatarNaresh Kamboju <naresh.kamboju@linaro.org>
      Cc: Naresh Kamboju <naresh.kamboju@linaro.org>
      Signed-off-by: default avatarWanpeng Li <wanpengli@tencent.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      9a11997e
  3. 01 Mar, 2020 1 commit
  4. 28 Feb, 2020 9 commits
  5. 24 Feb, 2020 1 commit
  6. 23 Feb, 2020 5 commits
  7. 22 Feb, 2020 3 commits
  8. 21 Feb, 2020 8 commits
  9. 20 Feb, 2020 2 commits
  10. 17 Feb, 2020 3 commits
  11. 12 Feb, 2020 5 commits