Skip to content

Commit

Permalink
vmm: Don't trap access to Morello instructions for guests
Browse files Browse the repository at this point in the history
  • Loading branch information
bsdjhb committed Nov 22, 2024
1 parent 808fb2a commit f2867b8
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions sys/arm64/vmm/vmm_reset.c
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,13 @@ reset_vm_el2_regs(void *vcpu)
el2ctx->cptr_el2 = CPTR_E2H_TRAP_ALL | CPTR_E2H_FPEN;
else
el2ctx->cptr_el2 = CPTR_TRAP_ALL & ~CPTR_TFP;
#if __has_feature(capabilities)
/* Don't trap accesses to capability registers. */
if (in_vhe())
el2ctx->cptr_el2 |= CPTR_E2H_CEN;
else
el2ctx->cptr_el2 &= ~CPTR_TC;
#endif
el2ctx->cptr_el2 &= ~CPTR_TCPAC;
/*
* Disable interrupts in the guest. The guest OS will re-enable
Expand Down

0 comments on commit f2867b8

Please sign in to comment.