-
Notifications
You must be signed in to change notification settings - Fork 12
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
Handle Load/StoreMisalignment Exception in RustSBI manually on k210 platform #6
Comments
It's not hard to implement in SBI. Maybe we should encourage software to allocate aligned memory, when we need to provide these structures to data process crates like file formats. The ELF format is well defined with aligned access, and for other formats we should be careful as well. |
我改变了我的想法。我觉得做这个是比较必要的,允许不同平台上的非对齐访问,如果产生这种情况,最多性能上承受模拟带来的损失,正确性保证它对。 |
我在基于RustSBI做的另一个平台(核心是Rocket)的启动器里面,实现了对非对齐访存的模拟,可供参考。适配RV64IC,有一些硬编码,没有支持浮点扩展和32位架构。 |
@Gallium70 非常好,可以作为非对齐访问模拟的一种实现。 |
Hello! As this issue is related to K210 platform, for further discussions we raise issue on rustsbi-k210 repository. |
Due to the hardware limit of Kendryte k210 chip(it is okay on qemu), when we want to load a 64-bit value in to a general-purpose register(using
ld
instruction), we have to guarantee that the address is aligned to 8 bytes. However, it is somehow strict so that many librarys do not consider it, leading to some incompatibility(e.g.xmas-elf
crate). The same issue may occurs in other instructions, such aslh
/lw
/sh
/sw
/sd
, but I have not try them yet.Should we handle them in RustSBI by performing some aligned memory access manually and then merging the results?
The text was updated successfully, but these errors were encountered: