-
Notifications
You must be signed in to change notification settings - Fork 688
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 userspace support for the Key/Value System #2928
Conversation
}) | ||
} | ||
|
||
fn check_queue(&self) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This seems out of place here, but, I feel like you've come this far, maybe it's worth doing the userspace virtualization too?
00bb0dc
to
c421903
Compare
c421903
to
610ff10
Compare
Just pushed an update! |
kernel/src/process.rs
Outdated
/// Get the process `write_id`. | ||
/// Returns `None` if a `write_id` is not included. | ||
fn get_write_id(&self) -> Option<u32>; | ||
|
||
/// Get the `read_ids`. | ||
/// Returns `None` if a `read_ids` is not included. | ||
fn get_read_ids(&self) -> Option<[u32; 8]>; | ||
|
||
/// Get the number of `read_ids`. | ||
/// Returns `None` if a `read_ids` is not included. | ||
fn num_read_ids(&self) -> Option<usize>; | ||
|
||
/// Get the `access_ids`. | ||
/// Returns `None` if a `access_ids` is not included. | ||
fn get_access_ids(&self) -> Option<[u32; 8]>; | ||
|
||
/// Get the number of `access_ids`. | ||
/// Returns `None` if a `access_ids` is not included. | ||
fn num_access_ids(&self) -> Option<usize>; | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
All boards pay for the code size of this support, even if they do not use the KV system. Looks like it is about 250 bytes per board, which is of course not a ton. I think long-term it is important for Tock to find ways to expose TBF header extensions to capsules in a configurable manner, but won't ask to block this PR on that support
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hopefully long term we can eliminate virtual functions with rust-lang/rust#68262
1582745
to
61caaac
Compare
I marked this last-call, but pinging in case anyone else wants to do a final review |
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
If the total length is too long for the buffer, let's at least return some of the data and an error. This is really useful when trying to check is a caller has permission to delete a key, as now we don't need a really large buffer to store the value. Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
This is the initial commit of KV Store. KV store is like a virtuliser and exposes the hil::kv_system in a user friendly way that can be used by app drivers or the kernel. Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
Signed-off-by: Alistair Francis <alistair.francis@wdc.com>
f9892bc
61caaac
to
f9892bc
Compare
Just pushed an update to try and address issues raised by @bradjc in the last OT call |
Take a look at the commits I added. The major change is adding |
kernel/src/process_standard.rs
Outdated
|
||
fn get_write_permissions(&self) -> WritePermissions { | ||
let write_id = self.header.get_write_id().unwrap_or(0); | ||
let (write_count, write_storage_ids) = self |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
access_count
, access_storage_ids
/// Returns `None` if `access_ids` are not included. | ||
fn get_write_permissions(&self) -> WritePermissions; | ||
/// Get the storage permissions for the process. | ||
fn get_storage_permissions(&self) -> Option<storage_permissions::StoragePermissions>; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Returns None
if the process has no storage permissions.
Looks good |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let me know if you are happy with this or want to do more testing.
Looks good to me |
bors r+ |
273: Add userspace support for the Key/Value System r=hudson-ayers a=alistair23 This uses tock/tock#2928 and access and tests Tock's KV System Co-authored-by: Alistair Francis <alistair.francis@wdc.com>
273: Add userspace support for the Key/Value System r=hudson-ayers a=alistair23 This uses tock/tock#2928 and access and tests Tock's KV System Co-authored-by: Alistair Francis <alistair.francis@wdc.com>
Pull Request Overview
This exposes Tock's Key/value system to userspace.
Testing Strategy
Running the libtock-c example app on OpenTitan.
TODO or Help Wanted
Documentation Updated
/docs
, or no updates are required.Formatting
make prepush
.