Hacker News new | ask | show | jobs
by pm215 1186 days ago
On the other hand, it sounds from the thread like the result of the deviation from the spec is "you can't run userspace binaries unless you built them with a binutils that's working around this", so it's not just a "weirdness the kernel has to deal with" kind of thing.
1 comments

If everyone is understanding it correctly then that appears to be the case. Apparently user-space addresses from 0x20000 to 0x3ffff are not mapped by the MMU in the expected way, but are directly mapped to the same SRAM for every program.

A statically linked "HelloWorld" on my VisionFive 2 starts from 0x10000 and runs up to 0x4ea8e, so smack through that whole memory region.

The only way to make programs compiled with a standard binutils (or on another RISC-V machine, or a standard OS running in a VM) work would be for the kernel to memcpy() that 128k region in and out on every address space switch.

It's really an awful bug (or design decision) if you want to run standard OSes and standard code on it.