From 57884781042c9003e8a6cc3f74cd9bd83638736d Mon Sep 17 00:00:00 2001 From: Mark Johnston Date: Wed, 27 Nov 2024 21:52:47 +0000 Subject: [PATCH] arm64/vmm: Preserve PSR_C64 when injecting an exception --- sys/arm64/vmm/vmm_arm64.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/sys/arm64/vmm/vmm_arm64.c b/sys/arm64/vmm/vmm_arm64.c index eeea35be3382..95c2e0f2ee41 100644 --- a/sys/arm64/vmm/vmm_arm64.c +++ b/sys/arm64/vmm/vmm_arm64.c @@ -1188,6 +1188,10 @@ vmmops_run(void *vcpui, uintcap_t pc, pmap_t pmap, struct vm_eventinfo *evinfo) /* Set the new cpsr */ hypctx->tf.tf_spsr = hypctx->spsr_el1 & PSR_FLAGS; hypctx->tf.tf_spsr |= PSR_DAIF | PSR_M_EL1h; +#if __has_feature(capabilities) + if ((hypctx->cctlr_el1 & CCTLR_EL1_C64E_MASK) != 0) + hypctx->tf.tf_spsr |= PSR_C64; +#endif /* * Update fields that may change on exeption entry