-
Notifications
You must be signed in to change notification settings - Fork 196
Update to zerocopy
0.8
#2054
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
base: master
Are you sure you want to change the base?
Update to zerocopy
0.8
#2054
Conversation
seems like picking up a much more recent `gateway-sp-comms` has increased `control-plane-agent`'s stack depth to 6136, so i've given it a stack margin a bit above that. this caused the RAM size to grow to 65535B, so --- as per @cbiffle's general suggestion --- i've un-max-size'd all the control-plane-agent RAM allocations.
now that oxidecomputer/management-gateway-service#384 has merged.
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.
Overall LGTM
humpty = { git = "https://github.com/oxidecomputer/humpty", branch = "eliza/zerocopy-0.8", default-features = false, version = "0.1.3" } | ||
hubtools = { git = "https://github.com/oxidecomputer/hubtools", default-features = false, version = "0.4.6" } | ||
idol = { git = "https://github.com/oxidecomputer/idolatry.git", default-features = false } | ||
idol-runtime = { git = "https://github.com/oxidecomputer/idolatry.git", default-features = false } | ||
idol = { git = "https://github.com/oxidecomputer/idolatry.git", branch = "eliza/zerocopy-0.8", default-features = false } | ||
idol-runtime = { git = "https://github.com/oxidecomputer/idolatry.git", branch = "eliza/zerocopy-0.8", default-features = false } |
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.
Do you want to merge with that branch or are you going to rebase when those get approved?
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.
yeah, i'm waiting for these branches to be approved before merging; i'll update to point the git deps back at the main
branches once they're through.
I did give this a quick test on my grapefruit and it seemed to work (tasks running, could run |
test outputeliza@theseus ~/Code/oxide/hubris $ HUMILITY_TARGET=gimletlet cargo xtask test test/tests-gimletlet/app.toml
Finished `dev` profile [optimized + debuginfo] target(s) in 0.16s
Running `target/debug/xtask test test/tests-gimletlet/app.toml`
building crate test-runner
Finished `release` profile [optimized + debuginfo] target(s) in 0.13s
target/thumbv7em-none-eabihf/release/test-runner -> target/tests-gimletlet/dist/runner.elf
building crate test-suite
Finished `release` profile [optimized + debuginfo] target(s) in 0.14s
target/thumbv7em-none-eabihf/release/test-suite -> target/tests-gimletlet/dist/suite.elf
building crate test-assist
Finished `release` profile [optimized + debuginfo] target(s) in 0.13s
target/thumbv7em-none-eabihf/release/test-assist -> target/tests-gimletlet/dist/assist.elf
building crate test-idol-server
Finished `release` profile [optimized + debuginfo] target(s) in 0.13s
target/thumbv7em-none-eabihf/release/test-idol-server -> target/tests-gimletlet/dist/idol.elf
building crate task-hiffy
Finished `release` profile [optimized + debuginfo] target(s) in 0.14s
target/thumbv7em-none-eabihf/release/task-hiffy -> target/tests-gimletlet/dist/hiffy.elf
building crate task-idle
Finished `release` profile [optimized + debuginfo] target(s) in 0.13s
target/thumbv7em-none-eabihf/release/task-idle -> target/tests-gimletlet/dist/idle.elf
linking task 'runner'
linking task 'suite'
linking task 'assist'
linking task 'idol'
linking task 'hiffy'
linking task 'idle'
building crate gimletlet
Finished `release` profile [optimized + debuginfo] target(s) in 0.13s
target/thumbv7em-none-eabihf/release/gimletlet -> target/tests-gimletlet/dist/kernel
flash = 0x08000000..0x08100000
ram = 0x20000000..0x20020000
sram1_mac = 0x30000000..0x30010000
sram1 = 0x30010000..0x30020000
sram2 = 0x30020000..0x30040000
sram3 = 0x30040000..0x30048000
sram4 = 0x38000000..0x38010000
bank2 = 0x08100000..0x08200000
Used:
flash: 0x18000 (9%)
ram: 0x8500 (25%)
sram1_mac: 0x0 (0%)
sram1: 0x0 (0%)
sram2: 0x0 (0%)
sram3: 0x0 (0%)
sram4: 0x0 (0%)
bank2: 0x0 (0%)
humility: WARNING: archive on command-line overriding archive in environment file
humility: attaching with chip set to "STM32H753ZITx"
humility: attached to 0483:3754:000B00154D46501520383832 via ST-Link V3
humility: flash/archive mismatch; reflashing
humility: flashing done
humility: WARNING: archive on command-line overriding archive in environment file
humility: attached to 0483:3754:000B00154D46501520383832 via ST-Link V3
Total test cases: 52
humility: running test_send ...ok
humility: running test_recv_reply ...ok
humility: running test_recv_reply_fault ...ok
humility: running test_floating_point_lowregs ...ok
humility: running test_floating_point_highregs ...ok
humility: running test_floating_point_fault ...ok
humility: running test_fault_badmem ...ok
humility: running test_fault_stackoverflow ...ok
humility: running test_fault_execdata ...ok
humility: running test_fault_illop ...ok
humility: running test_fault_nullexec ...ok
humility: running test_fault_textoob ...ok
humility: running test_fault_stackoob ...ok
humility: running test_fault_buserror ...ok
humility: running test_fault_illinst ...ok
humility: running test_fault_divzero ...ok
humility: running test_fault_maxstatus ...ok
humility: running test_fault_badstatus ...ok
humility: running test_fault_maxrestart ...ok
humility: running test_fault_badrestart ...ok
humility: running test_fault_maxinjection ...ok
humility: running test_fault_badinjection ...ok
humility: running test_fault_superinjection ...ok
humility: running test_fault_selfinjection ...ok
humility: running test_panic ...ok
humility: running test_restart ...ok
humility: running test_restart_taskgen ...ok
humility: running test_borrow_info ...ok
humility: running test_borrow_read ...ok
humility: running test_borrow_write ...ok
humility: running test_borrow_without_peer_waiting ...ok
humility: running test_supervisor_fault_notification ...ok
humility: running test_timer_advance ...ok
humility: running test_timer_notify ...ok
humility: running test_timer_notify_past ...ok
humility: running test_task_config ...ok
humility: running test_task_status ...ok
humility: running test_task_fault_injection ...ok
humility: running test_refresh_task_id_basic ...ok
humility: running test_refresh_task_id_off_by_one ...ok
humility: running test_refresh_task_id_off_by_many ...ok
humility: running test_post ...ok
humility: running test_idol_basic ...ok
humility: running test_idol_bool_arg ...ok
humility: running test_idol_bool_ret ...ok
humility: running test_idol_bool_xor ...ok
humility: running test_idol_err_ret ...ok
humility: running test_idol_ssmarshal ...ok
humility: running test_idol_ssmarshal_multiarg ...ok
humility: running test_idol_ssmarshal_multiarg_enum ...ok
humility: running test_irq_notif ...ok
humility: running test_irq_status ...ok
Ran a total of 52 cases
Wrote test output to hubris.testout.0 |
Additional manual verification: I flashed sled 14 on London to the |
This branch updates our dependency on
zerocopy
from v0.6.x to v0.8.x.The primary motivation for this change is that I had wanted to use
zerocopy
v0.8's support for data-bearingenum
s in thegateway-ereport-messages
crate I added inoxidecomputer/management-gateway-service#370, and...I hadn't realized
how painful taking the
zerocopy
update in Hubris would be. :) But,it's also just good to stay on top of new dependency versions
regardless.
This is a very large change, since pretty much every place where we
derive or use
zerocopy
's traits needed to be changed slightly to usethe new APIs, but for the most part, it's not actually that
interesting, so reviewing it should be pertty straightforward. The
main API changes that are worth noting are:
AsBytes
is now calledIntoBytes
, which was an easy update._from_prefix
/_from_suffix
APIs now return the rest of theslice, which is a nice improvement --- previously we would manually
split off the rest of the slice when using those functions.
Result
s instead ofOption
s,which very trivial changes in a few places.
LayoutVerified
is replaced by a newRef
type, but other APIchanges mean that you now basically never need to use it, which rocks!
find-and-replace.
zerocopy
adds newImmutable
andKnownLayout
marker traits.Immutable
is required forIntoBytes::as_bytes()
; types which donot derive it are now assumed to have interior mutability and only
provide
IntoBytes::as_bytes_mut()
. So, basically everything nowneeds to derive
Immutable
.KnownLayout
isn't required for APIs weuse as commonly but I added it on everything anyway. This was most of
what made this update annoying.
FromBytes::new_zeroed
is now provided by a newFromZeros
trait,but the
FromBytes
derive implements that trait as well.There may be some places where we can now make better use of new
zerocopy
features. In particular, we can now usezerocopy
ondata-bearing enums, which might allow us to replace
hubpack
withzerocopy
in several places. I didn't do that in this PR, but it'sworth looking into in follow-up changes --- I just wanted to get
everything building with the new API and felt that improving our usage
of it would be better off done in smaller commits.
One other important thing to note is that updating the
gateway-messages
dependency increased stack depth incontrol-plane-agent
from 6000B to 6136B for non-sidecar targets, so Ibumped them up to 6256B. This, in turn, increases RAM to 65525B for
control-plane-agent
, which exceeds themax-sizes
config, per@cbiffle's previous advice, I just deleted all the
max-sizes
forcontrol-plane-agent
tasks.Furthermore, this branch requires the following changes to other crates
to pick up the latest
zerocopy
:zerocopy
to v0.8 management-gateway-service#384zerocopy
v0.8 idolatry#57zerocopy
v0.8 humpty#8Those ought to merge first so we can point our Git dependencies on those
repos back at the
main
branch.