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

(bsd-user MTTCG branch) Linux build fixes for system mode #239

Open
wants to merge 1 commit into
base: qemu-cheri-bsd-user-mttcg
Choose a base branch
from

Conversation

tmarkettos
Copy link

Fix the build for the bsd-user branch to build riscv64cheri-softmmu system-mode on Linux. Currently the codebase throws an assertion failure in early BBL/CheriBSD boot (even without -accel tcg,thread=multi):

$ ~/cheri/output/sdk/bin/qemu-system-riscv64cheri -M virt -m 2048 -nographic -bios bbl-riscv64cheri-virt-fw_jump.bin -kernel ~/cheri/output/rootfs-riscv64-purecap/boot/kernel/kernel -drive if=none,file=~/cheri/output/cheribsd-riscv64-purecap.img,id=drv,format=raw -device virtio-blk-device,drive=drv -smp 2 -s -serial mon:stdio -serial pty -monitor tcp:127.0.0.1:5555,server,nowait -device virtio-net-device,netdev=net0 -netdev tap,id=net0,ifname=tap0,script=no,downscript=no -D trace.log -append -v
char device redirected to /dev/pts/10 (label serial1)
bbl loader
SoC version: unknown
Hart 0 version: unknown
Hart 1 version: unknown
qemu-system-riscv64cheri: ../../qemu/target/cheri-common/cheri_tagmem.c:851: void invalidate_from_locktag(lock_tag *): Assertion `lock != TAG_LOCK_ERROR' failed.
qemu-system-riscv64cheri: ../../qemu/target/cheri-common/cheri_tagmem.c:851: void invalidate_from_locktag(lock_tag *): Assertion `lock != TAG_LOCK_ERROR' failed.

@@ -1580,8 +1580,12 @@ subdir('replay')
subdir('hw')
subdir('accel')
subdir('plugins')
subdir('bsd-user')
subdir('linux-user')
if 'CONFIG_BSD_USER' in config_target
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These seem odd given there isn’t a guard here for linux-user upstream?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@kwitaszczyk 's qemu-cheri-bsd-user-mttcg branch adds extra source files in the bsd-user build which, by not existing, trip up meson even when you aren't building bsd-user. Putting a guard here avoids meson seeing them.

This PR enables his branch to build in system mode; making the system mode usable is a WiP

Copy link
Member

@jrtc27 jrtc27 Sep 11, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. That doesn't explain why linux-user needs them
  2. bsd-user likely shouldn't be written in such a way as to require this, given neither bsd-user nor linux-user do upstream

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants