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

xtensa: remove unnecessary padding in arch_mem_domain #71896

Closed
ldmstm opened this issue Apr 24, 2024 · 1 comment · Fixed by #80886 or #81097
Closed

xtensa: remove unnecessary padding in arch_mem_domain #71896

ldmstm opened this issue Apr 24, 2024 · 1 comment · Fixed by #80886 or #81097
Assignees
Labels
area: Xtensa Xtensa Architecture bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug

Comments

@ldmstm
Copy link

ldmstm commented Apr 24, 2024

Is your enhancement proposal related to a problem? Please describe.
The current definition of arch_mem_domain for the xtensa architecture (

uint32_t *ptables __aligned(CONFIG_MMU_PAGE_SIZE);
) forcefully aligns one of its members to a page boundary, adding unnecessary padding.

I suspect the intention behind this alignment is to indicate the pointer points to an MMU page-size aligned address, but instead it aligns the pointer storage itself.

Describe the solution you'd like
The __aligned directive needs to be removed.

@ldmstm ldmstm added the Enhancement Changes/Updates/Additions to existing features label Apr 24, 2024
@henrikbrixandersen henrikbrixandersen added the area: Xtensa Xtensa Architecture label Nov 4, 2024
dcpleung added a commit to dcpleung/zephyr that referenced this issue Nov 4, 2024
The ptables field in arch_mem_domain for Xtensa has excessive
padding as it is incorrectly marked with needing page size
alignment. This is simply a pointer and not the actual page
table so there is no need for that alignment. So remove it.

Fixes zephyrproject-rtos#71896

Signed-off-by: Daniel Leung <[email protected]>
zephyrbot pushed a commit that referenced this issue Nov 7, 2024
The ptables field in arch_mem_domain for Xtensa has excessive
padding as it is incorrectly marked with needing page size
alignment. This is simply a pointer and not the actual page
table so there is no need for that alignment. So remove it.

Fixes #71896

Signed-off-by: Daniel Leung <[email protected]>
(cherry picked from commit eb9fc64)
@dcpleung
Copy link
Member

dcpleung commented Nov 7, 2024

Reopening this for backporting to v3.7

@dcpleung dcpleung reopened this Nov 7, 2024
@nashif nashif added bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug and removed Enhancement Changes/Updates/Additions to existing features labels Nov 11, 2024
nashif pushed a commit that referenced this issue Nov 14, 2024
The ptables field in arch_mem_domain for Xtensa has excessive
padding as it is incorrectly marked with needing page size
alignment. This is simply a pointer and not the actual page
table so there is no need for that alignment. So remove it.

Fixes #71896

Signed-off-by: Daniel Leung <[email protected]>
(cherry picked from commit eb9fc64)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: Xtensa Xtensa Architecture bug The issue is a bug, or the PR is fixing a bug priority: low Low impact/importance bug
Projects
None yet
4 participants