Skip to content

Commit 4954ec0

Browse files
committed
arm64/vmm: Save dbgclaimset_el1
It may be used by the guest. Sponsored by: Arm Ltd Differential Revision: https://reviews.freebsd.org/D52803
1 parent 35d0c9e commit 4954ec0

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

sys/arm64/vmm/arm64.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@ struct hypctx {
8787
uint64_t pmevcntr_el0[31];
8888
uint64_t pmevtyper_el0[31];
8989

90+
uint64_t dbgclaimset_el1;
9091
uint64_t dbgbcr_el1[16]; /* Debug Breakpoint Control Registers */
9192
uint64_t dbgbvr_el1[16]; /* Debug Breakpoint Value Registers */
9293
uint64_t dbgwcr_el1[16]; /* Debug Watchpoint Control Registers */

sys/arm64/vmm/vmm_hyp.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ vmm_hyp_reg_store(struct hypctx *hypctx, struct hyp *hyp, bool guest,
121121
}
122122
}
123123

124+
hypctx->dbgclaimset_el1 = READ_SPECIALREG(dbgclaimset_el1);
125+
124126
dfr0 = READ_SPECIALREG(id_aa64dfr0_el1);
125127
switch (ID_AA64DFR0_BRPs_VAL(dfr0) - 1) {
126128
#define STORE_DBG_BRP(x) \
@@ -394,6 +396,9 @@ vmm_hyp_reg_restore(struct hypctx *hypctx, struct hyp *hyp, bool guest,
394396
#undef LOAD_PMU
395397
}
396398

399+
WRITE_SPECIALREG(dbgclaimclr_el1, ~0ul);
400+
WRITE_SPECIALREG(dbgclaimclr_el1, hypctx->dbgclaimset_el1);
401+
397402
dfr0 = READ_SPECIALREG(id_aa64dfr0_el1);
398403
switch (ID_AA64DFR0_BRPs_VAL(dfr0) - 1) {
399404
#define LOAD_DBG_BRP(x) \

0 commit comments

Comments
 (0)