Skip to content

Commit 151b92c

Browse files
Yicong Yangwilldeacon
authored andcommitted
KVM: arm64: Enable FEAT_{LS64, LS64_V} in the supported guest
Using FEAT_{LS64, LS64_V} instructions in a guest is also controlled by HCRX_EL2.{EnALS, EnASR}. Enable it if guest has related feature. Acked-by: Arnd Bergmann <arnd@arndb.de> Acked-by: Oliver Upton <oupton@kernel.org> Signed-off-by: Yicong Yang <yangyicong@hisilicon.com> Signed-off-by: Zhou Wang <wangzhou1@hisilicon.com> Signed-off-by: Will Deacon <will@kernel.org>
1 parent dea58da commit 151b92c

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

arch/arm64/include/asm/kvm_emulate.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -695,6 +695,12 @@ static inline void vcpu_set_hcrx(struct kvm_vcpu *vcpu)
695695

696696
if (kvm_has_sctlr2(kvm))
697697
vcpu->arch.hcrx_el2 |= HCRX_EL2_SCTLR2En;
698+
699+
if (kvm_has_feat(kvm, ID_AA64ISAR1_EL1, LS64, LS64))
700+
vcpu->arch.hcrx_el2 |= HCRX_EL2_EnALS;
701+
702+
if (kvm_has_feat(kvm, ID_AA64ISAR1_EL1, LS64, LS64_V))
703+
vcpu->arch.hcrx_el2 |= HCRX_EL2_EnASR;
698704
}
699705
}
700706
#endif /* __ARM64_KVM_EMULATE_H__ */

0 commit comments

Comments
 (0)