Commit graph

45 commits

Author SHA1 Message Date
bunnie
ecab0ba045 fix default-features in services 2022-09-27 02:44:46 +08:00
bunnie
d667d7e1f5 bump xous-ipc version 2022-09-27 01:14:43 +08:00
bunnie
f188e0f866 re-bump xous-ipc to 0.9.9 2022-09-26 16:50:38 +08:00
bunnie
507ab42836 downgrade xous-ipc to 0.9.7 until i have permissions to push a new version 2022-09-26 16:11:26 +08:00
bunnie
3579dfdd17 update xous-ipc and xous versions 2022-09-26 16:07:35 +08:00
bunnie
114d60bc53 migrate logserver API to external package 2022-09-26 14:06:46 +08:00
bunnie
9a712e643f fix hosted mode 2022-09-22 16:42:41 +08:00
bunnie
7b040f5c34 Close issue #71 (wait_event() for SHA512 block)
I was this many years old when I learned that:

- If you put a `let` inside a block and then pass it outside
the block, it definitely gets a different address. This was causing
KP's in the interrupt handler routine because I was using a block
to mark off the configuration feature and then passing the handle
to the data structure outside the block; instead of just aliasing
the handle over as I assumed it actually makes a copy in a new
address location. This made debugging really hard until I figured
that out, the solution was to put #cfg directives on every line
related to the feature instead of grouping them together into a
block and using a single #cfg directive.

- event_wait() takes longer than 2us to execute. However, the
sha512 computation is done in 2us. So, by the time we checked
if we should wait and called event_wait(), the interrupt that
would wake us up from event_wait would have already happened.
This race condition is what broke event_wait() in the first place.

We now just use a spin loop without even a yield(); as the yield
would take longer to execute than waiting for the hash function
to finalize.
2022-09-22 15:06:54 +08:00
bunnie
e32ea4d3f5 fix #174 2022-06-10 21:36:53 +08:00
bunnie
e288286bda reduce binary burden of backup SHA implementations
When the hardware engine is unavailable, the implementation
falls back to a software SHA. This code path is actually
rarely used, but it is the top object code consumer according
to our bloat analysis tool (40kiB for each instance of
the compress function alone).

This patch annotates the SHA functions with `#[inline(never)]`
to reduce the size of these rarely-used functions.

...it might actually be that on our small-cache system,
reducing the in-lining could improve performance as well
because it helps the whole routine fit inside L2 cache.

Anyways, it's a rarely-used path (I've never seen the code
used once tbh) so let's reduce its overhead and keep
Xous trim.
2022-06-10 18:02:52 +08:00
Sean Cross
3ae9d8abf0 apps/services: remove xous::xous_main macro usage
This macro will be removed, since it is no longer necessary. Remove this
macro across the project and replace it with a standard `main()`
function.

Signed-off-by: Sean Cross <sean@xobs.io>
2022-05-31 13:33:30 +08:00
bunnie
b3788a54af clarify the dependency policy 2022-01-10 16:50:10 +08:00
bunnie
995915ed4e nail down a couple more dependencies, and add a policy note to Cargo.toml
Each Cargo.toml now includes a comment which remnids maintainers
of the dependency policy for Xous (that is, nail down every dependency
to the minor number).
2022-01-10 15:54:27 +08:00
bunnie
dd943c5416 pin down versions and harmonize versions across servers
Versions are pinned down to the minor number. Yes, this means that
we don't automatically pull in features and bug updates from crates.io,
but it also means we don't pull in new attack surfaces and code that
hasn't been tested or reviewed. I'd like this process to be very deliberate
and not automatic for Xous.

