Skip to content

Commit 8f7df79

Browse files
Fuad TabbaMarc Zyngier
authored andcommitted
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. Signed-off-by: Fuad Tabba <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Marc Zyngier <[email protected]>
1 parent 2fd5b4b commit 8f7df79

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

arch/arm64/include/asm/kvm_emulate.h

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -619,7 +619,8 @@ static __always_inline void kvm_write_cptr_el2(u64 val)
619619
write_sysreg(val, cptr_el2);
620620
}
621621

622-
static __always_inline u64 kvm_get_reset_cptr_el2(struct kvm_vcpu *vcpu)
622+
/* Resets the value of cptr_el2 when returning to the host. */
623+
static __always_inline void kvm_reset_cptr_el2(struct kvm_vcpu *vcpu)
623624
{
624625
u64 val;
625626

@@ -643,13 +644,6 @@ static __always_inline u64 kvm_get_reset_cptr_el2(struct kvm_vcpu *vcpu)
643644
val &= ~CPTR_EL2_TSM;
644645
}
645646

646-
return val;
647-
}
648-
649-
static __always_inline void kvm_reset_cptr_el2(struct kvm_vcpu *vcpu)
650-
{
651-
u64 val = kvm_get_reset_cptr_el2(vcpu);
652-
653647
kvm_write_cptr_el2(val);
654648
}
655649

0 commit comments

Comments
 (0)