Skip to content

Commit

Permalink
refactor!: disable Sv57 address translation and remove no4lvl bootarg
Browse files Browse the repository at this point in the history
  • Loading branch information
edubart committed Oct 8, 2024
1 parent e66a9fa commit 4a3040d
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 2 deletions.
2 changes: 2 additions & 0 deletions src/interpret.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1981,7 +1981,9 @@ static NO_INLINE execute_status write_csr_satp(STATE_ACCESS &a, uint64_t val) {
case SATP_MODE_BARE:
case SATP_MODE_SV39:
case SATP_MODE_SV48:
#ifndef NO_SATP_MODE_SV57
case SATP_MODE_SV57:
#endif
stap = (val & SATP_PPN_MASK) | (val & SATP_ASID_MASK) | (val & SATP_MODE_MASK);
break;
default:
Expand Down
4 changes: 2 additions & 2 deletions src/machine-config.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,8 +85,8 @@ struct ram_config final { // NOLINT(bugprone-exception-escape)
/// \brief DTB state configuration
struct dtb_config final { // NOLINT(bugprone-exception-escape)
std::string bootargs{
"no4lvl quiet earlycon=sbi console=hvc0 root=/dev/pmem0 rw init=/usr/sbin/cartesi-init"}; ///< Bootargs to pass
///< to kernel
"quiet earlycon=sbi console=hvc0 root=/dev/pmem0 rw init=/usr/sbin/cartesi-init"}; ///< Bootargs to pass
///< to kernel
std::string init{}; ///< Initialization commands to be executed as root on boot
std::string entrypoint{}; ///< Commands to execute the main application
std::string image_filename{}; ///< DTB image file
Expand Down
3 changes: 3 additions & 0 deletions src/riscv-constants.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,9 @@

namespace cartesi {

// Sv57 is explicitly disabled because it doesn't work with some userspace JITs (nodejs)
#define NO_SATP_MODE_SV57 // NOLINT(cppcoreguidelines-macro-usage)

/// \brief Global RISC-V constants
enum RISCV_constants {
XLEN = 64, ///< Maximum XLEN
Expand Down
2 changes: 2 additions & 0 deletions src/translate-virtual-address.h
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,9 @@ static NO_INLINE bool translate_virtual_address(STATE_ACCESS &a, uint64_t *ppadd
return true;
case SATP_MODE_SV39: // Sv39: Page-based 39-bit virtual addressing
case SATP_MODE_SV48: // Sv48: Page-based 48-bit virtual addressing
#ifndef NO_SATP_MODE_SV57
case SATP_MODE_SV57: // Sv57: Page-based 57-bit virtual addressing
#endif
break;
default: // Unsupported mode
return false;
Expand Down

0 comments on commit 4a3040d

Please sign in to comment.