The `rand` crate is almost pinned down to a single version, except
for an odd dependency that's pulled in by hosted mode that depends
on rand 0.8.4 via a subordinate dependency via the `tempfile` crate.
Pondering if it's worth it to try and eliminate that, because the
0.8.4 version doesn't get compiled into any version that touches
real hardware. It just makes it harder to analyze the Cargo.lock
file, mostly. I think I'll leave it as-is.
2022-01-10 15:39:55 +08:00
bunnie
b275b1d3c2 move some low-level hardware facing services to "Late" suspend status
So far it's been no problem to suspend these in any order, but as
more services come to rely upon them it's better if they suspend after
any client applications have been suspended.
2022-01-10 13:48:49 +08:00
bunnie
c5fe1bc99b add sequencing to suspend/resume order of operations
this is necessary because we want to make sure that the SPINOR
service does not shut down before the PDDB service finishes syncing
its disks.
2022-01-10 13:45:56 +08:00
bunnie
f0dd512d7d bump sha2 version number so it matches what's on crates.io (for clean patching) 2021-09-15 18:53:11 +08:00
bunnie
74531517dd move more crates to standardized formatting 2021-08-20 00:24:16 +08:00
bunnie
c0ce66ee51 fix permissions. windows is sort of stupid and makes everything +x 2021-08-19 23:34:29 +08:00
bunnie
7edc119472 clean up debug spew 2021-08-09 14:06:54 +08:00
bunnie
04dc6a4c2b refactor engine-sha512 to be named sha2
this makes patch.crates-io much easier to debug, we now
have the hardware hasher working in all the places i expect it to.
2021-08-09 04:40:33 +08:00
bunnie
ec6a3fd1a3 self-signing working, but the patch to use the SHA hash engine seems to be disregarded... 2021-08-09 03:27:43 +08:00
bunnie
40b671ffac refactor for sha256 software emulation native in the engine512 crate 2021-08-05 22:07:21 +08:00
bunnie
68ea69c2ed Merge branch 'bunnie-dev' into main 2021-08-03 17:22:10 +08:00
bunnie
d86c78eea8 partial progress on self-signing 2021-08-03 04:58:34 +08:00
Sean Cross
b86e0a65cd services: recognize xous as a hardware OS
Support `xous` as a valid OS. This allows us to build the entire kernel
under this target.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-02 18:11:48 +08:00
bunnie
a4f8346c34 reflect the latest fixes to the secure boot process
also patch up some issues with sha512 reset and loose
ends on docs and updates
2021-07-13 00:46:31 +08:00
bunnie
6c697de512 add l2 cache support (suspend/resume flushing)
also noted some performance benchmark improvements
2021-07-05 17:05:10 +08:00
bunnie
e2ada8f8fe attempt to fix up some build system warts 2021-06-28 01:31:43 +08:00
bunnie
16ec932286 refactor to sync/async apis split 2021-06-23 19:12:43 +08:00
bunnie
69a22adee9 menus basically working 2021-06-19 00:25:18 +08:00
bunnie
aa967a5a17 quiet up hosted mode build warnings 2021-06-18 22:37:08 +08:00
bunnie
eee9f4e765 refactor xous-names to permit only a fixed number of connections
this prevents less trusted processes from connecting to servers
after the kernel initializations are done.

this works so long as we don't have disconnects from the kernel
servers. In order to support disconnects we will also need a
way to re-enumerate the SID to guarantee that we don't have a re-use
problem. But for now, the kernel is not designed with any practical
disconnect mechanism; there is no code that calls the Quit mechanism
on any server.
2021-06-15 17:41:14 +08:00
bunnie
7fa06866dd remove inappropriate readme 2021-06-03 14:14:25 +08:00
bunnie
fadc9c29ab Merge remote-tracking branch 'origin/master' into bunnie-dev 2021-06-02 03:59:25 +08:00
bunnie
b9f3182bb9 mods for hosted mode to work again 2021-06-02 03:45:15 +08:00
bunnie
7c55925926 intermediate check-in on wfi 2021-05-30 23:07:16 +08:00
bunnie
1e2d46366a attempt to convert sha512 to use xous::wait_event()
doesn't work, for some reason the interrupt doesn't want to fire.
cross-check against hardware simulations...
2021-05-30 16:18:23 +08:00
bunnie
52c32cc4d1 auto-powerdown of sha block when not in use 2021-05-30 00:12:18 +08:00
bunnie
58edcc56f2 sha512 tests fully implemented, working through sus/res
note: sha512 will fail if a suspend is forced upon it!! but
it will vociferously complain if this happens.
2021-05-21 15:56:58 +08:00
bunnie
5526bc4100 add hardware support for sha512/256 2021-05-21 04:35:01 +08:00
bunnie
21a5ddb40f sha512 hardware acceleration is working, now benchmarking
also need to extend hw implementation to sha512/256
2021-05-21 03:15:13 +08:00
bunnie
d44ad58637 sha512 now compiling, at least. 2021-05-20 03:29:26 +08:00
bunnie
a8e68bcebe fix file permissions 2021-05-19 00:39:47 +08:00
bunnie
7d9e84c456 initial frameworks around sha512 acceleration integration 2021-05-19 00:39:03 +08:00