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

Unable to run tests in QEMU (HTIF tohost must be 8 bytes) #8

Open
andrewt0301 opened this issue Jul 2, 2018 · 2 comments
Open

Unable to run tests in QEMU (HTIF tohost must be 8 bytes) #8

andrewt0301 opened this issue Jul 2, 2018 · 2 comments

Comments

@andrewt0301
Copy link

I am not sure whether this issue is related to QEMU for RISC-V or the test infrastructure.

When I am trying to run a test (e.g. one from riscv-tests/isa or one generated by riscv-torture) in QEMU for RISC-V, I get the following error:

    HTIF tohost must be 8 bytes

When I comment out the following lines of code in the riscv_test.h file and recompile the test, the problem disappears:

    .pushsection .tohost,"aw",@progbits;                            \
    .align 6; .global tohost; tohost: .dword 0;                     \
    .align 6; .global fromhost; fromhost: .dword 0;                 \
    .popsection;`
@deepak0414
Copy link
Contributor

It's been 4 years. I see the same issue.
However if I comment it out, tests dont compile because they're referencing this symbols.

Anyone else faced this issue with qemu and know how to get past it?

@trdthg
Copy link

trdthg commented Sep 6, 2024

6 years, I got here. Sad to see no progress.

I'm trying to test qemu with riscof, but

cmd:

qemu-riscv32-static ./qemu/riscof_work/rv32i_m/I/src/add-01.S/ref/ref.elf

It's just stuck.

cmd:

# riscv32-xxxxxxxxxx-objcopy -I demo.elf demo.img
qemu-system-riscv32 -bios none -serial stdio -display none -kernel ./qemu/riscof_work/rv32i_m/I/src/add-01.S/ref/ref.img

output:

qemu-system-riscv32: HTIF tohost must be 8 bytes

spike can handle tohost correctly, qemu-system-riscv32 use spike as machine by default, but it doesn't work

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

No branches or pull requests

3 participants