Skip to content

Commit 021234e

Browse files
author
Marc Zyngier
committed
KVM: arm64: Make kvm_condition_valid32() accessible from EL2
As we're about to trap CP15 accesses and handle them at EL2, we need to evaluate whether or not the condition flags are valid, as an implementation is allowed to trap despite the condition not being met. Tagging the function as __hyp_text allows this. We still rely on the cc_map array to be mapped at EL2 by virtue of being "const", and the linker to only emit relative references. Tested-by: Alexander Graf <agraf@suse.de> Acked-by: David Daney <david.daney@cavium.com> Reviewed-by: Eric Auger <eric.auger@redhat.com> Signed-off-by: Marc Zyngier <marc.zyngier@arm.com> Signed-off-by: Christoffer Dall <cdall@linaro.org>
1 parent 63000dd commit 021234e

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎virt/kvm/arm/aarch32.c‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static const unsigned short cc_map[16] = {
6060
/*
6161
* Check if a trapped instruction should have been executed or not.
6262
*/
63-
bool kvm_condition_valid32(const struct kvm_vcpu *vcpu)
63+
bool __hyp_text kvm_condition_valid32(const struct kvm_vcpu *vcpu)
6464
{
6565
unsigned long cpsr;
6666
u32 cpsr_cond;

0 commit comments

Comments
 (0)