Skip to content

Commit d7ad41a

Browse files
Jia Qingtongchenhuacai
authored andcommitted
LoongArch: KVM: always make pte young in page map's fast path
It seems redundant to check if pte is young before the call to kvm_pte_mkyoung() in kvm_map_page_fast(). Just remove the check. Reviewed-by: Bibo Mao <[email protected]> Signed-off-by: Jia Qingtong <[email protected]> Signed-off-by: Huacai Chen <[email protected]>
1 parent ebf0027 commit d7ad41a

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

arch/loongarch/kvm/mmu.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -569,10 +569,8 @@ static int kvm_map_page_fast(struct kvm_vcpu *vcpu, unsigned long gpa, bool writ
569569
}
570570

571571
/* Track access to pages marked old */
572-
new = *ptep;
573-
if (!kvm_pte_young(new))
574-
new = kvm_pte_mkyoung(new);
575-
/* call kvm_set_pfn_accessed() after unlock */
572+
new = kvm_pte_mkyoung(*ptep);
573+
/* call kvm_set_pfn_accessed() after unlock */
576574

577575
if (write && !kvm_pte_dirty(new)) {
578576
if (!kvm_pte_write(new)) {

0 commit comments

Comments
 (0)