Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Master with old VM subsystem #1405

Open
wants to merge 21 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
fc00dc4
Add TIOCFLUSH ioctl (#1388)
panantoni01 Jun 5, 2023
9d5b16e
Clear thread pflags in _do_execve (#1394)
panantoni01 Jun 13, 2023
1758f39
mips: add EXC_TLB{RI,XI} to trap handler (#1395)
franciscozdo Jun 17, 2023
1ef01c6
Add pathconf syscall (#1398)
panantoni01 Jul 2, 2023
1357a78
A few improvements to the test framework (#1402)
cahirwpz Jul 16, 2023
36f9b66
Provide libc wrappers that die of failure (#1403)
cahirwpz Jul 16, 2023
27c4221
tests: add mmap_private test (#1401)
franciscozdo Jul 16, 2023
6ee0741
sbase: add getconf and hostname (#1400)
panantoni01 Jul 17, 2023
963e9fe
tty: add TIOCNOTTY ioctl (#1399)
panantoni01 Jul 21, 2023
388f16c
Extract changes from #1320 (#1406)
cahirwpz Jul 28, 2023
cab2f18
Move user-space test coordinator to user-space (#1408)
cahirwpz Jul 30, 2023
f4b90a0
Limit use of sched_yield for sync in tests (#1407)
cahirwpz Jul 31, 2023
057d849
Parallel test runner for userspace tests (#1409)
cahirwpz Jul 31, 2023
16e50c7
Various improvements to userspace tests framework (#1410)
cahirwpz Jul 31, 2023
d68dfe9
Run tests with both KASAN and KCSAN (#1411)
cahirwpz Aug 1, 2023
8f61aa5
Run kernel and user tests separately (#1412)
cahirwpz Aug 1, 2023
863f5ea
[ktest] fix thread name buffer size (#1413)
pj1031999 Aug 2, 2023
042c1d6
[clock] synchronize now (#1414)
pj1031999 Aug 4, 2023
094d23d
Add poll syscall as a wrapper of kevent (#1415)
panantoni01 Aug 30, 2023
378af6c
contrib: add tools from suckless ubase (#1371)
panantoni01 Sep 14, 2023
962d099
Build kernel with KFT instrumentation (#1393)
franciscozdo Nov 22, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 0 additions & 11 deletions .gdbinit
Original file line number Diff line number Diff line change
@@ -1,14 +1,3 @@
# some generic settings
set output-radix 0x10
set pagination off
set confirm off
set verbose off

# make extra commands available
python import os, sys
python sys.path.append(os.path.join(os.getcwd(), 'sys'))
python import debug

# favorite set of breakpoints
break kernel_init
break halt
Expand Down
10 changes: 10 additions & 0 deletions .gdbinit-common
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# some generic settings
set output-radix 0x10
set pagination off
set confirm off
set verbose off

# make extra commands available
python import os, sys
python sys.path.append(os.path.join(os.getcwd(), 'sys'))
python import debug
29 changes: 29 additions & 0 deletions .gdbinit-kftrace
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
# Command to easily append KFT events to specified file
define dump-kft
printf "Appending %d entries to file `dump.kft`\n", kft_used
append memory dump.kft kft_event_list kft_event_list+kft_used
end

set $kft_flush_count = 0

break kft_flush
commands
silent
printf "kft_flush(%d): ", $kft_flush_count++
dump-kft
continue
end

break ktest_success
commands
printf "ktest_success: "
dump-kft
end

break halt
commands
printf "halt: "
dump-kft
end

continue
12 changes: 0 additions & 12 deletions .gdbinit-test
Original file line number Diff line number Diff line change
@@ -1,15 +1,3 @@
# some generic settings
set output-radix 0x10
set pagination off
set confirm off
set verbose off
handle SIGINT stop

# make extra commands available
python import os, sys
python sys.path.append(os.path.join(os.getcwd(), 'sys'))
python import debug

define post-mortem
add-symbol-file bin/utest/utest.uelf 0x400000
echo \n*** REGISTERS ***\n\n
Expand Down
109 changes: 29 additions & 80 deletions .github/workflows/default.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,104 +29,53 @@ jobs:
- uses: actions/checkout@v3
- run: ./verify-pycodestyle.sh

build_mips:
name: Build MIPS
build:
name: Build Mimiker
strategy:
fail-fast: false
matrix:
arch: [mips, aarch64, riscv32, riscv64]
build: [kasan, kcsan]
exclude:
- arch: riscv32
build: kcsan
- arch: riscv64
build: kcsan
runs-on: self-hosted
needs: [verify_c_style, verify_py_style]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- run: make BOARD=malta KASAN=1 LOCKDEP=1
- run: ./action.sh build ${{ matrix.arch }} ${{ matrix.build }}
- uses: actions/upload-artifact@v3
with:
name: "mips kernel+ramdisk"
name: "${{ matrix.arch }} ${{ matrix.build }} build"
path: |
sys/mimiker.elf
sys/mimiker.elf.map
bin/*/*.uelf
usr.bin/*/*.uelf
initrd.cpio

build_aarch64:
name: Build AArch64
runs-on: self-hosted
needs: [verify_c_style, verify_py_style]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- run: make BOARD=rpi3 KASAN=1 LOCKDEP=1
- uses: actions/upload-artifact@v3
with:
name: "aarch64 kernel+ramdisk"
path: |
sys/mimiker.elf
sys/mimiker.img.gz
sys/mimiker.elf.map
bin/*/*.uelf
usr.bin/*/*.uelf
sys/dts/*.dtb
initrd.cpio

build_riscv32:
name: Build RISC-V 32-bit
runs-on: self-hosted
needs: [verify_c_style, verify_py_style]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- run: make BOARD=litex-riscv KASAN=1 LOCKDEP=1

build_riscv64:
name: Build RISC-V 64-bit
runs-on: self-hosted
needs: [verify_c_style, verify_py_style]
steps:
- uses: actions/checkout@v3
with:
submodules: recursive
- run: make BOARD=sifive_u KASAN=1 LOCKDEP=1
- uses: actions/upload-artifact@v3
with:
name: "riscv64 kernel+ramdisk"
path: |
sys/mimiker.elf
sys/mimiker.elf.map
bin/*/*.uelf
sys/mimiker.img.gz
usr.bin/*/*.uelf
initrd.cpio

kernel_tests_mips:
name: Tests MIPS
runs-on: self-hosted
needs: build_mips
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: "mips kernel+ramdisk"
- run: ./run_tests.py --board malta --timeout=100 --times=50

kernel_tests_aarch64:
name: Tests AArch64
runs-on: self-hosted
needs: build_aarch64
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: "aarch64 kernel+ramdisk"
- run: ./run_tests.py --board rpi3 --timeout=60 --times=50

kernel_tests_riscv64:
name: Tests RISC-V 64-bit
tests:
name: Run Tests
strategy:
fail-fast: false
matrix:
arch: [mips, aarch64, riscv64]
build: [kasan, kcsan]
suite: [kernel, user]
exclude:
- arch: riscv64
build: kcsan
runs-on: self-hosted
needs: build_riscv64
needs: build
steps:
- uses: actions/checkout@v3
- uses: actions/download-artifact@v3
with:
name: "riscv64 kernel+ramdisk"
- run: ./run_tests.py --board sifive_u --timeout=100 --times=50
name: "${{ matrix.arch }} ${{ matrix.build }} build"
- run: ./action.sh tests ${{ matrix.arch }} ${{ matrix.build }} ${{ matrix.suite }}
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -83,3 +83,6 @@ mimiker-env/

#
contrib/*/build/

# kft dump
dump.kft
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
[submodule "contrib/atto/incurses"]
path = contrib/atto/incurses
url = https://github.com/infinnovation-dev/incurses.git
[submodule "contrib/ubase/ubase"]
path = contrib/ubase/ubase
url = git://git.suckless.org/ubase
[submodule "contrib/sbase/sbase"]
path = contrib/sbase/sbase
url = git://git.suckless.org/sbase
Expand Down
41 changes: 41 additions & 0 deletions action.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/bin/sh

cmd=$1
arch=$2
build=$3

shift 3

case $arch in
mips) board=malta ;;
aarch64) board=rpi3 ;;
riscv32) board=litex-riscv ;;
riscv64) board=sifive_u ;;
*) exit 1 ;;
esac

case $build in
kasan) ksan=KASAN ;;
kcsan) ksan=KCSAN ;;
*) exit 1 ;;
esac

case $cmd in
build)
make BOARD=$board $ksan=1 LOCKDEP=1 ;;
tests)
case $build in
kasan)
./run_tests.py --board $board --timeout=100 --times=50 --suite=$1 ;;
kcsan)
./run_tests.py --board $board --timeout=100 --times=50 --suite=$1 \
--parallel=5
# do not report it as failed because we have no people working on
# fixing concurrency issues
exit 0 ;;
*)
exit 1 ;;
esac ;;
*)
exit 1 ;;
esac
4 changes: 4 additions & 0 deletions bin/ksh/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ clean-here:
$(RM) siglist.out siglist.out.tmp
$(RM) emacs.out emacs.out.tmp

install-here:
@echo "[SYMLINK] sh -> $(PROGRAM)"
ln -sf $(PROGRAM) $(SYSROOT)/$(BINDIR)/sh

# two steps to prevent the creation of a bogus siglist.out
siglist.out: config.h sh.h siglist.in siglist.sh
./siglist.sh "$(CC) -E $(CPPFLAGS) $(DEFS) -I. -I$(CURDIR)" \
Expand Down
6 changes: 5 additions & 1 deletion bin/utest/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -31,15 +31,19 @@ SOURCES = \
vfs.c \
wait.c \
vm_map.c \
vm_map_prot.c
vm_map_prot.c \

PROGRAM = utest

CPPFLAGS += -I.
EXTRAFILES = $(shell find extra -type f)
INSTALL-FILES = $(EXTRAFILES:extra/%=$(SYSROOT)/%)

include $(TOPDIR)/build/build.prog.mk

# Force a user not to use following symbols
LDFLAGS += --wrap=sprintf --wrap=printf --wrap=wait

$(SYSROOT)/%: extra/%
@echo "[INSTALL] $(DIR)$< -> /$*"
$(INSTALL) -m 644 $< $@
8 changes: 4 additions & 4 deletions bin/utest/access.c
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@
#include <fcntl.h>
#include <errno.h>

TEST_ADD(access_basic) {
TEST_ADD(access_basic, 0) {
/* After implementing credentials test should be extended. */
syscall_ok(access("/bin/mandelbrot", R_OK));
syscall_ok(access("/bin/mandelbrot", 0));
syscall_ok(access("/bin/mandelbrot", R_OK | W_OK | X_OK));
xaccess("/bin/mandelbrot", R_OK);
xaccess("/bin/mandelbrot", 0);
xaccess("/bin/mandelbrot", R_OK | W_OK | X_OK);
syscall_fail(access("/tests/ascii", X_OK), EACCES);
syscall_fail(access("/bin/mandelbrot", (R_OK | W_OK | X_OK) + 1), EINVAL);
syscall_fail(access("/dont/exist", X_OK), ENOENT);
Expand Down
Loading