Skip to content
This repository was archived by the owner on Jun 20, 2025. It is now read-only.

Commit dbc3ee8

Browse files
Merge pull request #4 from chetan-rathore/main
BSA 0.9 Beta changes
2 parents a4c1dde + cc27e7d commit dbc3ee8

File tree

209 files changed

+8197
-3099
lines changed

Some content is hidden

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

209 files changed

+8197
-3099
lines changed

README.md

Lines changed: 53 additions & 53 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
## Base System Architecture
55
**Base System Architecture** (BSA) specification describes a hardware system architecture based on the Arm 64-bit architecture. System software such as operating systems, hypervisors, and firmware rely on this. It addresses PE features and key aspects of system architecture.
66

7-
For more information, download the [BSA specification](https://developer.arm.com/documentation/den0094/latest)
7+
For more information, see [BSA specification](https://developer.arm.com/documentation/den0094/latest)
88

99

1010
## BSA - Architecture Compliance Suite
@@ -16,35 +16,49 @@ A few tests are executed by running the BSA ACS Linux application which in turn
1616

1717

1818
## Release details
19-
- Code quality: v0.5 Alpha
19+
- Code quality: v0.9 Beta
2020
- The tests are written for version 1.0 of the BSA specification.
2121
- The compliance suite is not a substitute for design verification.
2222
- To review the BSA ACS logs, Arm licensees can contact Arm directly through their partner managers.
2323

2424

2525
## GitHub branch
26-
- To pick up the release version of the code, checkout the coresponding tag from main branch.
26+
- To pick up the release version of the code, checkout the corresponding tag from the main branch.
2727
- To get the latest version of the code with bug fixes and new features, use the main branch.
2828

2929
## Additional reading
30-
- For information on the test scenarios currently implemented for IR, see [Scenario Document](docs/Arm_Base_System_Architecture_Scenario_IR.pdf).
30+
- For information on the test scenarios currently implemented for platform using Device tree, see [Scenario Document](docs/Arm_Base_System_Architecture_Scenario_IR.pdf).
31+
- For information on the test scenarios currently implemented for platform using ACPI table, see [Scenario Document](docs/Arm_Base_System_Architecture_Scenario_ES.pdf).
3132

3233
## ACS build steps - UEFI Shell application
3334

3435
### Prebuilt images
3536
Prebuilt images for each release are available in the prebuilt_images folder of the release branch. You can choose to use these images or build your own image by following the steps below. If you choose to use the prebuilt image, see the Test suite execution section below for details on how to run the application.
3637

37-
### Prerequisites
38+
### 1. Building from source
3839
Before you start the ACS build, ensure that the following requirements are met.
3940

4041
- Any mainstream Linux-based OS distribution running on a x86 or AArch64 machine.
4142
- git clone the edk2-stable202102 tag of [EDK2 tree](https://github.com/tianocore/edk2).
4243
- git clone the [EDK2 port of libc](https://github.com/tianocore/edk2-libc) to local <edk2_path>.
43-
- Install GCC 7.5 or a later toolchain for Linux from [here](https://releases.linaro.org/components/toolchain/binaries/).
44+
- GCC 7.5 or a later toolchain for Linux from [here](https://releases.linaro.org/components/toolchain/binaries/).
4445
- Install the build prerequisite packages to build EDK2.
4546
Note: The details of the packages are beyond the scope of this document.
4647

47-
To start the ACS build for IR, perform the following steps:
48+
#### 1.1 Target Platform
49+
##### To start the ACS build for platform using ACPI table, perform the following steps:
50+
51+
1. cd local_edk2_path
52+
2. git submodule update --init --recursive
53+
3. git clone https://github.com/ARM-software/bsa-acs.git ShellPkg/Application/bsa-acs
54+
4. Add the following to the [LibraryClasses.common] section in ShellPkg/ShellPkg.dsc
55+
> BsaValLib|ShellPkg/Application/bsa-acs/val/BsaValLib.inf
56+
> BsaPalLib|ShellPkg/Application/bsa-acs/platform/pal_uefi_acpi/BsaPalLib.inf
57+
58+
5. Add the following in the [components] section of ShellPkg/ShellPkg.dsc
59+
> ShellPkg/Application/bsa-acs/uefi_app/BsaAcs.inf
60+
61+
##### To start the ACS build for platform using Device tree, perform the following steps:
4862

4963
1. cd local_edk2_path
5064
2. git submodule update --init --recursive
@@ -64,25 +78,25 @@ To start the ACS build for IR, perform the following steps:
6478
> +//Status = gBS->LocateProtocol (&gEfiHiiConfigRoutingProtocolGuid, NULL, (VOID **) &gHiiConfigRouting);
6579
> +//ASSERT_EFI_ERROR (Status);
6680
67-
### Linux build environment
68-
If the build environment is Linux, perform the following steps:
81+
#### 1.2 Build environment
82+
##### If the build environment is Linux, perform the following steps:
6983
1. export GCC49_AARCH64_PREFIX= GCC7.5 toolchain path pointing to /bin/aarch64-linux-gnu- in case of x86 machine. For an AArch64 build it should point to /usr/bin/
7084
2. export PACKAGES_PATH= path pointing to edk2-libc
7185
3. source edksetup.sh
7286
4. make -C BaseTools/Source/C
7387
5. source ShellPkg/Application/bsa-acs/tools/scripts/acsbuild.sh
7488

75-
### Build output
89+
#### 1.3 Build output
7690

7791
The EFI executable file is generated at <edk2_path>/Build/Shell/DEBUG_GCC49/AARCH64/Bsa.efi
7892

7993

80-
## Test suite execution
94+
### 2. Test suite execution
8195

8296
The execution of the compliance suite varies depending on the test environment. The below steps assume that the test suite is invoked through the ACS UEFI shell application.
8397

8498

85-
### Prerequisites
99+
#### Prerequisites
86100
- If the system supports LPIs (Interrupt ID > 8192) then Firmware should support installation of handler for LPI interrupts.
87101
- If you are using edk2, change the ArmGic driver in the ArmPkg to support installation of handler for LPIs.
88102
- Add the following in edk2/ArmPkg/Drivers/ArmGic/GicV3/ArmGicV3Dxe.c
@@ -92,7 +106,8 @@ The execution of the compliance suite varies depending on the test environment.
92106
> -mGicNumInterrupts = ArmGicGetMaxNumInterrupts (mGicDistributorBase);
93107
> +mGicNumInterrupts = ARM_GIC_MAX_NUM_INTERRUPT;
94108
95-
### Silicon
109+
#### 2.1 Silicon
110+
96111
On a system where a USB port is available and functional, perform the following steps:
97112

98113
#### For IR Systems:
@@ -111,12 +126,13 @@ On a system where a USB port is available and functional, perform the following
111126
9. Copy the UART console output to a log file.
112127
Note: 'Shell.efi' is available in the [pebuilt_images/IR](prebuilt_images)
113128

114-
### Emulation environment with secondary storage
129+
#### 2.2 Emulation environment with secondary storage
115130
On an emulation environment with secondary storage, perform the following steps:
116131

117132
1. Create an image file which contains the 'Bsa.efi' file. For example:
118133
- mkfs.vfat -C -n HD0 hda.img 2097152
119-
- sudo mount -o rw,loop=/dev/loop0,uid=`whoami`,gid=`whoami` hda.img /mnt/bsa
134+
- sudo mount -o rw,loop=/dev/loop0,uid=\`whoami\`,gid=\`whoami\` hda.img /mnt/bsa
135+
In case loop0 is busy, please specify the one that is free.
120136
- sudo cp "<path to application>/Bsa.efi" /mnt/bsa/
121137
- sudo umount /mnt/bsa
122138
2. Load the image file to the secondary storage using a backdoor. The steps to load the image file are emulation environment-specific and beyond the scope of this document.
@@ -126,8 +142,10 @@ On an emulation environment with secondary storage, perform the following steps:
126142
6. To start the compliance tests, run the executable Bsa.efi with the appropriate parameters.
127143
7. Copy the UART console output to a log file for analysis and certification.
128144

145+
- For information on the BSA uefi shell application parameters, see [User Guide](docs/Arm_Base_System_Architecture_Compliance_User_Guide.pdf).
146+
129147

130-
### Emulation environment without secondary storage
148+
#### 2.3 Emulation environment without secondary storage
131149

132150
On an emulation platform where secondary storage is not available, perform the following steps:
133151

@@ -139,81 +157,63 @@ On an emulation platform where secondary storage is not available, perform the f
139157

140158

141159
## Linux OS-based tests
142-
Certain Peripheral, PCIe and Memory map tests require Linux operating system with kernel version 5.10 or above.
160+
Certain Peripheral, PCIe and Memory map tests require Linux operating system with kernel version 5.11 or above.
143161
This chapter provides information on executing tests from the Linux application.
144162

145-
### Build steps and environment setup
163+
### 1. Build steps and environment setup
146164
This section lists the porting and build steps for the kernel module.
147-
The patch for the kernel tree and the Linux PAL are hosted separately on [linux-acs](https://gitlab.arm.com/linux-arm/linux-acs) repo
165+
The patch for the kernel tree and the Linux PAL are hosted separately on [linux-acs](https://git.gitlab.arm.com/linux-arm/linux-acs.git) repo
148166

149-
### Building the kernel module
167+
### 1.1 Building the kernel module
150168
#### Prerequisites
151-
- Linux kernel source version 5.10.
169+
- Linux kernel source version 5.11.
152170
- Linaro GCC tool chain 7.5 or above.
153171
- Build environment for AArch64 Linux kernel.
154172

155173
#### Porting steps for Linux kernel
156174
1. git clone https://git.gitlab.arm.com/linux-arm/linux-acs.git bsa-acs-drv
157175
2. git clone https://github.com/ARM-software/bsa-acs.git bsa-acs
158-
3. git clone https://github.com/torvalds/linux.git -b v5.10
176+
3. git clone https://github.com/torvalds/linux.git -b v5.11
159177
4. export CROSS_COMPILE=<GCC7.5 toolchain path> pointing to /bin/aarch64-linux-gnu-
160-
5. git apply <local_dir>/bsa-acs-drv/kernel/src/0001-BSA-SBSA-ACS-Linux-5.10.patch to your kernel source tree.
178+
5. git apply <local_dir>/bsa-acs-drv/kernel/src/0001-BSA-ACS-Linux-5.11.patch to your kernel source tree.
161179
6. make ARCH=arm64 defconfig && make -j $(nproc) ARCH=arm64
162180

163-
#### Build steps for BSA kernel module
181+
#### 1.2 Build steps for BSA kernel module
164182
1. cd <local_dir>/bsa-acs-drv/files
165183
2. export CROSS_COMPILE=<ARM64 toolchain path>/bin/aarch64-linux-gnu-
166184
3. export KERNEL_SRC=<linux kernel path>
167185
4. ./setup.sh <local_dir/bsa-acs>
168186
5. ./linux_bsa_acs.sh
169-
bsa_acs.ko file is generated.
170187

171-
#### BSA Linux application build
188+
Successfull completion of above steps will generate bsa_acs.ko
189+
190+
#### 1.3 BSA Linux application build
172191
1. cd <bsa-acs path>/linux_app/bsa-acs-app
173192
2. export CROSS_COMPILE=<ARM64 toolchain path>/bin/aarch64-linux-gnu-
174193
3. make
175-
The executable file bsa is generated.
176-
177-
## Linux application arguments
178-
Run the Linux application with the following set of arguments
179-
```sh
180-
shell> bsa [--v <n>] [--skip <x,y,z>]
181-
```
182194

183-
| Argument | Description |
184-
| ------ | ------ |
185-
| v | Print level |
186-
|| 1. INFO and above|
187-
|| 2. DEBUG and above|
188-
|| 3. TEST and above|
189-
|| 4. WARN and ERROR|
190-
|| 5. ERROR|
191-
|||
192-
| skip | Overrides the suite to skip the execution of a particular test.
193-
|| For example, 53 skips test case with ID 53.|
194-
195-
### Example
196-
```sh
197-
shell> bsa --v 3 --skip 53
198-
```
199-
This set of parameters tests for compliance against BSA with print verbosity set to 3, and skips test number 53.
195+
Successfull completion of above steps will generate executable file bsa
200196

201-
### Loading the kernel module
197+
### 2. Loading the kernel module
202198
Before the BSA ACS Linux application can be run, load the BSA ACS kernel module using the insmod command.
203199
```sh
204200
shell> insmod bsa_acs.ko
205201
```
206202

207-
### Running BSA ACS
203+
### 3. Running BSA ACS
208204
```sh
209205
shell> ./bsa
210206
```
207+
- For information on the BSA Linux application parameters, see [User Guide](docs/Arm_Base_System_Architecture_Compliance_User_Guide.pdf).
211208

212209
## Security implication
213210
The Arm System Ready ACS test suite may run at a higher privilege level. An attacker may utilize these tests to elevate the privilege which can potentially reveal the platform security assets. To prevent the leakage of secure information, Arm strongly recommends that you run the ACS test suite only on development platforms. If it is run on production systems, the system should be scrubbed after running the test suite.
214211

215212
## Limitations
216-
No known limitations.
213+
214+
- PCIE iEP rules are out of scope for current release.
215+
- ITS rules are available only for systems that present firmware compliant to SBBR.
216+
- Peripheral rules RB_PER_01,02,03 are not implemented in current release for systems that present firmware compliant to EBBR.
217217

218218
## License
219219
BSA ACS is distributed under Apache v2.0 License.

changelog.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,9 @@ v21.05_05_ALPHA
66
* BSA: Provided documentations required to build and run BSA ACS on supported platforms.
77
* BSA: Provided documentation on test scenarios.
88

9+
v21.07_0.9_BETA
10+
11+
* BSA: Increaed PCIe rules coverage
12+
* BSA: Initial ITS tests for systems presenting firmware which is SBBR complaint
13+
* BSA: Renamed pal_uefi to pal_uefi_acpi
14+
* BSA: Bug Fixes on Alpha release
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

linux_app/bsa-acs-app/bsa_app_main.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,12 @@ main (int argc, char **argv)
143143
return 0;
144144
}
145145

146-
printf("\n *** Starting Peripherals tests *** \n");
147-
execute_tests_peripheral(1, g_print_level);
148-
149146
printf("\n *** Starting Memory Map tests *** \n");
150147
execute_tests_memory(1, g_print_level);
151148

149+
printf("\n *** Starting Peripherals tests *** \n");
150+
execute_tests_peripheral(1, g_print_level);
151+
152152
if (run_exerciser) {
153153
printf("\n *** PCIe Exerciser tests only runs on UEFI *** \n");
154154
//execute_tests_exerciser(1, g_print_level);

linux_app/bsa-acs-app/include/bsa_app.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121

2222

2323
#define BSA_APP_VERSION_MAJOR 0
24-
#define BSA_APP_VERSION_MINOR 5
24+
#define BSA_APP_VERSION_MINOR 9
2525

2626
#define G_SW_OS 0
2727
#define G_SW_HYP 1

0 commit comments

Comments
 (0)