Commit graph

43 commits

Author SHA1 Message Date
Martin Povišer
a40840f13c proxy: Expose usb_iodev_vuart_setup
Expose the usb_iodev_vuart_setup function in uartproxy. This opens
the secondary ACM pipe to new uses outside the hypervisor. E.g. it can
be set up as another stream for sending proxy requests.

Sample usage from proxyclient:

    p.usb_iodev_vuart_setup(p.iodev_whoami())
    p.iodev_set_usage(IODEV.USB_VUART, USAGE.UARTPROXY)
    # the second virtual serial now also serves proxy

Signed-off-by: Martin Povišer <povik@protonmail.com>
2021-11-26 15:31:21 +09:00
Hector Martin
4027c34c7a proxy: Add proxy ops for pcie_init/shutdown
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-11-22 16:04:35 +09:00
Hector Martin
1444c93a24 proxy: Add P_MMU_INIT_SECONDARY
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-10-15 23:44:12 +09:00
Hector Martin
0e3770ca47 hv, m1n1.hv: Add cpu() command to switch CPU contexts
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-09-21 13:18:06 +09:00
Hector Martin
2d952752db proxy: Add smp_wait() to the proxy
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-09-17 15:25:34 +09:00
Hector Martin
509481d5d5 hv: Add SMP support
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-09-15 23:32:57 +09:00
Hector Martin
368b48a365 hv_wdt: Make HV WDT CPU configurable and WDT optional
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-09-15 23:24:37 +09:00
Janne Grunau
88275b5cb5 hv: add AIC interrupt tracing
Implemented by MMIO tracing of AIC's event register. Proposed by pipcet.

Signed-off-by: Janne Grunau <j@jannau.net>
2021-06-10 15:41:02 +09:00
Hector Martin
a175b6d159 proxy: Add reboot() call to hard reboot the system
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-06-04 15:09:11 +09:00
Hector Martin
66fc157e94 fb: Improve visuals
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-05-28 00:45:05 +09:00
Hector Martin
77a36a7d34 utils,proxy: Add basic SIMD register fetch and mutation support
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-05-27 22:57:25 +09:00
Sven Peter
1c604a77c5 gxf: add support for guarded exception levels
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2021-05-11 15:48:40 +09:00
Sven Peter
9120cb8426 memory: allow to reinit and temporarily disable the MMU
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2021-05-11 15:48:40 +09:00
Hector Martin
0203aa6d3d proxy: Add framebuffer ops
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-05-08 03:42:21 +09:00
Hector Martin
0ae3455d51 hv_vuart: World's stupidest virtual UART implementation
Work in progress...

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-05-05 04:03:44 +09:00
Hector Martin
9407dba2e0 hv_vm: Initial data abort handling
Supports software-mapping for a subset of ldr/str instructions.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-05-05 04:03:44 +09:00
Hector Martin
50f112c396 hv: Add support for address translation & abort decoding
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-05-05 00:28:39 +09:00
Hector Martin
4d64c33ca6 hv: Implement basic exception handling
Allows Python to handle hypervisor exceptions, and implements exception
info display and basic debug commands.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-05-04 19:36:23 +09:00
Hector Martin
9584e7d312 uartproxy: Add IODEV_WHOAMI feature to get current iodev
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-05-03 21:19:35 +09:00
Hector Martin
1ae60ad715 hv: Beginnings of a hypervisor
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-05-01 19:21:33 +09:00
Hector Martin
7dfe24ee2c Rework kboot/chainload flow to shut down before calling the next stage
Next stage boots now exit back to main() after replying to the proxy
command, allowing shutdown functions to be called. Introduces a new
P_VECTOR proxy op, distinct from P_CALL. The Python side is reworked
to remain compatible with older versions that do not support this.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-04-17 18:12:59 +09:00
Hector Martin
8104ec02c4 iodev: Add proxy ops
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-04-15 23:18:57 +09:00
Hector Martin
f8c1c65cf9 Revert "proxy: add fb console console ops"
This reverts commit de0456b9a5.

These ops become redundant with the new iodev control op.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-04-15 23:18:57 +09:00
Sven Peter
35007b700e proxy: add dart ops
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2021-04-15 01:36:29 +09:00
Sven Peter
de0456b9a5 proxy: add fb console console ops
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2021-04-14 18:11:37 +09:00
Sven Peter
1314a426e2 proxyclient: add PMGR ops
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2021-04-11 05:26:29 +09:00
Sven Peter
8aa3c69a2d tunables: add tunables_apply_local_addr
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2021-04-08 20:32:12 +09:00
Sven Peter
a17e64f1e2 tunables: add proxy ops
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2021-04-08 20:32:12 +09:00
Hector Martin
b8349819fe Implement calling code as EL1
This works by clearing HCR_EL2.TGE, and then doing essentially the same
thunk/return dance as for EL0 calls. However, since most EL1 exceptions
are not routed to EL2, we install hypercall vectors in EL1 to forward
them to EL2, and then short circuit the exception return to whatever
triggered the original exception.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-03-04 22:10:37 +09:00
Hector Martin
3872b1a7da exception: implement el0_call to run code as EL0
This lets us test register access and other features from EL0.

No serious attempt at security is made, but at least EL0 runs off of a
separate stack and can return to EL2 at any time with `brk`; we can
easily implement a guard mode to break straight to EL2 on exception
later if needed.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-02-24 21:48:12 +09:00
Sven Peter
870fead39c proxyclient: add ops for writeread{8,16,32,64}
Signed-off-by: Sven Peter <sven@svenpeter.dev>
2021-02-18 16:12:28 +09:00
Hector Martin
5aff13c404 proxy: add missing SPDX header
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-02-06 16:44:10 +09:00
Hector Martin
6dde40b05c exception: introduce recovery from synchronous exceptions
Use this to recover from address faults in the proxy. Also print out L2
subsystem fault info.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-30 22:00:00 +09:00
Hector Martin
74307af0df kboot: add proper kernel boot & DT manipulation code
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-30 01:37:09 +09:00
Hector Martin
986c6730e9 Add heapblock and dlmalloc for managing memory
heapblock is a simple `sbrk` style implementation, also useful as an
"endless" decompression buffer. dlmalloc is used on top as a malloc
implementation.

This also changes how the Python side manages its heap. We still use a
python-side malloc implementation (since this is faster), and we put the
Python heap at the m1n1 heap + 128MB, without allocating it.
Hopefully this should never step on anything m1n1 neads, and avoids
having to manage freeing across Python script calls.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-29 16:25:15 +09:00
Hector Martin
f3d0a58f42 proxy: add mmu_shutdown call, use it for linux.py
I saw at least one SError crash on Linux after doing this, but can't
repro; unclear if related to the MMU changes or not...

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-29 00:36:46 +09:00
Hector Martin
c3c6e4e8f9 smp: add scaffolding and proxy funcs for cross-CPU calls
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-29 00:36:46 +09:00
Hector Martin
344c84da17 clang-format everything
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-28 16:06:12 +09:00
Hector Martin
63319ed348 utils: implement udelay()
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-23 22:42:25 +09:00
Hector Martin
ee12d053a9 proxy: add XZ and GZ decompression functions and code
This embeds tinf and minlzma.

Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-23 22:42:23 +09:00
Hector Martin
81aaf2ed35 Basic exceptions, irq, cache mgmt support
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-17 00:49:22 +09:00
Hector Martin
5175c7a31b Chainloading, ADT support, misc fixes
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-15 04:04:12 +09:00
Hector Martin
152c96a34a Import UART proxy
Signed-off-by: Hector Martin <marcan@marcan.st>
2021-01-15 04:04:12 +09:00