Skip to content

Commit 12ab50d

Browse files
committed
ci(esp_tee): Refactor the ESP-TEE test-cases
- Improve the interrupt-related test cases - Fix potential issues in the task-switching test during secure service calls
1 parent 508a659 commit 12ab50d

File tree

8 files changed

+321
-372
lines changed

8 files changed

+321
-372
lines changed

components/esp_tee/test_apps/tee_test_fw/components/test_sec_srv/include/esp_tee_test.h

Lines changed: 2 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -9,36 +9,11 @@
99
extern "C" {
1010
#endif
1111

12-
#include <stdint.h>
1312
#include "esp_attr.h"
1413

15-
#define TEE_TEST_INT_COUNT 3
14+
#define ESP_TEE_TEST_INTR_ITER (4)
1615

17-
uint32_t NOINLINE_ATTR esp_tee_service_add(uint32_t a, uint32_t b);
18-
19-
uint32_t NOINLINE_ATTR esp_tee_service_sub(uint32_t a, uint32_t b);
20-
21-
uint32_t NOINLINE_ATTR esp_tee_service_mul(uint32_t a, uint32_t b);
22-
23-
uint32_t NOINLINE_ATTR esp_tee_service_div(uint32_t a, uint32_t b);
24-
25-
int esp_tee_secure_int_test(void);
26-
27-
int esp_tee_non_secure_int_test(volatile uint32_t* volatile ns_int_count);
28-
29-
int esp_tee_test_int_count(uint32_t *secure_int_count);
30-
31-
int esp_tee_test_store_prohibited(uint32_t type);
32-
33-
int esp_tee_test_illegal_instr(void);
34-
35-
int esp_tee_test_instr_fetch_prohibited(uint32_t type);
36-
37-
void NOINLINE_ATTR dummy_secure_service(int a, int b, int c, int d, int e, int f, int g, int h, int *i);
38-
39-
uint32_t add_in_loop(uint32_t a, uint32_t b, uint32_t iter);
40-
41-
int _ss_esp_tee_test_heap_malloc_write_free(void);
16+
void NOINLINE_ATTR esp_tee_test_dummy_sec_srv(int a, int b, int c, int d, int e, int f, int g, int h, int *i);
4217

4318
#ifdef __cplusplus
4419
}

components/esp_tee/test_apps/tee_test_fw/components/test_sec_srv/sec_srv_tbl_test.yml

Lines changed: 22 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,73 +3,69 @@ secure_services:
33
entries:
44
- id: 200
55
type: custom
6-
function: esp_tee_service_add
6+
function: esp_tee_test_service_add
77
args: 2
88
- id: 201
99
type: custom
10-
function: esp_tee_service_sub
10+
function: esp_tee_test_service_sub
1111
args: 2
1212
- id: 202
1313
type: custom
14-
function: esp_tee_service_mul
14+
function: esp_tee_test_service_mul
1515
args: 2
1616
- id: 203
1717
type: custom
18-
function: esp_tee_service_div
18+
function: esp_tee_test_service_div
1919
args: 2
2020
- id: 204
2121
type: custom
22-
function: esp_tee_test_timer_init
23-
args: 1
22+
function: esp_tee_test_tee_intr_in_tee
23+
args: 0
2424
- id: 205
2525
type: custom
26-
function: esp_tee_secure_int_test
27-
args: 0
26+
function: esp_tee_test_ree_intr_in_tee
27+
args: 1
2828
- id: 206
2929
type: custom
30-
function: esp_tee_non_secure_int_test
31-
args: 1
30+
function: esp_tee_test_tee_intr_in_ree
31+
args: 2
3232
- id: 207
33-
type: custom
34-
function: esp_tee_test_int_count
35-
args: 1
36-
- id: 208
3733
type: custom
3834
function: esp_tee_test_resv_reg1_write_violation
3935
args: 0
40-
- id: 209
36+
- id: 208
4137
type: custom
4238
function: esp_tee_test_resv_reg1_exec_violation
4339
args: 0
44-
- id: 210
40+
- id: 209
4541
type: custom
4642
function: esp_tee_test_iram_reg1_write_violation
4743
args: 0
48-
- id: 211
44+
- id: 210
4945
type: custom
5046
function: esp_tee_test_iram_reg2_write_violation
5147
args: 0
52-
- id: 212
48+
- id: 211
5349
type: custom
5450
function: esp_tee_test_dram_reg1_exec_violation
5551
args: 0
56-
- id: 213
52+
- id: 212
5753
type: custom
5854
function: esp_tee_test_dram_reg2_exec_violation
5955
args: 0
60-
- id: 214
56+
- id: 213
6157
type: custom
6258
function: esp_tee_test_illegal_instruction
6359
args: 0
64-
- id: 215
60+
- id: 214
6561
type: custom
66-
function: dummy_secure_service
62+
function: esp_tee_test_dummy_sec_srv
6763
args: 9
68-
- id: 216
64+
- id: 215
6965
type: custom
70-
function: add_in_loop
71-
args: 3
72-
- id: 217
66+
function: esp_tee_test_priv_mode_switch
67+
args: 2
68+
- id: 216
7369
type: custom
7470
function: esp_tee_test_heap_malloc_write_free
7571
args: 0

components/esp_tee/test_apps/tee_test_fw/components/test_sec_srv/src/test_dummy_srv.c

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

1010
#include "multi_heap.h"
1111

12-
void NOINLINE_ATTR _ss_dummy_secure_service(int a, int b, int c, int d, int e, int f, int g, int h, int *i)
12+
void NOINLINE_ATTR _ss_esp_tee_test_dummy_sec_srv(int a, int b, int c, int d, int e, int f, int g, int h, int *i)
1313
{
1414
esp_rom_printf("Dummy secure service\n");
1515
*i = a + b + c + d + e + f + g + h;
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
/*
2-
* SPDX-FileCopyrightText: 2024 Espressif Systems (Shanghai) CO LTD
2+
* SPDX-FileCopyrightText: 2024-2025 Espressif Systems (Shanghai) CO LTD
33
*
44
* SPDX-License-Identifier: Apache-2.0
55
*/
66
#include <stdarg.h>
77
#include "secure_service_num.h"
88
#include "esp_tee.h"
9-
#include "esp_err.h"
9+
#include "esp_attr.h"
1010

11-
void dummy_secure_service(int a, int b, int c, int d, int e, int f, int g, int h, int *i)
11+
void NOINLINE_ATTR esp_tee_test_dummy_sec_srv(int a, int b, int c, int d, int e, int f, int g, int h, int *i)
1212
{
13-
esp_tee_service_call(10, SS_DUMMY_SECURE_SERVICE, a, b, c, d, e, f, g, h, i);
13+
esp_tee_service_call(10, SS_ESP_TEE_TEST_DUMMY_SEC_SRV, a, b, c, d, e, f, g, h, i);
1414
}

0 commit comments

Comments
 (0)