Skip to content

Commit 61ec0d1

Browse files
dcpleungnashif
authored andcommitted
xtensa: mmu: arch_buffer_validate is only for user thread
arch_buffer_validate() is only to verify that user threads have access to the memory region. It should not be used to verify if kernel thread has access (which they should anyway). So change the logic. Signed-off-by: Daniel Leung <[email protected]>
1 parent 27f4e7f commit 61ec0d1

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

arch/xtensa/core/ptables.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1083,8 +1083,7 @@ int arch_buffer_validate(const void *addr, size_t size, int write)
10831083
size_t aligned_size;
10841084
const struct k_thread *thread = _current;
10851085
uint32_t *ptables = thread_page_tables_get(thread);
1086-
uint8_t ring = ((thread->base.user_options & K_USER) != 0) ?
1087-
XTENSA_MMU_USER_RING : XTENSA_MMU_KERNEL_RING;
1086+
uint8_t ring = XTENSA_MMU_USER_RING;
10881087

10891088
/* addr/size arbitrary, fix this up into an aligned region */
10901089
k_mem_region_align((uintptr_t *)&virt, &aligned_size,

0 commit comments

Comments
 (0)