From 16710b1a068f35bbec7bc18c9038518bfbe8bedd Mon Sep 17 00:00:00 2001 From: John Baldwin Date: Fri, 15 Mar 2024 09:41:50 -0700 Subject: [PATCH] arm64: Fix incorrect #ifdef for purecap kernels in DDB symtab setup This was exposed by the previous upstream commit which finally enabled the DDB symtab setup code. --- sys/arm64/arm64/machdep_boot.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/arm64/arm64/machdep_boot.c b/sys/arm64/arm64/machdep_boot.c index 5f7117355271..2f8c00f6719f 100644 --- a/sys/arm64/arm64/machdep_boot.c +++ b/sys/arm64/arm64/machdep_boot.c @@ -236,8 +236,9 @@ freebsd_parse_boot_param(struct arm64_bootparams *abp) #ifdef DDB ksym_start = MD_FETCH(kmdp, MODINFOMD_SSYM, vm_offset_t); ksym_end = MD_FETCH(kmdp, MODINFOMD_ESYM, vm_offset_t); -#ifdef __CHERI_PURECAP_KERNEL__ - ksym_start = cheri_setaddress(kernel_root_cap, ksym_start); +#ifdef __CHERI_PURE_CAPABILITY__ + ksym_start = (vm_pointer_t)cheri_setaddress(kernel_root_cap, + ksym_start); ksym_start = cheri_setbounds(ksym_start, (ptraddr_t)ksym_end - (ptraddr_t)ksym_start); ksym_start = cheri_andperm(ksym_start,