Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CapbilityPtr and Add SuccessAddr and SuccessPtr syscall variants #4174

Merged
merged 47 commits into from
Nov 17, 2024
Merged
Changes from 1 commit
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
12abe15
MetaPtr + usize/u32 changes
Aug 17, 2024
c32507d
Have MetaPtr wrap a pointer not usize
Oct 14, 2024
677183f
Link to CHERI tracking issue
Oct 14, 2024
6254b9e
Add explicit return codes for usize/ptr
Oct 14, 2024
a5ee396
Better comment for MetaPtr
Oct 14, 2024
fd51098
Fix typo
Oct 14, 2024
c97deea
Apply comment suggestions
LawrenceEsswood Oct 21, 2024
291c8f4
Rename MetaPtr -> CapabilityPtr
Oct 29, 2024
695af1b
Add comment saying into_compat is for legacy only
Oct 29, 2024
7ec6bdd
capability_ptr: update doc to reflect meaning
alevy Nov 4, 2024
d0fa5fc
Update kernel/src/syscall.rs
LawrenceEsswood Nov 8, 2024
be62a66
Update kernel/src/process.rs
LawrenceEsswood Nov 8, 2024
950deb2
Revert notes change
Nov 8, 2024
236a8ac
Remove extra cast step
Nov 8, 2024
a4e5936
Preface internal Google bug tracker
Nov 8, 2024
9ac666b
Remove as_checked_ptr until CHERI lands
Nov 8, 2024
010bf22
Change panic for assert and checked alignment too
Nov 8, 2024
604460c
Make the oddly chosen ANY permission a NONE permission
Nov 8, 2024
79b2b8d
Add provenance notes
Nov 8, 2024
6feb692
Refine CapabilityPtr description slightly
Nov 8, 2024
f800ddd
Minor changes to encode
Nov 8, 2024
2cd33d2
Move capability_ptr to utilities
Nov 8, 2024
bf24e72
Update kernel/src/process.rs
LawrenceEsswood Nov 11, 2024
d569776
Rename into_compat
Nov 11, 2024
743c8cd
Document what authority the CapabilityPtr from brk/sbrk should have
Nov 11, 2024
144269e
Do not pollute scope with Execute
Nov 11, 2024
cc0b53e
Add comment to construction of intial fn
Nov 11, 2024
45f8a44
Remove mention of CHERI
Nov 11, 2024
391dfc8
Use .cast_mut(), not as
Nov 11, 2024
8f8ce44
Document all methods on CapabilityPtr
Nov 11, 2024
a5e5a6d
More formatting/comments/name change for permissions
Nov 11, 2024
f3feec6
Style changes
Nov 11, 2024
a001b33
kernel/syscall: split out encode_syscall_return, create TRD104 subset
lschuermann Nov 8, 2024
7ea663f
kernel: fix rustdoc links
lschuermann Nov 12, 2024
9560125
Merge remote-tracking branch 'upstream/master' into meta_ptr
alevy Nov 13, 2024
670a5d0
kernel: handle_syscall: elaborate on NonNull change for CapabilityPtr
lschuermann Nov 13, 2024
3810ca8
kernel/capability_ptr: make new_with_metadata an unsafe method
lschuermann Nov 13, 2024
0709e6a
kernel/arch_helpers: remove 32bit infix from encode_syscall_return_tr…
lschuermann Nov 13, 2024
1ebf509
kernel: remove CapabilityPtr aliases for now
alevy Nov 14, 2024
d23676d
kernel: remove stale reference in upcall doc
alevy Nov 14, 2024
38a5188
kernel: remove unused syscall return variant
alevy Nov 14, 2024
08caaa5
kernel: rename capability_ptr constructor
alevy Nov 14, 2024
c6156c8
kernel: documentation nits
alevy Nov 14, 2024
a803e1e
kernel: remove SuccessUsize in favor of SuccessPtr
alevy Nov 14, 2024
096536c
kernel: fix import order nit
alevy Nov 14, 2024
3c1876b
kernel: memop: add provenance to memop returns
alevy Nov 14, 2024
37cb959
Merge remote-tracking branch 'upstream/master' into meta_ptr
lschuermann Nov 14, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
kernel: handle_syscall: elaborate on NonNull change for CapabilityPtr
  • Loading branch information
lschuermann committed Nov 13, 2024
commit 670a5d00d4d9e4d4ed2664ee1c96ab16236cb59a
26 changes: 20 additions & 6 deletions kernel/src/kernel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -876,12 +876,26 @@ impl Kernel {
subscribe_num: subdriver_number,
};

// TODO: when the compiler supports capability types bring this back
// as a NonNull type. https://github.com/tock/tock/issues/4134.
// First check if `upcall_ptr` is null. A null
// `upcall_ptr` will result in `None` here and
// represents the special "unsubscribe" operation.
// let ptr = NonNull::new(upcall_ptr);
// TODO: when the compiler supports capability types
// bring this back as a NonNull
// type. https://github.com/tock/tock/issues/4134.
//
// Previously, we had a NonNull type (that had a niche)
// here, and could wrap that in Option to fill the niche
// and handle the Null case. CapabilityPtr is filling
// the gap left by * const(), which does not have the
// niche and allows NULL internally. Having a CHERI
// capability type with a niche is (maybe?) predicated
// on having better compiler support.
// Option<NonNull<()>> is preferable here, and it should
// go back to it just as soon as we can express "non
// null capability". For now, checking for the null case
// is handled internally in each `map_or` call.
//
//First check if `upcall_ptr` is null. A null
//`upcall_ptr` will result in `None` here and
//represents the special "unsubscribe" operation.
//let ptr = NonNull::new(upcall_ptr);

// For convenience create an `Upcall` type now. This is
// just a data structure and doesn't do any checking or
Expand Down
Loading