Commit graph

1938 commits

Author SHA1 Message Date
bunnie
f4232a3236 stabilize suspend/resume a bit
- introduce wfi backoff during the suspend process
- increase the region of cache flush - seems to improve
stability
- remove some print calls to avoid interference during
the sleeping process
2021-08-29 12:04:20 +08:00
bunnie
aa159c5e5e update precursors with correct gitrev 2021-08-27 16:22:01 +08:00
bunnie
759ce9e05c Merge branch 'bunnie-dev' into main 2021-08-27 15:48:26 +08:00
bunnie
58bff6aa3a commit working SoC image 2021-08-27 15:47:43 +08:00
bunnie
e2ce3cad2c make sure that the power states get set correctly early in the resume process 2021-08-27 15:47:27 +08:00
Sean Cross
0ae6d1460a kernel: update version of gdbserver
Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-25 16:05:56 +08:00
Sean Cross
7d3d710554 kernel: gdb_server: don't inline functions
This was a holdover from size benchmarks.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-25 16:05:27 +08:00
Sean Cross
30eb24af61 kernel: debug: fix wrap-print on xous target
When targeting the `xous` target, we were missing some variables due to
them relying on `target_os="none"`.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-25 16:04:42 +08:00
Sean Cross
b43366e6ec kernel: services: fix suspend for running processes
If a process is currently running, it needs to be placed into the
`Debug` state rather than the `Ready` state.

Additionally, the process that's being switched to must enter the
`Running` state.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-25 16:03:06 +08:00
Sean Cross
1cb86078d5 kernel: riscv: suspend or terminate processes that fail
If a process fails for some reason (e.g. by performing a fault) and
there is no exception handler, either terminate the process or (if
gdbserver is enabled) have it suspend the process.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-25 16:02:11 +08:00
bunnie
d417ef560a progress toward COM bus refactor; precursors reduce COM frequency slightly 2021-08-25 02:29:00 +08:00
bunnie
e407e77b4f unbreak renode build 2021-08-24 23:38:26 +08:00
bunnie
57574495d8 handle case of sleep request before resume is fully completed 2021-08-24 23:35:32 +08:00
bunnie
f5b69a8cef fix hosted mode 2021-08-24 23:34:33 +08:00
bunnie
69d9e38c8b add EC updates to the CI update script 2021-08-24 23:22:41 +08:00
bunnie
33d14b6ee3 add some timeouts after each phase, for the device to reboot 2021-08-24 22:59:10 +08:00
bunnie
1af98f7e43 Merge branch 'main' of github.com:betrusted-io/xous-core into bunnie-dev 2021-08-24 22:39:50 +08:00
bunnie
99ff36f529 add a quick CI update script 2021-08-24 22:37:31 +08:00
bunnie
f6d1c9fda7 Merge branch 'main' of github.com:betrusted-io/xous-core into main 2021-08-24 21:28:28 +08:00
bunnie
163e811dd7 cleanup build script 2021-08-24 21:28:00 +08:00
bunnie
a3c5f1b428 absorb UART power management fix into gateware 2021-08-24 19:19:48 +08:00
bunnie
3188225030 modularize the layout crate 2021-08-24 19:19:06 +08:00
bunnie
ebf0a02345 a patch for issue #73
the problem is that during the computation of the lines, the
cursor isn't wrapping to the next line if the last character
would render "into" the edge of the box. adding a trailing
space to any incoming strings forces the line to wrap.

you can aggravate this condition by typing the following
sentence into the shell:

this is a test of a message that is too long a message

when it fails, it renders

this is a test of a messag
e that is too long a messag

adding the trailing space causes it to render as

this is a test of a messag
e that is too long a messa
ge

which is the desired behavior
2021-08-24 17:58:39 +08:00
bunnie
98afa19264 fix kernel uart going dead after suspend/resume 2021-08-24 03:46:02 +08:00
bunnie
47fef3c2d0 clean out debug messages and scaffolding 2021-08-24 01:48:30 +08:00
bunnie
387b5d22e5 another fix for issue #75: llio resume failure
Found the following KP on resume. This time it looks like it's
failing in a syscall, during a send_message call. There's no
more visibility into what causes this, so this commit tries to clean
up some loose ends in the resume path that could send messages before
the system is ready. Namely, the console mux call got condensed into
an abridged version that doesn't send log messages (you couldn't see
them anyways...), and the I2C engine now pauses suspend until
the current transaction at hand completes. I suspect it's quite
likely that it's the I2C engine that's causing the issues...

