git: 3e9e19e9674b - stable/15 - arm64/vmm: Clear all pmc fields
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 09 Oct 2025 16:32:20 UTC
The branch stable/15 has been updated by andrew:
URL: https://cgit.FreeBSD.org/src/commit/?id=3e9e19e9674b710fc65c1aee9b16f65f53c768fa
commit 3e9e19e9674b710fc65c1aee9b16f65f53c768fa
Author: Andrew Turner <andrew@FreeBSD.org>
AuthorDate: 2025-10-02 15:34:23 +0000
Commit: Andrew Turner <andrew@FreeBSD.org>
CommitDate: 2025-10-09 16:31:49 +0000
arm64/vmm: Clear all pmc fields
When clearing pmcntenclr_el0, pmintenclr_el1, and pmovsclr_el0 clear
all bits as new fields may be added in the upper 32-bits.
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D52801
(cherry picked from commit c1723bbe2aa7f6c8b23d3aa97379d89e883b0a93)
---
sys/arm64/vmm/vmm_hyp.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/sys/arm64/vmm/vmm_hyp.c b/sys/arm64/vmm/vmm_hyp.c
index d61885c15871..3b3ed20f0e41 100644
--- a/sys/arm64/vmm/vmm_hyp.c
+++ b/sys/arm64/vmm/vmm_hyp.c
@@ -334,11 +334,11 @@ vmm_hyp_reg_restore(struct hypctx *hypctx, struct hyp *hyp, bool guest)
WRITE_SPECIALREG(pmccntr_el0, hypctx->pmccntr_el0);
WRITE_SPECIALREG(pmccfiltr_el0, hypctx->pmccfiltr_el0);
/* Clear all events/interrupts then enable them */
- WRITE_SPECIALREG(pmcntenclr_el0, 0xfffffffful);
+ WRITE_SPECIALREG(pmcntenclr_el0, ~0ul);
WRITE_SPECIALREG(pmcntenset_el0, hypctx->pmcntenset_el0);
- WRITE_SPECIALREG(pmintenclr_el1, 0xfffffffful);
+ WRITE_SPECIALREG(pmintenclr_el1, ~0ul);
WRITE_SPECIALREG(pmintenset_el1, hypctx->pmintenset_el1);
- WRITE_SPECIALREG(pmovsclr_el0, 0xfffffffful);
+ WRITE_SPECIALREG(pmovsclr_el0, ~0ul);
WRITE_SPECIALREG(pmovsset_el0, hypctx->pmovsset_el0);
switch ((hypctx->pmcr_el0 & PMCR_N_MASK) >> PMCR_N_SHIFT) {