Skip to content

Releases: fwsGonzo/libriscv

v1.2

25 May 13:28
9047573
Compare
Choose a tag to compare

PRs

What's Changed

  • Binary translation has been improved, now matching native binaries for the STREAM benchmark.
  • double vmcall arguments are no longer forgotten: They can be used when making function calls into the VM
  • When retrieving system call arguments, we can now use std::span, pointers* and std::array.
    • std::span uses 2 registers and is a zero-copy view into guest memory
    • Pointers use 1 register and are also zero-copy
    • std::array uses 1 register and produces an array by value
  • There is now a large 3-part example in examples/gamedev with:
    • A C++ program example
    • A Nelua program example
    • A Nim program example
  • ROR.W is no longer treated as unimplemented (even though it was always there)!
  • Unknown CSRRCI instructions no longer result in illegal operation - instead calls on_unknown_csr correctly

Full Changelog: v1.1...v1.2

v1.1: Sandbox configuration

07 Jan 20:49
793d032
Compare
Choose a tag to compare

This release is about sandboxing. I have spent some time this past few weeks fuzzing and tinkering with sandbox safety. I have also removed a bunch of code that was not used a lot, reducing attack surface. Some effort has been made to use pointers less. For example, an execute segment is now required at all times, passed only by reference. Instead of a null-check, the default execute segment is an empty segment. I've also added more modes to the fuzzer in an attempt to fuzz APIs I consider part of (or potentially part of) a safe sandboxing configuration. More fuzzing is needed, of course, but I'm happy with the progress.

The C API has been getting some improvements too. There is now enough API to make function calls into the guest programs.

What's Changed

  • The C API has expanded to cover VM function calls
  • Added SECURITY.md which documents a safe sandbox configuration
  • Added a Nelua example program
  • 32- and 64-bit can be individually disabled in CMake in order to reduce build times
  • A new tiny templated ELF header has replaced the old long version
  • Added a benchmark against Luau

PRs

  • Pass instruction counters in registers to simulate() by @fwsGonzo in #110
  • Use templates for ELF parsing, and remove the large C header by @fwsGonzo in #111
  • Use registers for counters when entering and leaving binary translation by @fwsGonzo in #114
  • Make instantiation of 32- and 64-bit ISAs a CMake option by @fwsGonzo in #115
  • Pass PC as register to simulate() and next_exec_seg() by @fwsGonzo in #116
  • Make reordering bytecodes easier by @fwsGonzo in #120
  • Reorganize members, add alignment hints, move atomics to Memory by @fwsGonzo in #121
  • Add C API functions related to VM calls by @fwsGonzo in #123
  • Simplify memory helper functions, removing memview and foreach by @fwsGonzo in #124

Full Changelog: v1.0...v1.1

v1.0: Dynamic ELF loading

12 Dec 18:58
a1ea592
Compare
Choose a tag to compare

The 1.0 release is finally here, with dynamic ELF loading support. Note that the libriscv Machine will not attempt to find an interpreter, and instead the programmer should find an interpreter locally, load it into the Machine, and then provide the real program as the first argument, with the programs arguments right after that.

Example:
./myprogram myarg0 myarg1 --> /usr/riscv64/lib/ld-linux.so ./myprogram myarg0 myarg1.

You can test the dynamic loading, which should work out-of-the-box with the CLI.

  • The B-extension is now considered stable and reliable
  • There is now support for mapping files to memory (one-way). Used by the dynamic linker loader.
  • An HTTPS request was finally made from the emulator using Zig.

There is still work to be done with the C API, which while working well is not fully fleshed out, and Debian packing may need additional testing. As usual the emulator has been fuzzed and tested a bit before the release.

Full Changelog: v0.24...v1.0

v0.24: MSVC CMake support, Debian packaging

18 Nov 20:20
53cb139
Compare
Choose a tag to compare