LLIO -> PID 14
Jumping to loader...
PROGRAM HALT: CPU Exception on PID 14: Store page fault of 0x00000000 at 0x0003a02e
Current thread 2:
Thread 2:
PC:0003a02e   SP:7ffff170   RA:00036290
GP:00000000   TP:60000000
T0:00000000   T1:000000f0   T2:00000030
T3:00000080   T4:000000f4   T5:ffffffff   T6:0000008f
S0:7ffff1d0   S1:7ffff228   S2:00000007   S3:00000007
S4:00000001   S5:00000004   S6:00037996   S7:00010e34
S8:00011548   S9:000101bc  S10:7fffff4c  S11:0003c000
A0:0000000e   A1:00000000   A2:00000004   A3:00000000
A4:00000000   A5:00000000   A6:00000000   A7:00000000

0003a028 <_xous_syscall>:
   3a028:	00000073		ecall
   3a02c:	4282                	lw	t0,0(sp)
   3a02e:	00a2a023          	sw	a0,0(t0)
   3a032:	00b2a223          	sw	a1,4(t0)
   3a036:	00c2a423          	sw	a2,8(t0)
   3a03a:	00d2a623          	sw	a3,12(t0)
   3a03e:	00e2a823          	sw	a4,16(t0)
   3a042:	00f2aa23          	sw	a5,20(t0)
   3a046:	0102ac23          	sw	a6,24(t0)
   3a04a:	0112ae23          	sw	a7,28(t0)
   3a04e:	8082                	ret

