Re: git: f38792ffc2db - main - arm64/vmm: Clean up enabling guest timer access
- In reply to: Andrew Turner : "git: f38792ffc2db - main - arm64/vmm: Clean up enabling guest timer access"
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Thu, 25 Sep 2025 18:49:16 UTC
On Tue Sep 23, 2025 at 8:09 PM +0300, Andrew Turner wrote:
> The branch main has been updated by andrew:
>
> URL: https://cgit.FreeBSD.org/src/commit/?id=f38792ffc2db67ca82026eb4861f37fe7ac7c38e
>
> commit f38792ffc2db67ca82026eb4861f37fe7ac7c38e
> Author: Andrew Turner <andrew@FreeBSD.org>
> AuthorDate: 2025-09-22 17:08:06 +0000
> Commit: Andrew Turner <andrew@FreeBSD.org>
> CommitDate: 2025-09-23 17:08:36 +0000
>
> arm64/vmm: Clean up enabling guest timer access
>
> Clean up the name of CNTHCTL_EL2 field macros and expand to include
> more fields. This makes it easier to see which accesses are trapped or
> not trapped.
>
> While here set the register directly. We already set it in locore.S so
> there is no need to read that and modify it.
>
> Sponsored by: Arm Ltd
> Differential Revision: https://reviews.freebsd.org/D51817
> ---
> sys/arm64/arm64/locore.S | 4 +--
> sys/arm64/include/hypervisor.h | 79 ++++++++++++++++++++++++++++++++++++------
> sys/arm64/vmm/io/vtimer.c | 31 ++++++++++-------
> 3 files changed, 88 insertions(+), 26 deletions(-)
>
> diff --git a/sys/arm64/arm64/locore.S b/sys/arm64/arm64/locore.S
> index 50a3eda846da..d35e334905a7 100644
> --- a/sys/arm64/arm64/locore.S
> +++ b/sys/arm64/arm64/locore.S
> @@ -418,7 +418,7 @@ LENTRY(enter_kernel_el)
>
> msr SCTLR_EL12_REG, x2
> mov x2, xzr /* CPTR_EL2 is managed by vfp.c */
> - ldr x3, =(CNTHCTL_E2H_EL1PCTEN | CNTHCTL_E2H_EL1PTEN)
> + ldr x3, =(CNTHCTL_E2H_EL1PCTEN_NOTRAP | CNTHCTL_E2H_EL1PTEN_NOTRAP)
> ldr x5, =(PSR_DAIF | PSR_M_EL2h)
> b .Ldone_vhe
Just an FYI:
The clang-14 cross build fails on this. Seems like it doesn't like
having a suffix on the integer literal.
/home/runner/work/freebsd-src/freebsd-src/sys/arm64/arm64/locore.S:421:16:
error: expected ')'
ldr x3, =((0x1ul << 10) | (0x1ul << 11))
^
/home/runner/work/freebsd-src/freebsd-src/sys/arm64/arm64/locore.S:432:16:
error: expected ')'
ldr x3, =((0x1ul << 0) | (0x1ul << 1))
^
--- locore.o ---
*** [locore.o] Error code 1
https://github.com/freebsd/freebsd-src/actions/runs/18014912022/job/51257258696