projects
/
linux-2.6-microblaze.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
| inline |
side by side
kvm: mmu: fix is_tdp_mmu_check when the TDP MMU is not in use
[linux-2.6-microblaze.git]
/
arch
/
x86
/
kvm
/
mmu
/
tdp_mmu.c
diff --git
a/arch/x86/kvm/mmu/tdp_mmu.c
b/arch/x86/kvm/mmu/tdp_mmu.c
index
27e381c
..
ff28a5c
100644
(file)
--- 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;
}