-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'origin/master' into release
- Loading branch information
Showing
99 changed files
with
14,802 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,180 @@ | ||
|
||
# Software Delegated Exception Interface - Architecture Compliance Suite | ||
|
||
## Software Delegated Exception Interface | ||
**Software Delegated Exception Interface** (SDEI) Platform Design Document provides a mechanism for registering and servicing system events from system firmware. | ||
|
||
For more information, download the [SDEI Platform Design Document](http://infocenter.arm.com/help/index.jsp?topic=/com.arm.doc.den0054a/index.html). | ||
|
||
## Release details | ||
- Code Quality: Beta v0.6 | ||
- Code Completed: 48 out of 52. | ||
- The tests are written for version 1.0 of the SDEI Platform Design Document. | ||
|
||
## SDEI compliance source | ||
|
||
The SDEI ACS tests compliance as a client to SDEI dispatcher running in EL3 as part of ARM-TF. The client application runs in EL2 (UEFI application) and EL1 (Linux kernel module/userspace application). | ||
|
||
## Downloading SDEI ACS | ||
|
||
SDEI ACS is a sub-directory in arm-enterprise-acs repository. | ||
|
||
$ git clone https://github.com/ARM-software/arm-enterprise-acs.git<br/> | ||
$ cd arm-enterprise-acs/sdei | ||
|
||
## Building SDEI ACS | ||
### UEFI application | ||
#### Prerequisites | ||
|
||
Before starting the ACS build, ensure that the following requirements are met. | ||
|
||
- Any mainstream Linux based OS distribution. | ||
- git clone EDK2 tree. | ||
- Install GCC 6.3 or later toolchain for Linux from [here](https://releases.linaro.org/components/toolchain/binaries). | ||
- Install the build prerequisite packages to build EDK2. The details of the packages are beyond the scope of this document. | ||
|
||
#### Build Steps | ||
<ol> | ||
$ cd /path/to/arm-enterprise-acs/sdei<br/> | ||
$ ./scripts/build_uefi.sh | ||
</ol> | ||
|
||
#### Build Output | ||
|
||
The following output file is created in /path/to/arm-enterprise-acs/sdei/workspace/output/: | ||
|
||
- Sdei.efi | ||
|
||
### Linux kernel module and user space application | ||
#### Build Steps | ||
<ol> | ||
$ cd /path/to/arm-enterprise-acs/sdei<br/> | ||
$ ./scripts/build_linux.sh | ||
</ol> | ||
|
||
#### Build Output | ||
The following output files are created in in /path/to/arm-enterprise-acs/sdei/workspace/output/: | ||
|
||
- sdei_acs.ko | ||
- sdei | ||
- Image | ||
|
||
|
||
## Test suite execution in UEFI | ||
|
||
### Post-Silicon | ||
|
||
On a system where a USB port is available and functional, perform the following steps: | ||
|
||
1. Copy 'Sdei.efi' to a USB Flash drive. | ||
2. Plug in the USB Flash drive to one of the functional USB ports on the system. | ||
3. Boot the system to UEFI shell. | ||
4. To determine the file system number of the plugged in USB drive, execute 'map -r' command. | ||
5. Type 'fsx' where 'x' is replaced by the number determined in step 4. | ||
6. To start the compliance tests, run the executable Sdei.efi with the appropriate arguments. | ||
|
||
### Emulation environment with secondary storage | ||
|
||
On an emulation environment with secondary storage, perform the following steps: | ||
|
||
1. Create an image file which contains the 'Sdei.efi' file. For Example: <br/> | ||
$ mkfs.vfat -C -n HD0 hda.img 31457280 <br/> | ||
$ sudo mount hda.img /mnt/sdei <br/> | ||
$ cd /path/to/arm-enterprise-acs/sdei/workspace/output/ <br/> | ||
$ sudo cp Sdei.efi /mnt/sdei/ <br/> | ||
$ sudo umount /mnt/sdei | ||
2. Load the image file to the secondary storage using a backdoor. The steps followed to load the image file are Emulation environment specific and beyond the scope of this document. | ||
3. Boot the system to UEFI shell. | ||
4. To determine the file system number of the secondary storage, execute 'map -r' command. | ||
5. Type 'fsx' where 'x' is replaced by the number determined in step 4. | ||
6. To start the compliance tests, run the executable Sdei.efi with the appropriate arguments. | ||
|
||
### Emulation environment without secondary storage | ||
|
||
On an Emulation platform where secondary storage is not available, perform the following steps: | ||
|
||
1. Add the path to 'Sdei.efi' file in the UEFI FD file. | ||
2. Build UEFI image including the UEFI Shell. | ||
3. Boot the system to UEFI shell. | ||
4. Run the executable 'Sdei.efi' to start the compliance tests. | ||
|
||
## Test suite execution in Linux | ||
|
||
### Post-Silicon | ||
|
||
On a system where a USB port is available and functional, perform the following steps: | ||
|
||
1. Copy kernel module <i>sdei_acs.ko</i>, user space application <i>sdei</i> and kernel binary <i>Image</i> to a USB flash drive. | ||
2. Boot kernel binary <i>Image</i> using platform specific kernel arguments. | ||
3. On linux shell, mount the USB flash drive. For example:<br/>#mount /dev/sdb /mnt | ||
4. Insert sdei kernel module and run sdei application.<br/>#cd /mnt<br/>#insmod sdei_acs.ko<br/>#./sdei | ||
|
||
### Emulation environment with secondary storage | ||
|
||
On an emulation environment with secondary storage, perform the following steps: | ||
|
||
1. Create an image file which contains the 'Sdei.efi' file. For Example: <br/> | ||
$ mkfs.vfat -C -n HD0 hda.img 31457280 <br/> | ||
$ sudo mount hda.img /mnt/sdei <br/> | ||
$ cd /path/to/arm-enterprise-acs/sdei/workspace/output/ <br/> | ||
$ sudo cp sdei_acs.ko sdei Image /mnt/sdei <br/> | ||
$ sudo umount /mnt/sdei | ||
2. Load the image file to the secondary storage using a backdoor. The steps followed to load the image file are Emulation environment specific and beyond the scope of this document. | ||
3. Boot kernel binary <i>Image</i> using platform specific kernel arguments. | ||
4. On linux shell, mount the secondary storage. For example:<br/>#mount /dev/vda /mnt | ||
5. Insert sdei kernel module and run sdei application.<br/>#cd /mnt<br/>#insmod sdei_acs.ko<br/>#./sdei | ||
|
||
## Application arguments | ||
|
||
Command line arguments are similar for uefi and linux applications, with some exceptions. | ||
|
||
### UEFI | ||
|
||
Shell> Sdei.efi [-v <verbosity>] [-skip <test_id>] [-f <filename>] | ||
|
||
|
||
### Linux | ||
\# sdei [-v <verbosity>] [-skip <test_id>] | ||
|
||
|
||
#### -v | ||
Choose the verbosity level. | ||
|
||
- 1 - ERROR | ||
- 2 - WARN and ERROR | ||
- 3 - TEST and above | ||
- 4 - DEBUG and above | ||
- 5 - INFO and above | ||
- 6 - KERNEL dump kernel prints during tests (Only for linux application) | ||
|
||
#### -skip | ||
Overrides the suite to skip the execution of a particular | ||
test. For example, <i>-skip 10</i> skips test 10. | ||
|
||
#### -f (Only for UEFI application) | ||
Save the test output into a file in secondary storage. For example <i>-f sdei.log</i> creates a file sdei.log with test output. | ||
|
||
|
||
### UEFI example | ||
|
||
Shell> Sdei.efi -v 5 -skip 15,20,30 -f sdei_uefi.log | ||
|
||
Runs SDEI ACS with verbosity INFO, skips test 15, 20 and 30 and saves the test results in <i>sdei_uefi.log</i>. | ||
|
||
### Linux example | ||
|
||
\# sdei -v 1 -skip 10,20 | ||
|
||
Runs SDEI ACS with verbosity ERROR, skips test 10 and 20. | ||
|
||
## Interrupt numbers used in SDEI testing | ||
|
||
SPI interrupts: 230, 231 | ||
PPI interrupts: 18 | ||
SGI interrupts: 5 | ||
|
||
##SDEI compliance - Known Issues | ||
|
||
- Test #30 fails in linux. This is under debug. | ||
- Test #45, #47 and #48 are run only in UEFI Shell application and is skipped when run in Linux. | ||
- Running the SDEI ACS once is sufficient for compliance. There are stability issues when the ACS application is run multiple times without rebooting the system. |
Binary file not shown.
Binary file added
BIN
+1.27 MB
sdei/docs/Arm_SDEI_Architecture_Compliance_Validation_Methodology.pdf
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
## @file | ||
# Copyright (c) 2018, Arm Limited or its affiliates. All rights reserved. | ||
# SPDX-License-Identifier : Apache-2.0 | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
## | ||
|
||
|
||
program_NAME := sdei | ||
program_C_SRCS := $(wildcard *.c) | ||
program_CXX_SRCS := $(wildcard *.cpp) | ||
program_C_OBJS := ${program_C_SRCS:.c=.o} | ||
program_CXX_OBJS := ${program_CXX_SRCS:.cpp=.o} | ||
program_OBJS := $(program_C_OBJS) $(program_CXX_OBJS) | ||
program_INCLUDE_DIRS := ../val/include | ||
program_LIBRARY_DIRS := | ||
program_LIBRARIES := | ||
CC := $(CROSS_COMPILE)gcc | ||
|
||
CPPFLAGS += $(foreach includedir,$(program_INCLUDE_DIRS),-I$(includedir)) -DTARGET_LINUX -g | ||
LDFLAGS += $(foreach librarydir,$(program_LIBRARY_DIRS),-L$(librarydir)) | ||
LDFLAGS += $(foreach library,$(program_LIBRARIES),-l$(library)) | ||
|
||
.PHONY: all clean distclean | ||
|
||
all: $(program_NAME) | ||
|
||
$(program_NAME): $(program_OBJS) | ||
$(CROSS_COMPILE)gcc -static $(program_OBJS) -o $(program_NAME) | ||
|
||
clean: | ||
@- $(RM) $(program_NAME) | ||
@- $(RM) $(program_OBJS) | ||
|
||
distclean: clean | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
/** @file | ||
* Copyright (c) 2018, Arm Limited or its affiliates. All rights reserved. | ||
* SPDX-License-Identifier : Apache-2.0 | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
**/ | ||
|
||
#ifndef __SDEI_APP_MAIN_H__ | ||
#define __SDEI_APP_MAIN_H__ | ||
|
||
#define SDEI_APP_VERSION_MAJOR 1 | ||
#define SDEI_APP_VERSION_MINOR 0 | ||
|
||
#define SDEI_NUM_TESTS 50 | ||
|
||
#define SDEI_PASS 0 | ||
#define SDEI_SKIP 1 | ||
#define SDEI_FAIL 2 | ||
#define SDEI_ERROR 3 | ||
|
||
typedef unsigned long test_flags; | ||
|
||
typedef struct sdei_log_control { | ||
int32_t print_level; | ||
void *log_file_handle; | ||
} sdei_log_control; | ||
|
||
typedef struct sdei_test_control { | ||
/* which tests to run? */ | ||
test_flags flags[2]; | ||
unsigned int tests_skipped; | ||
unsigned int tests_passed; | ||
unsigned int tests_failed; | ||
unsigned int tests_aborted; | ||
} sdei_test_control; | ||
|
||
typedef struct sdei_control { | ||
sdei_log_control log_control; | ||
sdei_test_control tst_control; | ||
} sdei_control_t; | ||
|
||
typedef struct __SDEI_MSG__ { | ||
char string[100]; | ||
unsigned long data; | ||
} sdei_msg_parms_t; | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/** @file | ||
* Copyright (c) 2018, Arm Limited or its affiliates. All rights reserved. | ||
* SPDX-License-Identifier : Apache-2.0 | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
**/ | ||
|
||
|
||
#ifndef __SDEI_TEST_INTF_H__ | ||
#define __SDEI_TEST_INTF_H__ | ||
|
||
#include "sdei_app_main.h" | ||
|
||
#define ACS_LOG_KERNEL 0x6 | ||
#define SDEI_TEST_COMPLETE 0xFFFFFFFF | ||
#define SDEI_TEST_CLEANUP 0xAAAAAAAA | ||
|
||
/* Function Prototypes */ | ||
void testlib_enable_test(sdei_control_t *control, int test_id); | ||
void testlib_disable_test(sdei_control_t *control, int test_id); | ||
int init_test_env(sdei_control_t *control); | ||
int testlib_execute_tests(sdei_control_t *control); | ||
void testlib_cleanup(void); | ||
|
||
void testlib_run_specific(sdei_control_t *control, int test_id, int count); | ||
void read_msg_from_proc_sdei(void); | ||
#endif |
Oops, something went wrong.