Skip to content

Commit 758d057

Browse files
authored
Merge pull request #5 from gowthamsiddarthd/main
RME DA Issue vB.a ACS EAC Release
2 parents ef68f9d + 86bcbb3 commit 758d057

135 files changed

Lines changed: 7736 additions & 1892 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

CMakeLists.txt

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
## @file
2+
# Copyright (c) 2025, Arm Limited or its affiliates. All rights reserved.
3+
# SPDX-License-Identifier : Apache-2.0
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
##
17+
18+
# Set the minimum required version of CMake for the project
19+
cmake_minimum_required(VERSION 3.17)
20+
project(rme-acs LANGUAGES)
21+
22+
# Tool dependency check
23+
get_filename_component(ROOT_DIR . ABSOLUTE)
24+
set(VAL_DIR "${ROOT_DIR}/val/" CACHE INTERNAL "Setting VAL directory to ${VAL_DIR}" FORCE)
25+
set(PAL_DIR "${ROOT_DIR}/platform/pal_baremetal/" CACHE INTERNAL "Setting PAL directory to ${PAL_DIR}" FORCE)
26+
set(TEST_DIR "${ROOT_DIR}/test_pool/" CACHE INTERNAL "Setting TEST directory to ${TEST_DIR}" FORCE)
27+
28+
# Set internal build directory variable
29+
set(BUILD ${CMAKE_CURRENT_BINARY_DIR} CACHE INTERNAL "Setting build directory to ${BUILD}" FORCE)
30+
file(MAKE_DIRECTORY ${BUILD}/output/)
31+
32+
# Set global compile list variable
33+
set(COMPILE_LIST "")
34+
35+
# Include cmake support module
36+
include(${ROOT_DIR}/tools/cmake/toolchain/default.cmake)
37+
include(${ROOT_DIR}/tools/cmake/toolchain/utils.cmake)
38+
39+
# Valid value range for command line argument
40+
list(APPEND ARM_ARCH_MAJOR_LIST 8 9)
41+
42+
# Check for valid targets
43+
_get_sub_dir_list(TARGET_LIST ${ROOT_DIR}/platform/pal_baremetal/)
44+
if(NOT DEFINED TARGET)
45+
set(TARGET ${TARGET_DFLT} CACHE INTERNAL "Defaulting target to ${TARGET}" FORCE)
46+
else()
47+
set(TARGET ${TARGET} CACHE INTERNAL "TARGET is set to ${TARGET}" FORCE)
48+
endif()
49+
50+
if(NOT ${TARGET} IN_LIST TARGET_LIST)
51+
message(FATAL_ERROR "[ACS] : Error: Unspported value for -DTARGET=, supported targets are : ${TARGET_LIST}")
52+
else()
53+
message(STATUS "[ACS] : TARGET is set to ${TARGET}")
54+
endif()
55+
56+
# Check for ARM_ARCH_MAJOR
57+
if(NOT DEFINED ARM_ARCH_MAJOR)
58+
set(ARM_ARCH_MAJOR "${ARM_ARCH_MAJOR_DFLT}" CACHE INTERNAL "Default ARM_ARCH_MAJOR value" FORCE)
59+
message(STATUS "[ACS] : Defaulting ARM_ARCH_MAJOR to ${ARM_ARCH_MAJOR}")
60+
else()
61+
if(NOT ${ARM_ARCH_MAJOR} IN_LIST ARM_ARCH_MAJOR_LIST)
62+
message(FATAL_ERROR "[ACS] : Error: Unspported value for -DARM_ARCH_MAJOR=, supported values are : ${ARM_ARCH_MAJOR_LIST}")
63+
endif()
64+
message(STATUS "[ACS] : ARM_ARCH_MAJOR is set to ${ARM_ARCH_MAJOR}")
65+
endif()
66+
67+
# Check for ARM_ARCH_MINOR
68+
if(NOT DEFINED ARM_ARCH_MINOR)
69+
set(ARM_ARCH_MINOR "${ARM_ARCH_MINOR_DFLT}" CACHE INTERNAL "Default ARM_ARCH_MINOR value" FORCE)
70+
message(STATUS "[ACS] : Defaulting ARM_ARCH_MINOR to ${ARM_ARCH_MINOR}")
71+
else()
72+
message(STATUS "[ACS] : ARM_ARCH_MINOR is set to ${ARM_ARCH_MINOR}")
73+
endif()
74+
75+
# Setup toolchain parameters for compilation and link
76+
include(${ROOT_DIR}/tools/cmake/toolchain/common.cmake)
77+
78+
# CMake clean target
79+
list(APPEND CLEAN_LIST
80+
${CMAKE_CURRENT_BINARY_DIR}/${OUTPUT_HEADER}
81+
${CMAKE_CURRENT_BINARY_DIR}/output
82+
)
83+
84+
# Include the files for make clean
85+
foreach(clean_item ${CLEAN_LIST})
86+
set_property(DIRECTORY APPEND PROPERTY ADDITIONAL_MAKE_CLEAN_FILES ${clean_item})
87+
endforeach()
88+
89+
add_subdirectory(${ROOT_DIR}/tools/cmake/rme)
Binary file not shown.
Binary file not shown.

