From 2210edc40cdba8dd3edeff3e4a9309c33cf0c707 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 | 3 +++ 1 file changed, 3 insertions(+) diff --git a/sys/arm64/vmm/vmm_arm64.c b/sys/arm64/vmm/vmm_arm64.c index a66d5ed1ba97..491b95454bb4 100644 --- a/sys/arm64/vmm/vmm_arm64.c +++ b/sys/arm64/vmm/vmm_arm64.c @@ -1189,6 +1189,9 @@ 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) + hypctx->tf.tf_spsr |= hypctx->spsr_el1 & PSR_C64; +#endif /* * Update fields that may change on exeption entry