Kernel KVM virtualization development
 help / color / mirror / Atom feed
* [PATCH] KVM: x86/mmu: fix counting of rmap entries in pte_list_add
@ 2020-09-21 10:29 Li RongQing
  2020-09-21 19:40 ` Sean Christopherson
  0 siblings, 1 reply; 4+ messages in thread
From: Li RongQing @ 2020-09-21 10:29 UTC (permalink / raw)
  To: lirongqing, kvm, x86

counting of rmap entries was missed when desc->sptes is full
and desc->more is NULL

Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 arch/x86/kvm/mmu/mmu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index a5d0207e7189..8ffa4e40b650 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -1280,6 +1280,7 @@ static int pte_list_add(struct kvm_vcpu *vcpu, u64 *spte,
 		if (desc->sptes[PTE_LIST_EXT-1]) {
 			desc->more = mmu_alloc_pte_list_desc(vcpu);
 			desc = desc->more;
+			count += PTE_LIST_EXT;
 		}
 		for (i = 0; desc->sptes[i]; ++i)
 			++count;
-- 
2.16.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread
* [PATCH] KVM: x86/mmu: fix counting of rmap entries in pte_list_add
@ 2020-09-01  9:26 Li RongQing
  0 siblings, 0 replies; 4+ messages in thread
From: Li RongQing @ 2020-09-01  9:26 UTC (permalink / raw)
  To: x86, kvm

counting of rmap entries was missed when desc->sptes is full
and desc->more is false

Cc: <stable@vger.kernel.org>
Signed-off-by: Li RongQing <lirongqing@baidu.com>
---
 arch/x86/kvm/mmu/mmu.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/arch/x86/kvm/mmu/mmu.c b/arch/x86/kvm/mmu/mmu.c
index a5d0207e7189..8ffa4e40b650 100644
--- a/arch/x86/kvm/mmu/mmu.c
+++ b/arch/x86/kvm/mmu/mmu.c
@@ -1280,6 +1280,7 @@ static int pte_list_add(struct kvm_vcpu *vcpu, u64 *spte,
 		if (desc->sptes[PTE_LIST_EXT-1]) {
 			desc->more = mmu_alloc_pte_list_desc(vcpu);
 			desc = desc->more;
+			count += PTE_LIST_EXT;
 		}
 		for (i = 0; desc->sptes[i]; ++i)
 			++count;
-- 
2.16.2


^ permalink raw reply related	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2020-09-22  5:39 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-09-21 10:29 [PATCH] KVM: x86/mmu: fix counting of rmap entries in pte_list_add Li RongQing
2020-09-21 19:40 ` Sean Christopherson
2020-09-22  5:23   ` Li,Rongqing
  -- strict thread matches above, loose matches on Subject: below --
2020-09-01  9:26 Li RongQing

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox