From 4fea6a97094afea4b6e4a5be7c323eaab7a7d8a4 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 a66d5ed1ba97..003a74fe1cb5 100644 --- a/sys/arm64/vmm/vmm_arm64.c +++ b/sys/arm64/vmm/vmm_arm64.c @@ -1189,6 +1189,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