Docs/Arm_RME_System_Architecture_Compliance_Suite_Testcase_Checklist.rst

Lines changed: 122 additions & 109 deletions
Large diffs are not rendered by default.
159 Bytes
Binary file not shown.
Binary file not shown.

README.md

Lines changed: 7 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ This suite includes a set of examples of the invariant behaviors that are provid
1919
Most of the tests are executed from UEFI Shell by executing the RME UEFI shell application.
2020

2121
## Release details
22-
- Code Quality: Beta
22+
- Code Quality: EAC
2323
- The tests are written for version B.a of the Arm Realm Management Extension (RME) System Architecture.
2424
- The compliance suite is not a substitute for design verification.
2525

@@ -77,38 +77,6 @@ To start the ACS build, perform the following steps:
7777
- Add RmeValLib|ShellPkg/Application/rme-acs/val/RmeValLib.inf
7878
- Add RmePalLib|ShellPkg/Application/rme-acs/platform/pal_uefi/RmePalLib.inf
7979
- Add ShellPkg/Application/rme-acs/uefi_app/RmeAcs.inf in the [components] section of ShellPkg/ShellPkg.dsc <br>
80-
If Baremetal platform, checkout to ACS tag v23.12_REL1.0 then add the following to [LibraryClasses.common] section in ShellPkg/ShellPkg.dsc
81-
- Add RmeValLib|ShellPkg/Application/rme-acs/val/RmeValLib.inf
82-
- Add RmePalBaremetalLib|ShellPkg/Application/rme-acs/platform/pal_baremetal/RmePalBaremetalLib.inf
83-
- Add RmePalFVPLib|ShellPkg/Application/rme-acs/platform/pal_baremetal/FVP/RmePalFVPLib.inf
84-
- Modify CC Flags in the [BuildOptions] section of ShellPkg/ShellPkg.dsc
85-
```
86-
*_*_*_CC_FLAGS = -DENABLE_OOB
87-
88-
!include StdLib/StdLib.inc
89-
```
90-
- Modify the following in the edk2-libc/StdLib/LibC/Main/Main.c
91-
```
92-
-extern int main( int, char**);
93-
+extern int ShellAppMainrme( int, char**);
94-
```
95-
- Modify the following in ShellAppMain() of edk2-libc/StdLib/LibC/Main/Main.c
96-
```
97-
-ExitVal = (INTN)main( (int)Argc, gMD->NArgV);
98-
+ExitVal = (INTN)ShellAppMainrme( (int)Argc, gMD->NArgV);
99-
```
100-
- Comment the map[] variable in edk2-libc/StdLib/LibC/Main/Arm/flt_rounds.c to avoid -werror=unused-variable
101-
```
102-
+#if 0
103-
static const int map[] = {
104-
1, /* round to nearest */
105-
2, /* round to positive infinity */
106-
3, /* round to negative infinity */
107-
0 /* round to zero */
108-
};
109-
+#endif
110-
```
111-
- Add ShellPkg/Application/rme-acs/baremetal_app/RmeAcs.inf in the [components] section of ShellPkg/ShellPkg.dsc
11280

11381
### Linux build environment
11482
If the build environment is Linux, perform the following steps:
@@ -193,10 +161,12 @@ Below tests are not qualified in model. These are expected to pass in any valid
193161
- test_pool/legacy_system/test_ls002.c - Require Legacy TZ Support.
194162
- test_pool/legacy_system/test_ls003.c - Require Legacy TZ Support.
195163
- test_pool/legacy_system/test_ls004.c - Require Legacy TZ Support.
196-
- test_pool/rme/test_rme029.c - Reference Validation Platform Issue.
164+
- test_pool/rme/test_rme029.c - Model Issue.
197165
- test_pool/rme/test_rme022.c - Require NS encryption to be programmable.
198-
- test_pool/rme/test_rme015.c - Reference Validation Platform limitation.
199-
- test_pool/da/test_da008.c - Reference Validation Platform Issue.
166+
- test_pool/gic/test_g001.c - Model issue.
167+
- test_pool/rme/test_rme015.c - Model limitation.
168+
- test_pool/da/test_da019.c - ImpDef RP write-protect and full-protect registers not present in Model.
169+
- test_pool/da/test_da020.c - ImpDef interconnect registers not present in Model.
200170

201171
## License
202172
RME System ACS is distributed under Apache v2.0 License.
@@ -208,4 +178,4 @@ RME System ACS is distributed under Apache v2.0 License.
208178

