We no longer send messages to the swapper via the server interface.
All calls go through the blocking handler; in general, there are
no scenarios where it makes sense to have a swapper operation
pre-emptable. We always want our swapper ops to complete quickly,
deterministically, and atomically.
I think it's more Xous-y to punt to userland in the case that
no consecutive memory is found, rather than trying to implement
an evictor in the kernel itself.
For now, the blunt hammer we use is to simply request some
blocks be freed and we retry; this works well enough to find
blocks of a few pages in sequence. If we needed larger blocks,
we may want to consider modifying the swapper userland algorithm
to have some API for finding consecutive runs of non-wired
memory to swap out.
"Device RAM" is a block of RAM whose physical address is not
important, but the block must be consecutively allocated in
physical address space.
This is used to allocate blocks of memory that are intended
for hardware DMA targets and other peripheral shared-memory
applications.
Note that this also marks the allocated block as "wired", so
it can't be swapped out.
currently uses just a "dumb" 0-to-max scheme and then block until
drain. A more efficient implementation might implement a circular
buffer but it's more tricky to code -- just want to get something
working for now.
Using the full seed of ChaCha means that the seed doesn't change
as we run the cipher (there's just a count of how many blocks
you've evolved since the initial state).
This works with that by modifying the seed directly with XORs
against the TRNG output.
The security margin on the reseed interval is loosened up
because we've increased the security margin (and the cost) of
reseeding from the conditioned kernel TRNG-seeded CSPRNG output.
apply the same techniques in the loader key generator to
the kernel TRNG. Every pull of data from the kernel reseeds
the TRNG state as well. This makes server ID creation somewhat
more expensive, but should greatly improve the security of
the system in the case of a TRNG with occassional drop-outs.
- use proper seeding of entire state
- chacha8 does not evolve internal state when extracting the seed,
so we have to run the cipher some to force mixing of the seed
state.