admin管理员组文章数量:1389750
So in risc-v, for a virtual memory system, I imagine it's up to the kernel to decide if 0 is a valid memory address or not? But for machine mode, or supervisor mode, is memory address 0 valid to access?
By extent, should I check if the pointer to the device tree provided to the kernel is NULL?
So in risc-v, for a virtual memory system, I imagine it's up to the kernel to decide if 0 is a valid memory address or not? But for machine mode, or supervisor mode, is memory address 0 valid to access?
By extent, should I check if the pointer to the device tree provided to the kernel is NULL?
Share Improve this question asked Mar 15 at 17:05 CocytusDEDICocytusDEDI 3001 silver badge10 bronze badges 6 | Show 1 more comment1 Answer
Reset to default 1By extent, should I check if the pointer to the device tree provided to the kernel is NULL?
I don't think the RISC-V specification per se specifies which addresses might be valid to access when the kernel boots. This information must be hardcoded into the kernel, or detected by probing the hardware or BIOS somehow, or provided by the device tree itself. In that last case it is impossible to sanitize the device tree address, so don't. In the other cases I don't think it's worth the effort; I would simply allow whatever happens when you access invalid memory to happen.
本文标签: pointersDoes riscv require memory address 0 to be invalidStack Overflow
版权声明:本文标题:pointers - Does risc-v require memory address 0 to be invalid? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744607863a2615467.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
read
andstat
). But I could easily imagine it being optional on RISC-V. – Peter Cordes Commented Mar 17 at 17:11