Skip to content

Commit 3663b25

Browse files
Fuad Tabbaoupton
authored andcommitted
KVM: arm64: Refactor kvm_vcpu_enable_ptrauth() for hyp use
Move kvm_vcpu_enable_ptrauth() to a shared header to be used by hypervisor code in protected mode. No functional change intended. Signed-off-by: Fuad Tabba <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Oliver Upton <[email protected]>
1 parent 0546d4a commit 3663b25

File tree

2 files changed

+4
-5
lines changed

2 files changed

+4
-5
lines changed

arch/arm64/include/asm/kvm_emulate.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -693,4 +693,8 @@ static inline bool guest_hyp_sve_traps_enabled(const struct kvm_vcpu *vcpu)
693693
return __guest_hyp_cptr_xen_trap_enabled(vcpu, ZEN);
694694
}
695695

696+
static inline void kvm_vcpu_enable_ptrauth(struct kvm_vcpu *vcpu)
697+
{
698+
vcpu_set_flag(vcpu, GUEST_HAS_PTRAUTH);
699+
}
696700
#endif /* __ARM64_KVM_EMULATE_H__ */

arch/arm64/kvm/reset.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -167,11 +167,6 @@ static void kvm_vcpu_reset_sve(struct kvm_vcpu *vcpu)
167167
memset(vcpu->arch.sve_state, 0, vcpu_sve_state_size(vcpu));
168168
}
169169

170-
static void kvm_vcpu_enable_ptrauth(struct kvm_vcpu *vcpu)
171-
{
172-
vcpu_set_flag(vcpu, GUEST_HAS_PTRAUTH);
173-
}
174-
175170
/**
176171
* kvm_reset_vcpu - sets core registers and sys_regs to reset value
177172
* @vcpu: The VCPU pointer

0 commit comments

Comments
 (0)