FROMGIT: KVM: arm64: Refactor kvm_reset_cptr_el2()
Fold kvm_get_reset_cptr_el2() into kvm_reset_cptr_el2(), since it is its only caller. Add a comment to clarify that this function is meant for the host value of cptr_el2. No functional change intended. Bug: 357781595 Link: https://lore.kernel.org/all/20241216105057.579031-14-tabba@google.com/ (cherry picked from commit 8f7df795b2da0564b22a03c4aceec90bfc5e1b1b https://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm.git/ next) Change-Id: Ib0c5010dcb4763f34dce270385d068d210305d29 Signed-off-by: Fuad Tabba <tabba@google.com>
This commit is contained in:
@@ -759,7 +759,8 @@ static __always_inline void kvm_write_cptr_el2(u64 val)
|
||||
write_sysreg(val, cptr_el2);
|
||||
}
|
||||
|
||||
static __always_inline u64 kvm_get_reset_cptr_el2(struct kvm_vcpu *vcpu)
|
||||
/* Resets the value of cptr_el2 when returning to the host. */
|
||||
static __always_inline void kvm_reset_cptr_el2(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
u64 val;
|
||||
|
||||
@@ -783,13 +784,6 @@ static __always_inline u64 kvm_get_reset_cptr_el2(struct kvm_vcpu *vcpu)
|
||||
val &= ~CPTR_EL2_TSM;
|
||||
}
|
||||
|
||||
return val;
|
||||
}
|
||||
|
||||
static __always_inline void kvm_reset_cptr_el2(struct kvm_vcpu *vcpu)
|
||||
{
|
||||
u64 val = kvm_get_reset_cptr_el2(vcpu);
|
||||
|
||||
kvm_write_cptr_el2(val);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user