Commit graph

10340 commits

Author SHA1 Message Date
bunnie
453aeb3596 fix boot order issue that prevents restore 2022-10-09 14:16:36 +08:00
bunnie
99c6e005ad fix hosted mode 2022-10-09 02:46:24 +08:00
bunnie
6230c922ac fix backup/restore scripts 2022-10-09 02:36:48 +08:00
bunnie
a1a6ae6d6a add a note about how minver is currently broken 2022-10-09 02:36:27 +08:00
bunnie
8ac80f8c42 update tools to work with checksums (partial update) 2022-10-09 01:12:03 +08:00
bunnie
2ff9163789 add checksums to PDDB backup
every 1MiB block is checksummed with a sha512/256 truncated to
128 bits. This is used to confirm the media and transport integrity
only. It is not intended to be a cryptographic check, it just confirms
that the backup data was transferred correctly assuming no intentionally
malicious actors in the middle.
2022-10-09 01:10:42 +08:00
bunnie
c33dee152d fix backup opcode setting 2022-10-08 22:20:50 +08:00
bunnie
11673da5f6 bump min xous version, as we need the version mask fix to read newer backups
even though the format is compatible, the version check isn't :(
2022-10-08 15:30:24 +08:00
bunnie
c471ca0fbb fix overly restrictive version match on backup version 2022-10-08 15:29:37 +08:00
bunnie
a0791ff092 back out patch of the opcode change -- the backup script did that in error 2022-10-08 02:40:55 +08:00
bunnie
89d050891b fix incorrect opcode setting on backup 2022-10-08 02:40:07 +08:00
bunnie
44d3c19733 fix hash check computation and op offset 2022-10-08 02:26:00 +08:00
bunnie
df12dcdd1e fix hash count computation 2022-10-08 02:25:46 +08:00
bunnie
818c172af2 add a note that the PDDB accesses will be disabled on backup 2022-10-08 01:53:42 +08:00
bunnie
42052fdcc5 fix padding on hash check in backup tools 2022-10-08 01:53:28 +08:00
bunnie
a416069002 add hash protection on the metadata header
stage is set for hash protection on the PDDB data itself.
that comes next.
2022-10-08 01:22:14 +08:00
bunnie
c1eed3e7ad bump readme to note coherence issue fixed 2022-10-07 18:55:47 +08:00
bunnie
62af36560b checks for cache coherence issues
Most of the changes introduced in this commit were rolled back,
but, there is now a test facility that's hanging out for the PDDB
to help with future debug efforts.

The patch was motivated by a problem observed in FSCB consistency
when it's updated. Ultimately the root cause was traced to a
cache coherence problem and it's fixed by a patch in the spinor
crate.

However, this patch still retains a check that the data is coherent,
in case the flushing routine isn't complete or some other factor
was missed. It also includes a large amount of commented-out code
that keeps a bit of history used to debug the problem -- eventually,
we can just cull that but it's kept around in case we got the
root cause wrong (or there were multiple causes and coherence is
just one of them).
2022-10-07 18:52:57 +08:00
bunnie
97895fd9c9 fix cache coherence issue with FLASH
after updating a piece of FLASH memory, there is an inherent
cache coherence issue. This is because the write happens through
a side channel that is outside of the memory model of the system:
writes happen through a CSR that feed data to pages of FLASH.
Reads happen through direct-mapped memory regions that are unaware
of write mutations.

Thus, after writing a page of memory, if you try to access it,
sometimes you'll read the old cached value instead of the new
updated value.

This patch introduces a mandatory dcache flush after every
FLASH write, so that any cached FLASH regions are re-fetched.
2022-10-07 18:50:51 +08:00
bunnie
d7333a51fd bump xous-susres version check 2022-10-07 18:50:35 +08:00
bunnie
6418f8b54f add notes about making the cache flush loop more efficient on suspend 2022-10-07 18:46:59 +08:00
bunnie
ce02d9ff50 bump release notes 2022-10-06 01:01:56 +08:00
bunnie
0f9195f305 add some sanity checks on the backup header
this tries to catch the cases that:
  - user tried to run the backup without first running "prepare backup..."
  - the USB connection is a little flakey and returning bum data

