Comments (3)
Personally I feel that the firmware linker script should have sections for the stack, heap, and scratch whose sizes are controlled through menuconfig for the platform. What are the thoughts on this? Doing this would mean these checks removed since it's all controlled through link time.
Currently the way it is implemented it is difficult if not impossible to determine what memory OpenSBI is actually using since it is just expecting memory to exist beyond the end of the program. This seems... unsafe?
from opensbi.
All three per-CPU stack, per-CPU scratch, and system wide heap are scaled at boot time based on the number of CPUs. This allows us to use the same FW binary on multiple platforms. We can further improve this by allowing platforms to override heap size using a DT property but this is not available yet.
from opensbi.
This allows us to use the same FW binary on multiple platforms
The same firmware binary doesn't work on multiple platforms though since the platform is responsible for allocating the heap size based on the expected number of CPUs (like the template here just shows a magic "1" value here representing 1 hart: https://github.com/riscv-software-src/opensbi/blob/master/platform/template/platform.c#L155).
The number of CPUs and the per-hart stack size could be passed to the linker script - right now the developer of the platform has to know the number of CPUs anyway since it's a platform-specific define at compile time here and here.
from opensbi.
Related Issues (20)
- [help] how to build test payload for non-qemu target HOT 2
- opensbi testing HOT 2
- 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)
- 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
- error: "__always_inline" redefined [-Werror]
- Why ld is leaving a hole in memory?
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.