Commit 61ec0d15 authored by Daniel Leung's avatar Daniel Leung Committed by Anas Nashif
Browse files

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: default avatarDaniel Leung <daniel.leung@intel.com>
parent 27f4e7fe
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -1083,8 +1083,7 @@ int arch_buffer_validate(const void *addr, size_t size, int write)
	size_t aligned_size;
	const struct k_thread *thread = _current;
	uint32_t *ptables = thread_page_tables_get(thread);
	uint8_t ring = ((thread->base.user_options & K_USER) != 0) ?
		XTENSA_MMU_USER_RING : XTENSA_MMU_KERNEL_RING;
	uint8_t ring = XTENSA_MMU_USER_RING;

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