We can only inspect the plaintext portions of the header, which contains
things like protocol version numbers, time stamps, and language codes.

We use the timestamp validation heavily because it's the only field that
isn't almost always going to be a 0 or 1 when correct, which are highly
likely to be reported anyways if there's a problem with the USB link.

This does assume the user sets the time correctly on the device
doing the backup, and on the Precursor itself.
2022-10-06 00:53:52 +08:00
bunnie
97ccb67ff2 cleanup push artifacts 2022-10-06 00:03:27 +08:00
bunnie
e5704cef4e add for cargo push 2022-10-06 00:02:55 +08:00
bunnie
7a3a132780 bump other API levels 2022-10-05 23:58:46 +08:00
bunnie
3bca9de2a0 bump version numbers for xous-kernel patch
this fixes tests in CI
2022-10-05 23:51:35 +08:00
bunnie
8f71164278 crates.io source files differ in length from repo source files
because crlf->lf conversions
2022-10-05 21:25:54 +08:00
bunnie
3b9041d8d7 CRLF->LF handing in file comparisons 2022-10-05 21:20:16 +08:00
bunnie
86cc7de6b1 version.rs should not be cached 2022-10-05 21:20:01 +08:00
bunnie
5c0154f730 cleanup version comparison code
this should be "clean" and working. yowch, this is really strict...
i may need to loosen this checking to make development sustainable.
2022-10-05 18:53:09 +08:00
bunnie
969f93b001 cross-repo update versions from xous-rs bump 2022-10-05 18:32:44 +08:00
bunnie
32e3cf588f bump xous-rs to 0.9.11 to absorb feature flags into the kernel API 2022-10-05 18:26:58 +08:00
bunnie
113d4c2d96 fix typo in susres 2022-10-05 18:05:26 +08:00
bunnie
eaa59348e7 oops meant 0.1.3 2022-10-05 18:03:07 +08:00
bunnie
edadcecebc bump susres to 0.1.2 2022-10-05 18:02:18 +08:00
bunnie
851cd0924c bump xous-names to 0.9.9 2022-10-05 18:01:22 +08:00
bunnie
a10520cdd4 bump log to 0.1.1 2022-10-05 18:00:17 +08:00
bunnie
ef4053586d fix typo 2022-10-05 17:59:17 +08:00
bunnie
161a4dbc5d now republish ticktimer with updated api refs (0.1.3) 2022-10-05 17:58:21 +08:00
bunnie
2c4d8a0ca0 publish sures at 0.9.2 2022-10-05 17:57:07 +08:00
bunnie
395e079b01 publish names at 0.9.4 2022-10-05 17:56:09 +08:00
bunnie
7bc407a053 publish log dependency at 0.1.4 2022-10-05 17:55:25 +08:00
bunnie
e5c1c4059c ticktmer to 0.9.2 for dependencies 2022-10-05 17:53:17 +08:00
bunnie
c31e050926 it helps to save teh file 2022-10-05 17:44:14 +08:00
bunnie
45d606c8f2 bump susres to 0.1.2 (xous-rs dependency) 2022-10-05 17:43:13 +08:00
bunnie
a12973a7ae bump ticktimer to 0.1.2 for new xous-rs dependencies 2022-10-05 17:41:45 +08:00
bunnie
f863d742d9 absorb xous-rs change into xous-ipc 2022-10-05 17:39:19 +08:00
bunnie
5c6dc80249 xous-rs change bumps kernel rev 2022-10-05 17:33:25 +08:00
bunnie
0ae89626fe add default for crates 2022-10-05 17:20:26 +08:00