Skip to content

use circular ring for IPI messages#293

Open
giacomogroppi wants to merge 6 commits into
bao-project:mainfrom
giacomogroppi:static-mem-ipi-msg
Open

use circular ring for IPI messages#293
giacomogroppi wants to merge 6 commits into
bao-project:mainfrom
giacomogroppi:static-mem-ipi-msg

Conversation

@giacomogroppi

Copy link
Copy Markdown

Static allocation of messages via a circular queue still allows message delivery in FIFO order and reduces latency, since it does not use dynamic memory.

To enable this functionality, you need to set the IPI_STATIC_MEM define

@josecm

josecm commented Dec 18, 2025

Copy link
Copy Markdown
Member

Hello @giacomogroppi, thanks for this PR! I will be reviewing it in the coming weeks. We have been thinking about refactoring this code for a while, so the first thing I am thinking is to fully replacing the list-based message implementation with your circular queue, rather than keeping it as a compile-time option. That said, we need to weigh the pros and cons carefully before making a decision.

@giacomogroppi

Copy link
Copy Markdown
Author

I modified the implementation by removing the version that uses the list. As for the pros and cons of this implementation, I’ve just finished my master’s thesis and I only have an RPi 3B+ available; if there’s anything I can do to help you, let me know!

@DavidMCerdeira

Copy link
Copy Markdown
Member

Greetings @giacomogroppi

Taking a closer look at this, I'm getting a few errors when trying to compile for qemu-aarch64-virt using Arm GNU Toolchain 14.2.Rel1.

Please let me know your setup for successful compilation.
Additionally I'd appreciate if you could rebase this with Bao's main branch.

Thanks!

@giacomogroppi

giacomogroppi commented Mar 15, 2026

Copy link
Copy Markdown
Author

I build it using

export CROSS_COMPILE=aarch64-none-elf-
make PLATFORM=qemu-aarch64-virt DEMO=baremetal run

Right now I'm using aarch64-none-elf-gcc (Arm GNU Toolchain 14.3.Rel1)

Can I ask what setup you're using?

@DavidMCerdeira

Copy link
Copy Markdown
Member

My setup is based on the bao-demos, and I'm using Arm GNU Toolchain 14.2.Rel1 (Build arm-14.52) which is the toolchain version we recommend using in the bao-demos repo

If you can rebase this with main I believe I can run the CI build tests on this PR

@giacomogroppi

Copy link
Copy Markdown
Author

There you go. Sorry to keep you waiting.

@DavidMCerdeira

Copy link
Copy Markdown
Member

Greetings @giacomogroppi!

Thank you for the update, but the build is still failing and unfortunately we don't have the bandwidth to dig into this right now.
We'd welcome a fix from your side if you manage to track it down. Happy to review whenever you're ready.

@giacomogroppi

Copy link
Copy Markdown
Author

Hi, I think I've managed to fix the build. I'm not too keen on having to pass a pointer to the macro just to check whether the operation was successful or not, so if you have any other ideas, let me know.

@DavidMCerdeira

Copy link
Copy Markdown
Member

Looks like the builds are fixed! Great!

I'm not too keen on having to pass a pointer to the macro just to check whether the operation was successful or not, so if you have any other ideas, let me know.

Instead of macros it's better to use static inline functions, this way we can easily check the return value.

@giacomogroppi

Copy link
Copy Markdown
Author

ok, i'll update the code in the next days, thank you

@giacomogroppi

Copy link
Copy Markdown
Author

Hi! I've made the changes we discussed by converting some macros into static functions. I look forward to hearing back from you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants