Coder Social home page Coder Social logo

Comments (3)

mateoconlechuga avatar mateoconlechuga commented on August 17, 2024

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.

avpatel avatar avpatel commented on August 17, 2024

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.

mateoconlechuga avatar mateoconlechuga commented on August 17, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.