209179
--------------
210180

211-
*Copyright (c) 2022-2024, Arm Limited and Contributors. All rights reserved.*
181+
*Copyright (c) 2022-2025, Arm Limited and Contributors. All rights reserved.*

baremetal_app/RmeAcs.h

Lines changed: 41 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file
2-
* Copyright (c) 2022-2024, Arm Limited or its affiliates. All rights reserved.
2+
* Copyright (c) 2022-2025, Arm Limited or its affiliates. All rights reserved.
33
* SPDX-License-Identifier : Apache-2.0
44
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -18,14 +18,49 @@
1818
#ifndef __RME_ACS_LEVEL_H__
1919
#define __RME_ACS_LEVEL_H__
2020

21-
#define SIZE_4K 0x100
21+
#include "platform_image_def.h"
22+
#include "platform_override_fvp.h"
2223

23-
#define RME_MIN_LEVEL_SUPPORTED 3
24-
#define RME_MAX_LEVEL_SUPPORTED 6
24+
#define SIZE_4K 0x1000
2525

26-
#ifdef _AARCH64_BUILD_
26+
#define RME_ACS_MAJOR_VER 1
27+
#define RME_ACS_MINOR_VER 0
28+
29+
#define RME_MIN_LEVEL_SUPPORTED 3
30+
#define RME_MAX_LEVEL_SUPPORTED 6
31+
32+
#define INVALID_MPIDR 0xffffffff
33+
#define STACK_SIZE 0x1000
34+
35+
#define PAGE_SIZE_4K 0x1000
36+
#define PAGE_SIZE_16K (4 * 0x1000)
37+
#define PAGE_SIZE_64K (16 * 0x1000)
38+
39+
#define PLATFORM_CPU_COUNT PLATFORM_OVERRIDE_PE_CNT
40+
41+
#if (PLATFORM_PAGE_SIZE == PAGE_SIZE_4K)
42+
#define PAGE_SIZE PAGE_SIZE_4K
43+
#elif (PLATFORM_PAGE_SIZE == PAGE_SIZE_16K)
44+
#define PAGE_SIZE PAGE_SIZE_16K
45+
#elif (PLATFORM_PAGE_SIZE == PAGE_SIZE_64K)
46+
#define PAGE_SIZE PAGE_SIZE_64K
47+
#endif
48+
49+
/*******************************************************************************
50+
* Used to align variables on the biggest cache line size in the platform.
51+
* This is known only to the platform as it might have a combination of
52+
* integrated and external caches.
53+
******************************************************************************/
54+
#define CACHE_WRITEBACK_SHIFT 6
55+
#define CACHE_WRITEBACK_GRANULE (1 << CACHE_WRITEBACK_SHIFT)
56+
57+
#ifdef _AARCH64_BUILD_
2758
unsigned long __stack_chk_guard = 0xBAAAAAAD;
2859
unsigned long __stack_chk_fail = 0xBAAFAAAD;
29-
#endif
60+
#endif
61+
62+
#define SCTLR_I_BIT (1 << 12)
63+
#define SCTLR_M_BIT (1 << 0)
64+
#define DISABLE_MMU_BIT (0xFFFFFFFFFFFFFFFE)
3065

3166
#endif

baremetal_app/RmeAcsMain.c

