Commit graph

6900 commits

Author SHA1 Message Date
bunnie
03c3f61ba3 fixes to encrypt/decrypt routines to adjust offsets etc. 2024-04-08 23:54:36 +08:00
bunnie
36173fde95 adjust ram available size when swap is enabled 2024-04-08 23:54:24 +08:00
bunnie
400088fb42 add debug file generation for swap 2024-04-08 23:47:54 +08:00
bunnie
58ce8a2923 make resume not a default feature in renode
this is compensated for in xtask to put it back into
your usual builds, but it allows us to not have it in the
swap config.
2024-04-08 23:43:45 +08:00
bunnie
b802af6edc add explicit resume support to renode image
don't do resume on swap builds -- our stack is too deep to
support the clean boot marker
2024-04-08 23:43:05 +08:00
bunnie
73aeae480d add plaintext debug output for swap image 2024-04-08 23:41:48 +08:00
bunnie
cd140769ac add code to map swap page tables into swapper memory space 2024-04-08 12:41:08 +08:00
bunnie
2b5fabb2fd add swap pt routines 2024-04-08 12:40:42 +08:00
bunnie
25cbf0dc67 add swap pt map handling 2024-04-08 12:40:23 +08:00
bunnie
287ad58c8a add the swapper PID as a constant 2024-04-08 12:39:52 +08:00
bunnie
379d4e81c5 cleanup swap top mod now that most of the implementation is done 2024-04-08 12:39:29 +08:00
bunnie
30b5be7a79 remove superfluous import 2024-04-08 12:39:07 +08:00
bunnie
6ce157b20d add swap handling to minielf 2024-04-08 12:38:42 +08:00
bunnie
63a8b51fe9 gate SDBG behind feature flag 2024-04-08 12:38:02 +08:00
bunnie
2ce579b221 phase 1 changes for swap 2024-04-07 22:37:40 +08:00
bunnie
d489e14f3a fix nonce generation (offset should be bytes, not pages) 2024-04-07 22:37:22 +08:00
bunnie
26efde0a71 track address of the decrypt buffer 2024-04-07 22:36:54 +08:00
bunnie
a478af445d fix IniS arg copying. lay down boilerplate for phase 1 copy
the hard part - the core inner loop of the copy -- is still
to be done.
2024-04-07 19:01:09 +08:00
bunnie
8aa20e65f6 match new API for accessing swap 2024-04-07 19:00:18 +08:00
bunnie
bd54417e44 add routines for shuttling encrypted data to/from swap RAM region
RAM is assumed to be off-chip, and thus the data is encrypted
in the region. We also encrypt it in the Precursor case, even
though it's on-chip, because we want to capture this as a test case
in a known working environment.

Also incorporate some routines to generate the per-boot random
key for swap encryption.
2024-04-07 18:58:54 +08:00
bunnie
c07f33a169 track the current free page in swap ram 2024-04-07 18:58:31 +08:00
bunnie
884b4d372d put rand_chacha into the lockfile 2024-04-07 18:58:11 +08:00
bunnie
417fa16a22 add rand_chacha as a dependency for the loader
this is needed in the cramium-soc case because the raw TRNG
does not have a whitener, it should not be used directly to
generate keys.
2024-04-07 18:57:23 +08:00
bunnie
49f3570d23 make the test-swapper crate kick out NOCOPY data
makes the test case more comprehensive
2024-04-07 18:56:40 +08:00
bunnie
f2a8603e55 merge encrypted swap argument structure into kernel arguments 2024-04-07 14:29:25 +08:00
bunnie
7602ec7670 reflect crc crate 2024-04-07 14:29:05 +08:00
bunnie
999cb320ed add a function to nab the decrypt buffer
HIGHLY unsafe, but saves us a decryption operation as we
interleave between the various states of the loader.
2024-04-07 14:28:31 +08:00
bunnie
35082c4688 add crc handling to loader
for patching the argument structure
2024-04-07 14:28:05 +08:00
bunnie
c53515fc63 coalesce swap hal into boot config object; read initial swap args
this worked, so it validates the encryption/decryption of the swap
at least!
2024-04-07 00:41:18 +08:00
bunnie
f86d63aa41 add tracking for swap-specific data structures in bootconfig 2024-04-07 00:40:33 +08:00
bunnie
c7e1f22cfa fix pointer issue in resolving swap config
also a bunch of latent debug in case we need to muck around again
2024-04-07 00:39:34 +08:00
bunnie
8f94ecaf6c limit AAD to 64 bytes 2024-04-07 00:39:05 +08:00
bunnie
3079da3a57 add debug provisions to encryption; limit AAD to 64 bytes 2024-04-07 00:38:34 +08:00
bunnie
71336ebf3e start to sketch in bits and pieces of the swap HAL
this is far from complete but needed to check in for the
build check to pass
2024-04-06 23:04:03 +08:00
bunnie
4bb7c87646 gate loader todo behind feature flag 2024-04-06 23:01:33 +08:00
bunnie
903b2219db gate loader features behind flag 2024-04-06 23:01:04 +08:00
bunnie
32857a70b0 add platform-dependent drivers for swap
precursor does direct memory mapping
cramium uses a qspi interface
2024-04-06 22:59:43 +08:00
bunnie
dddbc3c163 add aes-gcm-siv dependency to loader 2024-04-06 22:58:20 +08:00
bunnie
e84fd34c9a aead dependency changes in cargo.lock 2024-04-06 22:57:58 +08:00
bunnie
fbce3f774c update cramium soc target to latest svd spec 2024-04-06 22:57:38 +08:00
bunnie
42063c222e add explicit build flags to swap target 2024-04-06 22:56:25 +08:00
bunnie
7547d7c952 remove aead from dependencies (already part of aes-gcm-siv) 2024-04-06 22:56:03 +08:00
bunnie
d9b29c2d06 move the MAC (i.e. tag) above the variable length AAD field. 2024-04-06 22:55:39 +08:00
bunnie
588e7aaf0a add spi memory drivers to udma library
totally untested, but, at least structurally present so we
have a chance that our memory structures and APIs can work.
2024-04-06 22:54:34 +08:00
bunnie
e61fe6c318 Merge branch 'swap-image-loader' of github.com:betrusted-io/xous-core into swap-image-loader 2024-04-06 22:48:35 +08:00
bunnie
8a7010a6c5 add renode configs for swap 2024-04-06 07:47:18 -07:00
bunnie
50fa69a062 fix main memory patching for swap config on precursor 2024-04-06 07:47:18 -07:00
bunnie
8c219f8fb1 patching routine for memory regions.
ended up not being used because main memory is a special case :P
2024-04-06 07:47:18 -07:00
bunnie
b06dd72e7d make argument start/offset visible
so we can patch it up for the swap testing on precursor
2024-04-06 07:47:18 -07:00
bunnie
78cd15e590 the image creator is sensitive to the target for swap configs 2024-04-06 07:47:18 -07:00