arm64/vmm: Fix the SPAN check

When raising an exception we may need to set the SPSR_EL1.PAN field.
The check for this was incorrect meaning it would be set when it
shouldn't be.

Reviewed by:	markj
Sponsored by:	Arm Ltd
Differential Revision:	https://reviews.freebsd.org/D45717
This commit is contained in:
Andrew Turner 2024-06-25 09:41:57 +01:00
parent c36fa8d502
commit 0cdd0032a7

View File

@ -1108,7 +1108,7 @@ vmmops_run(void *vcpui, register_t pc, pmap_t pmap, struct vm_eventinfo *evinfo)
* Update fields that may change on exeption entry
* based on how sctlr_el1 is configured.
*/
if ((hypctx->sctlr_el1 & SCTLR_SPAN) != 0)
if ((hypctx->sctlr_el1 & SCTLR_SPAN) == 0)
hypctx->tf.tf_spsr |= PSR_PAN;
if ((hypctx->sctlr_el1 & SCTLR_DSSBS) == 0)
hypctx->tf.tf_spsr &= ~PSR_SSBS;