Lines changed: 29 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/** @file
2-
* Copyright (c) 2022-2024, Arm Limited or its affiliates. All rights reserved.
2+
* Copyright (c) 2022-2025, Arm Limited or its affiliates. All rights reserved.
33
* SPDX-License-Identifier : Apache-2.0
44
55
* Licensed under the Apache License, Version 2.0 (the "License");
@@ -19,12 +19,10 @@
1919
#include "val/include/rme_acs_pe.h"
2020
#include "val/include/rme_acs_val.h"
2121
#include "val/include/rme_acs_memory.h"
22-
#include "platform/pal_baremetal/FVP/include/platform_override_fvp.h"
2322
#include "RmeAcs.h"
2423

2524
uint32_t g_enable_pcie_tests;
2625
uint32_t g_print_level;
27-
uint32_t g_execute_nist;
2826
uint32_t g_print_mmio;
2927
uint32_t g_curr_module;
3028
uint32_t g_enable_module;
@@ -34,10 +32,10 @@ uint32_t g_rme_tests_fail;
3432
uint64_t g_stack_pointer;
3533
uint64_t g_exception_ret_addr;
3634
uint64_t g_ret_addr;
37-
uint32_t g_skip_test_num[MAX_TEST_SKIP_NUM] = {10000, 10000, 10000, 10000, 10000,
38-
10000, 10000, 10000, 10000, 10000};
39-
uint32_t g_single_test = SINGLE_TEST_SENTINEL;
40-
uint32_t g_single_module = SINGLE_MODULE_SENTINEL;
35+
36+
extern uint32_t g_skip_test_num[];
37+
extern uint32_t g_single_test;
38+
extern uint32_t g_single_module;
4139

4240
uint32_t
4341
createPeInfoTable(
@@ -102,12 +100,18 @@ createPcieVirtInfoTable(
102100
{
103101
uint64_t *PcieInfoTable;
104102
uint64_t *IoVirtInfoTable;
103+
uint64_t *RegisterInfoTable;
105104

106105
PcieInfoTable = val_aligned_alloc(SIZE_4K, sizeof(PCIE_INFO_TABLE)
107106
+ (PLATFORM_OVERRIDE_NUM_ECAM * sizeof(PCIE_INFO_BLOCK)));
108107

109108
val_pcie_create_info_table(PcieInfoTable);
110109

110+
RegisterInfoTable = val_aligned_alloc(SIZE_4K, sizeof(REGISTER_INFO_TABLE)
111+
+ (PLATFORM_OVERRIDE_RP_REG_NUM_ENTRIES * sizeof(REGISTER_INFO_TABLE)));
112+
113+
val_register_create_info_table(RegisterInfoTable);
114+
111115
IoVirtInfoTable = val_aligned_alloc(SIZE_4K, sizeof(IOVIRT_INFO_TABLE)
112116
+ ((NUM_ITS_COUNT + IOVIRT_SMMUV3_COUNT + IOVIRT_RC_COUNT
113117
+ IOVIRT_SMMUV2_COUNT + IOVIRT_NAMED_COMPONENT_COUNT + IOVIRT_PMCG_COUNT)
@@ -168,8 +172,16 @@ ShellAppMainrme(
168172
g_print_level = ACS_PRINT_ERR;
169173
}
170174

175+
#ifdef TARGET_BM_BOOT
176+
/* Write page tables */
177+
if (val_setup_mmu())
178+
return ACS_STATUS_FAIL;
179+
180+
/* Enable Stage-1 MMU */
181+
if (val_enable_mmu())
182+
return ACS_STATUS_FAIL;
183+
#endif
171184

172-
g_execute_nist = FALSE;
173185
g_print_mmio = FALSE;
174186
g_enable_pcie_tests = 1;
175187

@@ -181,7 +193,7 @@ ShellAppMainrme(
181193
g_rme_tests_fail = 0;
182194

183195
val_print(g_print_level, "\n\n RME Architecture Compliance Suite \n", 0);
184-
val_print(g_print_level, " Version: Issue B.a ACS BETA \n", 0);
196+
val_print(g_print_level, " Version: Issue B.a ACS EAC \n", 0);
185197

186198
val_print(g_print_level, " (Print level is %2d)\n\n", g_print_level);
187199

@@ -212,6 +224,11 @@ ShellAppMainrme(
212224
*/
213225
configureGicIts();
214226

227+
/* Configure SMMUs, PCIe and Exerciser tables required for the ACS */
228+
Status = val_configure_acs();
229+
if (Status)
230+
return Status;
231+
215232
val_print(ACS_PRINT_TEST, "\n *** Starting RME tests *** \n", 0);
216233
Status |= val_rme_execute_tests(val_pe_get_num());
217234

@@ -224,6 +241,8 @@ ShellAppMainrme(
224241
val_print(ACS_PRINT_TEST, "\n *** Starting IO Virtualization tests *** \n", 0);
225242
Status |= val_smmu_execute_tests(val_pe_get_num());
226243

244+
val_print(ACS_PRINT_TEST, "\n *** Starting RME DA tests *** \n", 0);
245+
Status = val_rme_da_execute_tests(val_pe_get_num());
227246

228247
print_test_status:
229248
val_print(ACS_PRINT_TEST, "\n ------------------------------------------------------- \n", 0);
@@ -237,6 +256,7 @@ ShellAppMainrme(
237256
val_print(g_print_level, "\n *** RME tests complete. Reset the system. *** \n\n", 0);
238257

239258
val_pe_context_restore(AA64WriteSp(g_stack_pointer));
259+
while (1);
240260

241261
return 0;
242262
}

changelog.txt

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,13 @@
1+
vB.a_EAC_25.01
2+
3+
Baremetal Boot Framework:
4+
* Introduced a Baremetal Boot Framework that eliminates the requirement for UEFI in running the RME ACS suite.
5+
* This new framework simplifies deployment in environments where UEFI support is unavailable or not preferred.
6+
* Added comprehensive instructions on setting up and using the Baremetal Boot Framework.
7+
Test Updates:
8+
* Expanded test coverage incorporating the feedback received, adding new tests for the rules.
9+
10+
111
vB.a_BETA_24.12
212

313
Release Highlights:

0 commit comments

Comments
 (0)