I fixed the user exception handling to run sbrktest() in usertests.c properly in the case of memory shortage.
We should have check process's signal state when the process returns to the userland, however the xv6 for AArch64 was not written as it should be.
After applying both this PR and PR: #3 , we can run usertests till the end.
$ ./run.sh
run armv8 without qemu.log
starting xv6 for ARMv8...
Implementer: ARM Limited
Current EL: EL1
Flushing TLB and Instr Cache
Setting Memory Attribute Indirection Register (MAIR_EL1)
Setting Vector Base Address Register (VBAR_EL1)
Setting Translation Control Register (TCR_EL1)
Setting Translation Table Base Register 1 (TTBR1_EL1)
Setting Translation Table Base Register 0 (TTBR0_EL1)
Setting System Control Register (SCTLR_EL1)
System Configure Completed...
clearing BSS section for the main kernel
Starting Kernel
**************************************************************************
** **
** **
** xv6 on ARMv8-A (64-bit) Architecture **
** **
** **
**************************************************************************
init: Starting Shell
$ usertests
usertests starting
bigarg test
bigarg test ok
bigwrite test
bigwrite ok
bigarg test
bigarg test ok
bss test
bss test ok
sbrk test
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00000000 -- kill proc
proc killed: pid: 7 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff0000c350 -- kill proc
proc killed: pid: 8 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff000186a0 -- kill proc
proc killed: pid: 9 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff000249f0 -- kill proc
proc killed: pid: 10 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00030d40 -- kill proc
proc killed: pid: 11 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff0003d090 -- kill proc
proc killed: pid: 12 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff000493e0 -- kill proc
proc killed: pid: 13 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00055730 -- kill proc
proc killed: pid: 14 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00061a80 -- kill proc
proc killed: pid: 15 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff0006ddd0 -- kill proc
proc killed: pid: 16 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff0007a120 -- kill proc
proc killed: pid: 17 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00086470 -- kill proc
proc killed: pid: 18 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff000927c0 -- kill proc
proc killed: pid: 19 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff0009eb10 -- kill proc
proc killed: pid: 20 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff000aae60 -- kill proc
proc killed: pid: 21 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff000b71b0 -- kill proc
proc killed: pid: 22 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff000c3500 -- kill proc
proc killed: pid: 23 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff000cf850 -- kill proc
proc killed: pid: 24 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff000dbba0 -- kill proc
proc killed: pid: 25 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff000e7ef0 -- kill proc
proc killed: pid: 26 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff000f4240 -- kill proc
proc killed: pid: 27 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00100590 -- kill proc
proc killed: pid: 28 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff0010c8e0 -- kill proc
proc killed: pid: 29 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00118c30 -- kill proc
proc killed: pid: 30 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00124f80 -- kill proc
proc killed: pid: 31 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff001312d0 -- kill proc
proc killed: pid: 32 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff0013d620 -- kill proc
proc killed: pid: 33 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00149970 -- kill proc
proc killed: pid: 34 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00155cc0 -- kill proc
proc killed: pid: 35 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00162010 -- kill proc
proc killed: pid: 36 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff0016e360 -- kill proc
proc killed: pid: 37 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff0017a6b0 -- kill proc
proc killed: pid: 38 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00186a00 -- kill proc
proc killed: pid: 39 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff00192d50 -- kill proc
proc killed: pid: 40 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff0019f0a0 -- kill proc
proc killed: pid: 41 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff001ab3f0 -- kill proc
proc killed: pid: 42 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff001b7740 -- kill proc
proc killed: pid: 43 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff001c3a90 -- kill proc
proc killed: pid: 44 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff001cfde0 -- kill proc
proc killed: pid: 45 name: usertests EL:0 ESR:0x92000006
Data abort esr 92000006 on cpu 0 pc 0x393c addr 0xffffffff001dc130 -- kill proc
proc killed: pid: 46 name: usertests EL:0 ESR:0x92000006
allocuvm out of memory
allocuvm out of memory
allocuvm out of memory
allocuvm out of memory
allocuvm out of memory
allocuvm out of memory
allocuvm out of memory
allocuvm out of memory
allocuvm out of memory
proc killed: pid: 47 name: usertests EL:0 ESR:0x56000000
proc killed: pid: 48 name: usertests EL:0 ESR:0x56000000
proc killed: pid: 49 name: usertests EL:0 ESR:0x56000000
proc killed: pid: 50 name: usertests EL:0 ESR:0x56000000
proc killed: pid: 51 name: usertests EL:0 ESR:0x56000000
proc killed: pid: 52 name: usertests EL:0 ESR:0x56000000
proc killed: pid: 53 name: usertests EL:0 ESR:0x56000000
proc killed: pid: 54 name: usertests EL:0 ESR:0x56000000
proc killed: pid: 55 name: usertests EL:0 ESR:0x56000000
proc killed: pid: 56 name: usertests EL:0 ESR:0x56000000
sbrk test OK
validate test
validate ok
open test
open test ok
small file test
creat small succeeded; ok
writes ok
open small succeeded ok
read succeeded ok
small file test ok
big files test
big files ok
many creates, followed by unlink test
many creates, followed by unlink; ok
mem test
allocuvm out of memory
mem ok
pipe1 ok
exitwait ok
rmdot test
rmdot ok
fourteen test
fourteen ok
bigfile test
bigfile test ok
subdir test
subdir ok
concreate test
concreate ok
linkunlink test
linkunlink ok
linktest
linktest ok
unlinkread test
unlinkread ok
createdelete test
createdelete ok
twofiles test
twofiles ok
sharedfd test
sharedfd ok
dir vs file
dir vs file OK
empty file name
empty file name OK
fork test
fork test OK
bigdir test
bigdir ok
exec test
ALL TESTS PASSED
$
I fixed the user exception handling to run sbrktest() in usertests.c properly in the case of memory shortage. We should have check process's signal state when the process returns to the userland, however the xv6 for AArch64 was not written as it should be.
After applying both this PR and PR: #3 , we can run
usertests
till the end.Thanks, Regards,