diff options
author | 2024-07-09 16:25:51 +0800 | |
---|---|---|
committer | 2024-07-09 16:25:51 +0800 | |
commit | d7ad41a31d91abd01a4d9b040074d808899636ea (patch) | |
tree | e93b05d329deab9917e56b1d1edf6cf95eecdeb6 | |
parent | LoongArch: KVM: Mark page accessed and dirty with page ref added (diff) | |
download | linux-rng-d7ad41a31d91abd01a4d9b040074d808899636ea.tar.xz linux-rng-d7ad41a31d91abd01a4d9b040074d808899636ea.zip |
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 <maobibo@loongson.cn>
Signed-off-by: Jia Qingtong <jiaqingtong97@gmail.com>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
-rw-r--r-- | arch/loongarch/kvm/mmu.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/arch/loongarch/kvm/mmu.c b/arch/loongarch/kvm/mmu.c index ad80a837e068..2634a9e8d82c 100644 --- a/arch/loongarch/kvm/mmu.c +++ b/arch/loongarch/kvm/mmu.c @@ -569,10 +569,8 @@ static int kvm_map_page_fast(struct kvm_vcpu *vcpu, unsigned long gpa, bool writ } /* Track access to pages marked old */ - new = *ptep; - if (!kvm_pte_young(new)) - new = kvm_pte_mkyoung(new); - /* call kvm_set_pfn_accessed() after unlock */ + new = kvm_pte_mkyoung(*ptep); + /* call kvm_set_pfn_accessed() after unlock */ if (write && !kvm_pte_dirty(new)) { if (!kvm_pte_write(new)) { |