Skip to contentSkip to conversation

KVM: arm64: Remove redundant kvm_set_pfn_accessed() from user_mem_abort()

PATCH Applied Fuad Tabba 3 participants 3 messages Jul 31, 2023 – Aug 8, 2023

Subsystems (2)
lore
Share & tools
lore

Fuad Tabba

author
#0 lore raw

PATCH 1/1 KVM: arm64: Remove redundant kvm_set_pfn_accessed() from user_mem_abort()

The function user_mem_abort() calls kvm_release_pfn_clean(), which eventually calls kvm_set_page_accessed(). Therefore, remove the redundant call to kvm_set_pfn_accessed().

---

Based on 6.5-rc4

The call to kvm_set_pfn_accessed() was originally introduced in 35307b9a5f7e ("arm/arm64: KVM: Implement Stage-2 page aging"). At the time, kvm_release_pfn_clean() did not set accessed (neither directly nor indirectly).

 arch/arm64/kvm/mmu.c | 1 -
 1 file changed, 1 deletion(-)
arch/arm64/kvm/mmu.c +0 -1
index d3b4feed460c..137b775d238b 100644
@@ -1541,7 +1541,6 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
 
 out_unlock:
 	read_unlock(&kvm->mmu_lock);
-	kvm_set_pfn_accessed(pfn);
 	kvm_release_pfn_clean(pfn);
 	return ret != -EAGAIN ? ret : 0;
 }

base-commit: 5d0c230f1de8c7515b6567d9afba1f196fb4e2f4

Signature · 1 line
2.41.0.487.g6d72f3e995-goog
Reviewed-by on v1 1/1
#1 lore raw
Quoted 5 lines · Fuad Tabba

The function user_mem_abort() calls kvm_release_pfn_clean(), which eventually calls kvm_set_page_accessed(). Therefore, remove the redundant call to kvm_set_pfn_accessed().

Quoted 27 lines

---

Based on 6.5-rc4

The call to kvm_set_pfn_accessed() was originally introduced in 35307b9a5f7e ("arm/arm64: KVM: Implement Stage-2 page aging"). At the time, kvm_release_pfn_clean() did not set accessed (neither directly nor indirectly).

  arch/arm64/kvm/mmu.c | 1 -
  1 file changed, 1 deletion(-)
arch/arm64/kvm/mmu.c +0 -1
index d3b4feed460c..137b775d238b 100644
@@ -1541,7 +1541,6 @@ static int user_mem_abort(struct kvm_vcpu *vcpu, phys_addr_t fault_ipa,
 
  out_unlock:
  	read_unlock(&kvm->mmu_lock);
-	kvm_set_pfn_accessed(pfn);
  	kvm_release_pfn_clean(pfn);
  	return ret != -EAGAIN ? ret : 0;
  }

base-commit: 5d0c230f1de8c7515b6567d9afba1f196fb4e2f4

Signature · 1 line
Shaoqin
maintainer Applied
#2 lore raw
In reply to Fuad Tabba
Quoted 3 lines · Fuad Tabba

The function user_mem_abort() calls kvm_release_pfn_clean(), which eventually calls kvm_set_page_accessed(). Therefore, remove the redundant call to kvm_set_pfn_accessed().

Applied to next, thanks!

[1/1] KVM: arm64: Remove redundant kvm_set_pfn_accessed() from user_mem_abort()

      commit: 4460a7dc77d00340c59f7e4252c65efd5fbe877b

Cheers,

	M.
Signature · 1 line
Without deviation from the norm, progress is not possible.