lkml.org 
[lkml]   [2022]   [Apr]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH] KVM: x86/mmu: remove unnecessary kvm_shadow_root_allocated() check
Date
When we reach here, the return value of kvm_shadow_root_allocated()
has already been checked to false under kvm->slots_arch_lock.
So remove the unnecessary recheck.

Signed-off-by: luofei <luofei@unicloud.com>
---
arch/x86/kvm/mmu/mmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index 8f19ea752704..1978ee527298 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -3394,7 +3394,7 @@ static int mmu_first_shadow_root_alloc(struct kvm *kvm)
* Check if anything actually needs to be allocated, e.g. all metadata
* will be allocated upfront if TDP is disabled.
*/
- if (kvm_memslots_have_rmaps(kvm) &&
+ if (!is_tdp_mmu_enabled(kvm) &&
kvm_page_track_write_tracking_enabled(kvm))
goto out_success;

--
2.27.0
\
 
 \ /
  Last update: 2022-04-07 17:29    [W:0.049 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site