Commit Graph

69 Commits

Author SHA1 Message Date
whitequark dd829afebd firmware: fix another TOCTTOU race in sync/async RPC code. 2018-11-12 15:42:07 +00:00
whitequark 583bba8777 Revert "firmware: workaround for RPC failures"
This reverts commit 59033d2588.
2018-11-12 15:36:36 +00:00
whitequark 0edae64afb firmware: fix TOCTTOU race in sync/async RPC code.
Before this commit, the main loop in session code was laid like:

  1. process_kern_queued_rpc
  2. process_host_message
  3. process_kern_message

If a host message (such as an RPC reply) caused the kernel to exit,
then any async RPCs would not complete, since RunFinished immediately
shuts down the kernel.

Fix this by reordering 1 and 2.
2018-11-12 15:30:59 +00:00
Sebastien Bourdeauducq 59033d2588 firmware: workaround for RPC failures 2018-11-12 19:51:54 +08:00
Sebastien Bourdeauducq 8caea0e6d3 gateware,runtime: optimize RTIO kernel interface further
* now pinning (TODO: atomicity)
* for inputs, merge request and timeout registers
2018-11-08 18:29:24 +08:00
Sebastien Bourdeauducq 62642957cd runtime: fix DRTIO aux channel race condition 2018-09-19 11:16:21 +08:00
Sebastien Bourdeauducq c8cd830118 drtio: implement get_rtio_destination_status for kernels 2018-09-15 19:11:22 +08:00
Sebastien Bourdeauducq ae72e3a51e firmware: add support for moninj and kern_hwreq over DRTIO switching 2018-09-14 20:26:39 +08:00
Sebastien Bourdeauducq 2fff96802b runtime: remove support for building without RTIO 2018-09-10 23:09:02 +08:00
Sebastien Bourdeauducq b10d3ee4b4 make RTIO clock switch optional and simplify
Kasli no longer has an internal RTIO clock.
Switching clocks dynamically is no longer supported.
2018-05-18 17:41:34 +08:00
whitequark ca93b94aea firmware: move config requests to management protocol.
They were only in session protocol because of historical reasons.
2018-05-16 14:32:49 +00:00
Florent Kermarrec 7fe49a78d2 firmware/runtime/session: fix compilation when no rtio core 2018-05-15 23:47:47 +02:00
whitequark 9347f6e00c firmware: use a dedicated error type in the scheduler.
After this commit, error handling does not normally allocate
(session::Error::{Load,Unexpected} still allocate, but those two
are very rare).

Good riddance to libstd_artiq.
2018-05-15 14:19:44 +00:00
whitequark 479cb9a857 firmware: use dedicated error types for every protocol and thread.
Good riddance to io::Error::Unrecognized.
2018-05-15 13:27:23 +00:00
whitequark 26faaad2b7 firmware: remove io::Result<T, E> in favor of Result<T, impl Fail>.
This doesn't yet use impl Fail since std_artiq::io::Error doesn't
impl it.
2018-05-15 08:29:03 +00:00
whitequark 140ca729aa firmware: rename io::Error::{UnexpectedEof→UnexpectedEnd}.
We don't even have files.
2018-05-15 08:27:45 +00:00
whitequark 5ead27f2e1 firmware: eliminate uses of std_artiq::io::{Read,Write} from runtime. 2018-05-14 19:11:57 +00:00
whitequark cf33ba748d firmware: eliminate non-io uses of std_artiq from runtime.
Just replace these with references to alloc.
2018-05-14 19:11:57 +00:00
whitequark 02b8426f60 firmware: rename libboard to libboard_misoc.
By analogy with libbuild_misoc. Hopefully one day it actually gets
moved to misoc...
2018-05-14 18:09:44 +00:00
whitequark 6a10d54432 firmware: migrate rpc_proto to new libio.
This closes an old and horrible issue in that some code in ksupport
may implicitly try to allocate and we'll never know until it crashes
at runtime inside liballoc_stub.

This also removes liballoc_stub.
This also removes ReadExt and WriteExt from libproto.
Hooray!
2018-05-14 17:26:59 +00:00
whitequark 09617c9f5e firmware: migrate session_proto to new libio. 2018-05-14 15:17:32 +00:00
whitequark 873324d52b firmware: don't truncate queued RPCs (fixes #985). 2018-04-21 19:39:46 +00:00
whitequark ca419aa3c2 firmware: split out libboard_artiq from libboard. 2017-12-28 07:07:00 +00:00
whitequark d7cb4963e1 firmware: prepare config block for access from BIOS/bootloader.
* remove liballoc dependency from mod config,
  * move mod config to libboard,
  * move config sector immediately after BIOS sector.
