diff options
author | Jia Qingtong <jiaqingtong97@gmail.com> | 2024-07-09 16:25:51 +0800 |
---|---|---|
committer | Huacai Chen <chenhuacai@loongson.cn> | 2024-07-09 16:25:51 +0800 |
commit | d7ad41a31d91abd01a4d9b040074d808899636ea (patch) | |
tree | e93b05d329deab9917e56b1d1edf6cf95eecdeb6 /arch/loongarch/kvm | |
parent | ebf00272da5c32ecd9f28e56b71bdfd5f11227e6 (diff) | |
download | lwn-d7ad41a31d91abd01a4d9b040074d808899636ea.tar.gz lwn-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>
Diffstat (limited to 'arch/loongarch/kvm')
-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)) { |