0003623c <_ZN4xous7syscall12send_message17h44786a68889a5f1dE>:
pub fn send_message(connection: CID, message: Message) -> core::result::Result<Result, Error> {
   3623c:			7175                   addi			       sp,sp,-144
   3623e:			c706                   sw			       ra,140(sp)
   36240:			c522                   sw			       s0,136(sp)
   36242:			c326                   sw			       s1,132(sp)
   36244:			84aa                   mv			       s1,a0
   36246:			4549                   li			       a0,18
    crate::arch::syscall(call)
   36248:	4214			lw	a3,0(a2)
   3624a:	4258                	lw	a4,4(a2)
   3624c:	04a10023          	sb	a0,64(sp)
   36250:	c2ae                	sw	a1,68(sp)
   36252:	c4b6                	sw	a3,72(sp)
   36254:	c6ba                	sw	a4,76(sp)
   36256:	4608                	lw	a0,8(a2)
   36258:	464c                	lw	a1,12(a2)
   3625a:	4a14                	lw	a3,16(a2)
   3625c:	4a50                	lw	a2,20(a2)
   3625e:	c8aa                	sw	a0,80(sp)
   36260:	caae                	sw	a1,84(sp)
   36262:	ccb6                	sw	a3,88(sp)
   36264:	ceb2                	sw	a2,92(sp)
    let mut ret = crate::Result::Ok;
   36266:   d082			sw	zero,96(sp)
    let args = call.as_args();
   36268:    0828			addi	a0,sp,24
   3626a:    008c                	addi	a1,sp,64
   3626c:    00000097          		auipc	ra,0x0
   36270:    8da080e7          		jalr	-1830(ra) # 35b46 <_ZN4xous7syscall7SysCall7as_args17h7e6c318e8a926fa8E>
            args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], &mut ret,
   36274:   4562                       lw	a0,24(sp)
   36276:   45f2                       lw	a1,28(sp)
   36278:   5602                       lw	a2,32(sp)
   3627a:   5692                       lw	a3,36(sp)
   3627c:   5722                       lw	a4,40(sp)
   3627e:   57b2                       lw	a5,44(sp)
   36280:   5842                       lw	a6,48(sp)
   36282:   58d2                       lw	a7,52(sp)
   36284:   1080                       addi	s0,sp,96
        _xous_syscall(
   36286:	c022			sw	s0,0(sp)
   36288:	00004097          	auipc	ra,0x4
   3628c:	da0080e7          	jalr	-608(ra) # 3a028 <_xous_syscall>
        crate::Result::Error(e) => Err(e),
   36290:			5586			lw	a1,96(sp)
   36292:			5516                	lw	a0,100(sp)
   36294:			4605                	li	a2,1
   36296:			00c59563          	bne	a1,a2,362a0 <_ZN4xous7syscall12send_message17h44786a68889a5f1dE+0x64>
        Err(e) => Err(e),
   3629a:      c0c8			sw	a0,4(s1)
2021-08-24 01:39:48 +08:00
bunnie
160a730d9f commit precursors
contains
 - refactored WDT
 - refactored keyboard interface

still exhibits issue #74, unfortunately. seems that key-up events
go missing every now and then. still not sure why.
2021-08-23 05:12:45 +08:00
bunnie
80cae0d446 intermediate progress on issue #74
still not fixed, but things are leaned up.
2021-08-23 05:12:21 +08:00
bunnie
a2bcf0fc2b match wdt ping to refactor + fix paths for default images to xous 2021-08-23 05:11:14 +08:00
bunnie
198ef3d0c8 attempt to address issue #75
resume failure was seen due to a crash in the engine-25519 process,
in particular, it's crashing on a try_send_message call.
Seems like probably the loader -> kernel transition could have
left some turds in the curve25519 engine, triggering an interrupt
when the system is not yet stable.

this attempts to smooth that over.
2021-08-23 05:07:38 +08:00
bunnie
5042da07fb refactor wdt to be more reliable and simpler 2021-08-23 05:07:21 +08:00
bunnie
cf747f2844 fix keyboard repeat; accidentally eliminated it during power optimizations 2021-08-22 18:52:33 +08:00
bunnie
24d1bed9f8 restore thread in hosted mode 2021-08-22 17:52:28 +08:00
bunnie
5df8275c00 major refactor of the keyboard server
This one gets rid of a ton of awful, crufty code that was pre-std.
It also removes the following features:

- raw scancode reporting: nobody uses them, and they've never been tested.
They can be added in later if someone wants to e.g. build a MAME emulator.
- multi-listener: there is no good reason to do this on a secure system.
multi-listener is basically a keyboard logger. It's better if we just
control it to a single keyboard listener.
2021-08-22 17:13:36 +08:00
bunnie
abd8eadfd8 modify the console behavior to better capture panics on resume
switches to kernel console on suspend, keeps it in kernel
console on resume for a few hundred ms before switching back
to our original setting
2021-08-22 14:28:06 +08:00
bunnie
1cd95649df expand the rootkeys environment sanity check to include the GAM 2021-08-22 02:41:22 +08:00
bunnie
491e3e5429 remove stale referecne from debugging bbram 2021-08-22 02:31:52 +08:00
bunnie
4d3a8c2ced fix issue #81
background clears were going beyond their borders, and also
introducing a new border of their own. fixed.
2021-08-22 02:18:02 +08:00
bunnie
5706c9e525 fix stale comment 2021-08-22 02:17:53 +08:00
bunnie
8d6a9f6b46 add some helper scripts for development 2021-08-22 00:41:22 +08:00
bunnie
20fd465acd a little more cleanup/re-org 2021-08-22 00:37:53 +08:00
bunnie
ca8bead919 improve organization of the modal crate 2021-08-22 00:29:42 +08:00
bunnie
b4a85318c1 fix up README.md to match today's release 2021-08-20 17:52:18 +08:00
Sean Cross
fea1961812 RELEASE-0.9: add section on Remode
Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-20 17:39:17 +08:00
Sean Cross
a151fb0815 README: remove an unnecessary step from renode
The Renode steps no longer require you to install the -none target.

Signed-off-by: Sean Cross <sean@xobs.io>
2021-08-20 15:55:35 +08:00
bunnie
55c72097db well, now we know the signtaure check works.
gateware was missing the signature area due to a problem in
the preparation script. now fixed.
2021-08-20 04:32:30 +08:00
bunnie
d9cf901ae2 update precursors to v0.9.0 SoC build 2021-08-20 02:24:45 +08:00
bunnie
983aca8d70 note default branch change 2021-08-20 01:29:31 +08:00
bunnie
e7bbf209d0 add back-link to 0.8 for API docs 2021-08-20 01:28:04 +08:00
bunnie
2a37f616d3 release 0.9 notes 2021-08-20 01:25:23 +08:00