2017-12-27 21:28:40 +00:00
whitequark 5a2cbe7088 runtime: remove borrow_mut!() in favor of backtraces. 2017-12-27 19:15:25 +00:00
whitequark ad8fcb8b86 runtime: has_rtio -> has_rtio_core.
has_rtio is the cfg for the kernel CPU, has_rtio_core is the one
for the comms CPU.

Also remove a few useless #[cfg]s.
2017-11-03 15:59:59 +00:00
whitequark 2404a0d8c8 runtime: allow #[cfg(not(has_rtio))] builds. 2017-11-03 15:49:30 +00:00
whitequark 73c76ebb9a firmware: eliminate most transmutes and document the rest. NFC. 2017-10-02 03:09:46 +00:00
whitequark c00b3fe8cd firmware: update smoltcp. 2017-09-24 22:57:27 +00:00
Sebastien Bourdeauducq 8399f8893d add kernel access to non-realtime SPI buses (#740) 2017-06-18 12:45:07 +08:00
whitequark b913d1d6f2 runtime: make a copy of startup/idle kernel firmware before loading.
Fixes #716.
2017-04-21 16:46:40 +00:00
whitequark 0e68eaa879 runtime: print a heap dump on out-of-memory condition. 2017-04-21 14:48:10 +00:00
Sebastien Bourdeauducq fe05aede78 firmware: DmaPlayback → DMARetrieve 2017-04-19 11:11:42 +08:00
whitequark c6e8d5c901 runtime: allow setting UART log level explicitly.
This is way more convenient than commenting out parts
of session.rs when debugging.
2017-04-15 08:27:18 +00:00
whitequark 0531dc45c3 DMA: erase trace before re-recording it.
Or we could needlessly OOM replacing a large trace.
2017-04-15 07:48:02 +00:00
whitequark 9dfe9c1248 DMA: improve recording performance.
This commit moves DMA serialization code to the kernel CPU
(to cope with the existence of rtio_output_wide) and batches
the resulting sequences. This results in less data being transferred
between kernel and comms CPUs (24 octets with one pointer before,
18 octets with no pointers now, for the common case of rtio_output),
but most importantly reduces cache flushes, which now happen
once per 64k octets.

On average, it now takes about 15us to record a single RTIO event
in a DMA trace.

Fixes #712.
2017-04-15 07:29:52 +00:00
whitequark 14ae1cc100 runtime: advance now on DMA replay.
Fixes #700.
2017-04-05 18:34:36 +00:00
whitequark d04d7ed120 runtime: show a more informative message for interrupted sessions.
Fixes #690.
2017-03-29 03:36:49 +00:00
whitequark 948ed6fb0a Extract core device management interface from session interface (#691). 2017-03-29 03:36:21 +00:00
whitequark c586035caa runtime: add an option to reboot after a panic. 2017-03-14 09:02:28 +00:00
whitequark 795a3e24d8 artiq_coreboot: block until hotswap image is actually received. 2017-03-07 11:36:28 +00:00
whitequark b0cdef3211 firmware: implement hotswap through artiq_coreboot tool. 2017-03-06 16:01:28 +00:00
whitequark 98454e9bda runtime: remove unnecessary dcache flush.
Data cache is write-through, so sending data to DMA doesn't need
a flush.
2017-03-04 09:46:55 +00:00
whitequark 924ae73000 firmware: fix DMA trace alignment and flush caches. 2017-03-04 09:40:22 +00:00
whitequark 4f94709e9f firmware: move packet dumps to the DEBUG log level. 2017-03-03 06:11:35 +00:00
whitequark e8c093deb3 Allow changing runtime log level without recompilation.
This shouldn't affect performance much, as the log crate guards
every log statement with a branch, adding just two instructions.
2017-03-03 06:06:26 +00:00
whitequark a4ece19614 Implement DMA playback. 2017-02-28 21:28:40 +00:00
whitequark 5d3b00cf12 Implement recording of DMA traces on the core device. 2017-02-26 02:50:20 +00:00
whitequark a07bd918f0 firmware: use Rust naming conventions for enum variants. 2017-02-25 22:34:11 +00:00
whitequark 04ad267055 firmware: rewrite the dynamic linker in Rust. 2017-02-24 18:57:29 +00:00