test: Add arm64_high_addresses test

Latel we have had several failures and regressions due to the setting of
CONFIG_SRAM_BASE_ADDRESS to really high values (over the 4GB boundary).
To try to catch these problems as early as possible we add a build-only
test based on the hello_world_user sample that tries to compile the test
using a combination of CONFIG_SRAM_BASE_ADDRESS and
CONFIG_KERNEL_VM_BASE set to high values in memory.

Signed-off-by: Carlo Caione <ccaione@baylibre.com>
This commit is contained in:
Carlo Caione 2021-03-23 16:17:08 +01:00 committed by Anas Nashif
commit 0f3d2d9230
4 changed files with 64 additions and 0 deletions

View file

@ -0,0 +1,8 @@
# SPDX-License-Identifier: Apache-2.0
cmake_minimum_required(VERSION 3.20.0)
find_package(Zephyr REQUIRED HINTS $ENV{ZEPHYR_BASE})
project(arm64_high_addresses)
target_sources(app PRIVATE src/main.c)

View file

@ -0,0 +1,6 @@
CONFIG_USERSPACE=y
CONFIG_APPLICATION_DEFINED_SYSCALL=y
CONFIG_ASSERT=y
CONFIG_LOG=y
CONFIG_LOG_MODE_MINIMAL=y
CONFIG_MAIN_STACK_SIZE=2560

View file

@ -0,0 +1,25 @@
/*
* Copyright (c) 2020 BayLibre, SAS
*
* SPDX-License-Identifier: Apache-2.0
*/
#include <zephyr.h>
#include <stdio.h>
#define USER_STACKSIZE 2048
struct k_thread user_thread;
K_THREAD_STACK_DEFINE(user_stack, USER_STACKSIZE);
static void user_function(void *p1, void *p2, void *p3)
{
printf("Hello World from UserSpace! %s\n", CONFIG_BOARD);
}
void main(void)
{
k_thread_create(&user_thread, user_stack, USER_STACKSIZE,
user_function, NULL, NULL, NULL,
-1, K_USER, K_MSEC(0));
}

View file

@ -0,0 +1,25 @@
common:
arch_allow: arm64
tags: arm userspace
build_only: true
tests:
arch.arm64.high_addr.high_sram_low_vm:
extra_configs:
- CONFIG_SRAM_BASE_ADDRESS=0x200880000
- CONFIG_KERNEL_VM_BASE=0x00400000
arch.arm64.high_addr.low_sram_high_vm:
extra_configs:
- CONFIG_SRAM_BASE_ADDRESS=0x00400000
- CONFIG_KERNEL_VM_BASE=0x200880000
arch.arm64.high_addr.high_sram_equal_vm:
extra_configs:
- CONFIG_SRAM_BASE_ADDRESS=0x200880000
- CONFIG_KERNEL_VM_BASE=0x200880000
arch.arm64.high_addr.high_sram_high_vm:
extra_configs:
- CONFIG_SRAM_BASE_ADDRESS=0x200880000
- CONFIG_KERNEL_VM_BASE=0x200800000