Comments (9)
Why not use another argument register to pass a pointer to a list with free/usable memory regions? That would be the simplest solution.
from opensbi.
Yes, we are aware of the need to update reserved memory details in DTB.
Many thanks for bringing up this topic.
We are mostly booting Linux as S-mode OS so we never noticed this issue because we boot Linux from next 2MB aligned address after RAM start at 0x80200000 and Linux OF automatically reserves memory range from RAM start to Linux boot address (i.e. 0x80000000 to 0x80200000). Due to this, we kept ignoring this issue.
Of course, we should consider any possible S-Mode client and we should reserve 128KB of memory from RAM start (i.e. memory typically used by OpenSBI firmware) using reserved memory DT binding.
from opensbi.
This would mean we edit device tree for all the platforms. The approach would be to provide additional SBI calls to provide PMP protected address, which is not super nice either.
This should be a common scenario for any other ISA as well. Do we know how does it work in ARM world ?
I am not entirely opposed to the idea. Just thinking if there is a better way to do it.
from opensbi.
What about providing a standard way of querying memory regions from supervisor mode through an extension? It's required very early during boot, yet a FDT parser is needed in the payload in order to obtain a memory map (which is redundant given that OpenSBI already walks the DT). Doing so would allow the kernel to get reliable information about the memory available on-demand from the firmware, and the firmware could override that information at will.
from opensbi.
I imagine an scenario where changing that information at runtime would be desirable and an extension would give more flexibility, but probably I'm over-engineering. A pointer as an argument is simple and desirable if the info is not going to change though. I think some discussion and careful consideration is needed.
from opensbi.
You don't need a full device tree parser to extract the memory reservation block from a DTB. Getting that information is super simple: there is a header with a field specifying the offset from the start of the DTB to an array of 64-bit address+size pairs listing out the reserved regions of memory. The first entry with size=0 indicates the end of the list. The only complication is that all the values are in big endian but implementing a bswap function isn't that hard.
from opensbi.
It sounded to me like the concern seemed to be mostly about having to touch the FDT in the firmware at all. You could also argue that it'd still kind of annoying to get to that part of the FDT (I know, it's basically just about reading an offset in the FDT header and then jumping to it).
If you parse the FDT much later in the boot process, you'd still need to have 2 pieces of code which read the FDT somehow.
But sure, could be a non-issue.
from opensbi.
Well I think I'm going to create another issue as it seems I've hijacked this one
from opensbi.
I believe we can close this issue because memory reservation in DT is now done by OpenSBI.
from opensbi.
Related Issues (20)
- What is the relationship between Coreboot and Opensbi HOT 2
- ld.bfd: unrecognized option --exclude-libs HOT 2
- fw_start and fw_rw_offset not aligned
- Is there any upper memory bound for initramfs or opensbi or kernel?
- Handling interrupts with multiple privileges on multiple harts in OpenSBI HOT 1
- [help] K210 serial port has no output HOT 1
- build issue - functions do not get linked HOT 1
- System freezes when setting smp value to 54 or higher with qemu-system-riscv64
- Firmware SMP boot bug HOT 2
- sbi_hsm_hart_start_finish: ERR: The hart is in invalid state [2147774600] HOT 1
- firmware base is not the value of FW_TEXT_START( but 0x80000000) HOT 1
- How to get symtab from elf?
- qemu-system-riscv64: -append only allowed with -kernel option HOT 1
- Writing drivers for Timer peripheral
- questions about OpenSBI Version 1.5 HOT 10
- opensbi failed to build HOT 1
- error: "__always_inline" redefined [-Werror]
- Why ld is leaving a hole in memory?
- Why do we need a while loop when processing IMSCI external interrupts? HOT 5
- understanding -PIE HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from opensbi.