riscv: Add support for riscv64ilp32 (X32 ABI) #2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The riscv64ilp32 target, also known as the X32 ABI, allows 64-bit RISC-V processors to run 32-bit user space programs. This provides better performance than the pure 32-bit environment, while maintaining binary compatibility with existing 32-bit programs.
This commit adds support for the riscv64ilp32 target to QEMU. With this change, QEMU can now simulate and execute 32-bit user space programs on 64-bit RISC-V processors following the X32 ABI specification.
Major changes:
Testing:
This change has been tested by running the QEMU riscv64ilp32-softmmu and riscv64ilp32-linux-user targets with the following commands:
$ ./qemu-system-riscv64ilp32 -cpu rv64 -M virt -m 256M -nographic
-bios fw_dynamic.bin_m64lp64 -kernel ./Image
-drive file=./rootfs.ext2,format=raw,id=hd0
-device virtio-blk-device,drive=hd0
-append "root=/dev/vda rw console=ttyS0 earlycon=sbi"
$ ./qemu-riscv64ilp32 /path/to/riscv64ilp32-binary
All tests passed successfully.