What's Changed

  • C++20 is now required, as many features related to B-extension required it on Windows, eg. <bit> and designated initializers.
  • With this release there is now full Windows MSVC w/CMake support (Clang-cl) with support for 32- and 64-bit IMAFDC + B-extension. There is enough system call emulation to run simple Linux C/C++, Zig, Rust and Go programs .. on Windows!
  • CPack support has been added so that it is possible to generate a .deb file that installs a static library, the build settings and the include headers.
  • The flat read-write arena has been made default enabled.
  • Machine serialization has been improved to be usable with regular memory arena.

PRs

Full Changelog: v0.23...v0.24

v0.23: C API and B-extension

11 Nov 21:45
574ae0c
Compare
Choose a tag to compare

What's Changed

  • Complete support for B-extension in all dispatch modes and binary translation
    • Zba, Zbb, Zbc, Zbs adds 43 new instructions
  • There is now a C API for the emulator, which you can find here
  • Add GitHub workflow for C API by @fwsGonzo in #100
  • Many small performance increases through new bytecodes and various tweaks (eg. 3f8ce9f)
  • A few integrity fixes based on fuzzing

Full Changelog: v0.22...v0.23

v0.22: Stable binary translation

03 Nov 23:19
39fe31c
Compare
Choose a tag to compare

What's Changed

  • Binary translation is no longer experimental
  • Improve binary translation performance
  • Binary translation instruction counting is now very accurate
  • Lower binary translation footprint
  • Tail-call dispatch is no longer experimental, w/compressed instructions support, tests
  • Add new experimental read-write arena mode, adding performance
  • Add new experimental libtcc binary translation mode
  • Add some speculation safety to memory operations
  • Compressed instructions now passes fuzzing tests
  • Add quite a bit more B-extension instructions
  • Tons of small improvements and fixes!

Full Changelog: v0.21...v0.22

v0.21

22 Oct 19:38
ad1e7aa
Compare
Choose a tag to compare

What's Changed

  • Support binary translation for run-time execute segments, enabling it for RISC-V that is generated on-the-fly
  • Implement most B-extension instructions generated by GCC (so far), including for binary translation
  • Use real instruction count to avoid exiting binary translation loops by @fwsGonzo in #93
  • Simplify instruction counting in binary translation by @fwsGonzo in #94
  • Tons of small improvements and fixes!

Full Changelog: v0.20...v0.21

v0.20

03 Mar 12:51
833ad35
Compare
Choose a tag to compare

What's Changed

  • FreeBSD build support by @fwsGonzo in #92
  • Fix build on OpenBSD by @iyzsong in #91
  • Added example that uses libriscv with MSVC and Clang-cl
  • Support for prepared calls that attempt to reduce vmcall overhead
  • Bug fixes and improvements to vmcalls
  • Using always_inline in key places in order to improve debug performance

New Contributors

Full Changelog: v0.19...v0.20

v0.19

29 Dec 09:50
c2a2e01
Compare
Choose a tag to compare

This release contains bugfixes and performance improvements along with initial Clang-CL support. libriscv can now be used in Visual Studio with Clang.

What's Changed

  • Implement experimental tailcall dispatch by @fwsGonzo in #88
  • Custom instructions can be implemented, compatible with all simulation modes
  • Add CMake option for enabling RV128I, which increased build times
  • Performance improvements when running programs with compressed instructions
  • Added a Rust hello world example
  • mmap()-backed arena for faster emulation
  • You can now embed libriscv using FetchContent in VisualStudio with Clang-cl

Full Changelog: v0.18...v0.19

v0.18

06 Dec 20:41
6b09fbb
Compare
Choose a tag to compare

In this release the simulation is around 50-100% faster because there's a new faster dispatch mode. The default is threaded. It can be disabled by setting RISCV_THREADED to OFF on compilers without computed goto support. The emulator now also doesn't need to be specially built for debugging in order to step through instructions one by one.

Internally, there is now the concept of separate prepared execute segments, which allow much faster interpretation of new (unknown) execute areas in memory. Previously these would use a slow-path instead.

What's Changed

  • Remove need to use build option for CLI debugging by @fwsGonzo in #81
  • Add experimental bytecode simulator mode by @fwsGonzo in #83

Full Changelog: v0.17...v0.18