Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mempool region could be allocated across memory regions #49

Open
bremoran opened this issue Jan 27, 2016 · 3 comments
Open

mempool region could be allocated across memory regions #49

bremoran opened this issue Jan 27, 2016 · 3 comments
Labels

Comments

@bremoran
Copy link
Contributor

On MCUs with continuous memory addresses that span multiple memory regions, it's possible to allocate the mempool region across memory regions. While this is typically not a problem, it could become a very subtle bug.

If the following conditions are met, there will be a hard-fault:

  • The mempool region is allocated across a two RAM regions
  • The two RAM regions are on different AMBA busses
  • Code attempts an unaligned access in the mempool, and it falls across the regions

This could prove very difficult to locate and could be circumvented by explicitly allocating a mempool region in a memory region large enough to contain it.

This is a larger problem with spanning regions, but it's easily solvable in this case.

cc @sg- @bogdanm

@bremoran
Copy link
Contributor Author

This issue relates to #30

@ciarmcom
Copy link
Member

ARM Internal Ref: IOTSFW-1917

@ghost
Copy link

ghost commented Feb 8, 2016

A toolchain/compiler generating code to target an aarch32 architecture that supports unaligned access is free to exploit that feature. The various multilib'd string and memory functions provided by newlib for aarch32 are generally designed to exploit unaligned access support in the target architecture, hence even if -mno-unaligned-access is passed to gcc when targeting an architecture version that would otherwise support unaligned access, the standard libraries pulled in during the link are free to exploit unaligned access. Therefore the allocation of an object spanning multiple memory regions is a bug.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants