Page MenuHomeFreeBSD

exterr: allow exterr to fit pointers on CHERI targets
ClosedPublic

Authored by brooks on Mon, Jul 6, 4:05 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Jul 21, 8:45 AM
Unknown Object (File)
Tue, Jul 21, 7:58 AM
Unknown Object (File)
Mon, Jul 20, 6:46 AM
Unknown Object (File)
Mon, Jul 20, 4:49 AM
Unknown Object (File)
Mon, Jul 20, 2:44 AM
Unknown Object (File)
Sun, Jul 19, 6:01 PM
Unknown Object (File)
Thu, Jul 16, 4:52 AM
Unknown Object (File)
Mon, Jul 13, 2:15 PM
Subscribers

Details

Summary

Switch to uint64ptr_t which is a uint64_t on traditional architectures
and a uintptr_t on CHERI architectures. This has no ABI impact on
non-CHERI kernels.

Fix truncation of 64-bit values on 32-bit kernels.

Effort: CHERI upstreaming
Sponsored by: Innovate UK

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 74805
Build 71688: arc lint + arc unit

Event Timeline

brooks requested review of this revision.Mon, Jul 6, 4:05 PM
sys/sys/_uexterror.h
23–25

Probably these should also be __uint64ptr_t. On CHERI there's also an 8-byte gap above p1 which should maybe be explicit.

sys/sys/exterrvar.h
62

This was truncating 64-bit values on 32-bit kernels.

This revision is now accepted and ready to land.Tue, Jul 7, 1:55 AM

Expand __uint64ptr_t to spares

This revision now requires review to proceed.Tue, Jul 14, 8:03 PM
This revision was not accepted when it landed; it landed in state Needs Review.Wed, Jul 15, 9:33 AM
This revision was automatically updated to reflect the committed changes.

This change broke the build on armv7 (32-bit ARM). I addressed the definition/declaration mismatch in rG5cafd6213f14.

This change broke the build on armv7 (32-bit ARM). I addressed the definition/declaration mismatch in rG5cafd6213f14.

This is the supposed fix, I am waiting for tinderbox to finish.

diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index c867867f2618..c16e806e0bd7 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -2353,8 +2353,8 @@ kern_exterrctl(struct thread *td, u_int op, u_int flags, void *ptr)
 }
 
 int
-exterr_set(int eerror, int category, const char *mmsg, uintptr_t pp1,
-    uintptr_t pp2, int line)
+exterr_set(int eerror, int category, const char *mmsg, uint64ptr_t pp1,
+    uint64ptr_t pp2, int line)
 {
   struct thread *td;
 
In D58056#1336833, @kib wrote:

This change broke the build on armv7 (32-bit ARM). I addressed the definition/declaration mismatch in rG5cafd6213f14.

This is the supposed fix, I am waiting for tinderbox to finish.

diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index c867867f2618..c16e806e0bd7 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -2353,8 +2353,8 @@ kern_exterrctl(struct thread *td, u_int op, u_int flags, void *ptr)
 }
 
 int
-exterr_set(int eerror, int category, const char *mmsg, uintptr_t pp1,
-    uintptr_t pp2, int line)
+exterr_set(int eerror, int category, const char *mmsg, uint64ptr_t pp1,
+    uint64ptr_t pp2, int line)
 {
   struct thread *td;
 

I *just* committed that 😅...

In D58056#1336833, @kib wrote:

This change broke the build on armv7 (32-bit ARM). I addressed the definition/declaration mismatch in rG5cafd6213f14.

This is the supposed fix, I am waiting for tinderbox to finish.

diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index c867867f2618..c16e806e0bd7 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -2353,8 +2353,8 @@ kern_exterrctl(struct thread *td, u_int op, u_int flags, void *ptr)
 }
 
 int
-exterr_set(int eerror, int category, const char *mmsg, uintptr_t pp1,
-    uintptr_t pp2, int line)
+exterr_set(int eerror, int category, const char *mmsg, uint64ptr_t pp1,
+    uint64ptr_t pp2, int line)
 {
   struct thread *td;
 

I *just* committed that 😅...

No, you did not. You committed something that uses non-existent uintptr64_t type.