diff options
| author | Andrew Turner <andrew@FreeBSD.org> | 2025-10-02 15:34:43 +0000 |
|---|---|---|
| committer | Andrew Turner <andrew@FreeBSD.org> | 2025-10-02 16:21:33 +0000 |
| commit | 4954ec00c4200d8bfd29875fc13f541942209824 (patch) | |
| tree | 29d377f977d7927d2f547f17b9ae5fc544b5a51d | |
| parent | 35d0c9efb17a9a7fea57c3a4a056141b21dad18f (diff) | |
arm64/vmm: Save dbgclaimset_el1
It may be used by the guest.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D52803
| -rw-r--r-- | sys/arm64/vmm/arm64.h | 1 | ||||
| -rw-r--r-- | sys/arm64/vmm/vmm_hyp.c | 5 |
2 files changed, 6 insertions, 0 deletions
diff --git a/sys/arm64/vmm/arm64.h b/sys/arm64/vmm/arm64.h index 29279f16d151..334b795832a3 100644 --- a/sys/arm64/vmm/arm64.h +++ b/sys/arm64/vmm/arm64.h @@ -87,6 +87,7 @@ struct hypctx { uint64_t pmevcntr_el0[31]; uint64_t pmevtyper_el0[31]; + uint64_t dbgclaimset_el1; uint64_t dbgbcr_el1[16]; /* Debug Breakpoint Control Registers */ uint64_t dbgbvr_el1[16]; /* Debug Breakpoint Value Registers */ uint64_t dbgwcr_el1[16]; /* Debug Watchpoint Control Registers */ diff --git a/sys/arm64/vmm/vmm_hyp.c b/sys/arm64/vmm/vmm_hyp.c index b7a621c782b7..b8c6d2ab7a9a 100644 --- a/sys/arm64/vmm/vmm_hyp.c +++ b/sys/arm64/vmm/vmm_hyp.c @@ -121,6 +121,8 @@ vmm_hyp_reg_store(struct hypctx *hypctx, struct hyp *hyp, bool guest, } } + hypctx->dbgclaimset_el1 = READ_SPECIALREG(dbgclaimset_el1); + dfr0 = READ_SPECIALREG(id_aa64dfr0_el1); switch (ID_AA64DFR0_BRPs_VAL(dfr0) - 1) { #define STORE_DBG_BRP(x) \ @@ -394,6 +396,9 @@ vmm_hyp_reg_restore(struct hypctx *hypctx, struct hyp *hyp, bool guest, #undef LOAD_PMU } + WRITE_SPECIALREG(dbgclaimclr_el1, ~0ul); + WRITE_SPECIALREG(dbgclaimclr_el1, hypctx->dbgclaimset_el1); + dfr0 = READ_SPECIALREG(id_aa64dfr0_el1); switch (ID_AA64DFR0_BRPs_VAL(dfr0) - 1) { #define LOAD_DBG_BRP(x) \ |
