diff mbox series

[Bug,210695] error: kvm run failed Invalid argument

Message ID bug-210695-28872-b4D0Lqj7rJ@https.bugzilla.kernel.org/ (mailing list archive)
State New, archived
Headers show
Series [Bug,210695] error: kvm run failed Invalid argument | expand

Commit Message

bugzilla-daemon@bugzilla.kernel.org Dec. 16, 2020, 2:28 a.m. UTC
https://bugzilla.kernel.org/show_bug.cgi?id=210695

--- Comment #2 from Richard Herbert (rherbert@sympatico.ca) ---
Hi, Sean.  I'm no programmer, unfortunately, but when kernel 5.10-rc4 was
released, this was the patch that I suspected had fixed the problem.  I don't
find this code is 5.10.1, so it must have been reverted or moved.
diff mbox series

Patch

diff --git a/arch/x86/kvm/mmu/tdp_mmu.c b/arch/x86/kvm/mmu/tdp_mmu.c
index 27e381c9da6c2..ff28a5c6abd63 100644
--- a/arch/x86/kvm/mmu/tdp_mmu.c
+++ b/arch/x86/kvm/mmu/tdp_mmu.c
@@ -49,7 +49,14 @@  bool is_tdp_mmu_root(struct kvm *kvm, hpa_t hpa)
 {
        struct kvm_mmu_page *sp;

+       if (!kvm->arch.tdp_mmu_enabled)
+               return false;
+       if (WARN_ON(!VALID_PAGE(hpa)))
+               return false;
+
        sp = to_shadow_page(hpa);
+       if (WARN_ON(!sp))
+               return false;

        return sp->tdp_mmu_page && sp->root_count;
 }