From a18d4d8746b73870455cc1d9064fa33593894224 Mon Sep 17 00:00:00 2001 From: Rajat Goyal Date: Wed, 4 Feb 2026 07:20:37 +0000 Subject: [PATCH 1/3] Improve PAL not-implemented signalling and unify warnings - Introduce `pal_warn_not_implemented()` in every PAL environment (bare-metal, UEFI ACPI, UEFI DT) and call it from each stub before returning `PAL_STATUS_NOT_IMPLEMENTED`, so the PAL layer consistently emits a warning with the API name. - Replace the old macro-based status values with a `pal_status_t` enum, add dedicated feature-status values, and keep compatibility helpers as macro. - VAL now relies on the PAL warning while preserving existing skip/fail behaviour in tests. Signed-off-by: Rajat Goyal Change-Id: I1fcfcbb23fd2aead4445aa4672a203eeb8da19ad --- .../base/include/pal_common_support.h | 3 +- pal/baremetal/base/src/pal_misc.c | 19 ++++- pal/baremetal/pal.cmake | 1 + pal/baremetal/target/RDN2/src/pal_bsa.c | 25 +++--- pal/baremetal/target/RDN2/src/pal_exerciser.c | 2 +- pal/baremetal/target/RDN2/src/pal_sbsa.c | 32 ++++---- pal/baremetal/target/RDV3/src/pal_bsa.c | 25 +++--- pal/baremetal/target/RDV3/src/pal_exerciser.c | 2 +- pal/baremetal/target/RDV3/src/pal_sbsa.c | 31 +++++--- pal/baremetal/target/RDV3CFG1/src/pal_bsa.c | 25 +++--- .../target/RDV3CFG1/src/pal_exerciser.c | 2 +- pal/baremetal/target/RDV3CFG1/src/pal_sbsa.c | 31 +++++--- pal/include/pal_status.h | 76 +++++++++++++++++++ pal/uefi_acpi/include/pal_uefi.h | 4 +- pal/uefi_acpi/src/pal_misc.c | 18 ++++- pal/uefi_acpi/src/pal_nist.c | 5 +- pal/uefi_acpi/src/pal_pcie.c | 24 +++--- pal/uefi_acpi/src/pal_pmu.c | 36 ++++++--- pal/uefi_acpi/src/pal_ras.c | 27 +++++-- pal/uefi_acpi/src/pal_smmu.c | 5 +- pal/uefi_dt/include/pal_uefi.h | 4 +- pal/uefi_dt/src/pal_misc.c | 18 ++++- pal/uefi_dt/src/pal_pcie.c | 24 +++--- pal/uefi_dt/src/pal_peripherals.c | 3 +- pal/uefi_dt/src/pal_smmu.c | 5 +- test_pool/exerciser/e017.c | 8 +- test_pool/nist_sts/test_n001.c | 2 +- test_pool/pcie/p019.c | 4 +- val/include/val_interface.h | 5 +- 29 files changed, 340 insertions(+), 126 deletions(-) create mode 100644 pal/include/pal_status.h diff --git a/pal/baremetal/base/include/pal_common_support.h b/pal/baremetal/base/include/pal_common_support.h index 2a7d41b0..cbbb1a53 100644 --- a/pal/baremetal/base/include/pal_common_support.h +++ b/pal/baremetal/base/include/pal_common_support.h @@ -22,6 +22,7 @@ #include #include #include +#include "pal_status.h" #include "platform_override_fvp.h" typedef uintptr_t addr_t; @@ -63,6 +64,7 @@ void *pal_aligned_alloc( uint32_t alignment, uint32_t size ); void pal_uart_print(int log, const char *fmt, ...); void *mem_alloc(size_t alignment, size_t size); +void pal_warn_not_implemented(const char *api_name); #define print(verbose, string, ...) if(verbose >= g_print_level) \ pal_uart_print(verbose, string, ##__VA_ARGS__) @@ -178,7 +180,6 @@ void *mem_alloc(size_t alignment, size_t size); #define INVALIDATE 0x3 #define HEAP_INITIALISED 0xDC -#define NOT_IMPLEMENTED 0x4B1D #define MEM_SIZE_64K 0x10000 diff --git a/pal/baremetal/base/src/pal_misc.c b/pal/baremetal/base/src/pal_misc.c index 799da550..0a249230 100644 --- a/pal/baremetal/base/src/pal_misc.c +++ b/pal/baremetal/base/src/pal_misc.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2023-2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2023-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -233,6 +233,23 @@ pal_print_raw(uint64_t addr, char *string, uint64_t data) } } +/** + @brief Emit a warning indicating the given PAL API is not implemented. + @param api_name Name of the unimplemented API (typically __func__). +**/ +void +pal_warn_not_implemented(const char *api_name) +{ + if (api_name == NULL) + return; + + print(ACS_PRINT_WARN, + "\n %s is not implemented." + "\n Please implement the PAL function in test suite or" + "\n conduct an offline review for this rule.", + api_name); +} + /** @brief Free the memory allocated by UEFI Framework APIs @param Buffer the base address of the memory range to be freed diff --git a/pal/baremetal/pal.cmake b/pal/baremetal/pal.cmake index 63a8767e..83cc12b1 100644 --- a/pal/baremetal/pal.cmake +++ b/pal/baremetal/pal.cmake @@ -32,6 +32,7 @@ target_include_directories(${PAL_LIB} PRIVATE ${ROOT_DIR}/ ${ROOT_DIR}/apps/baremetal/ ${ROOT_DIR}/pal/baremetal/ + ${ROOT_DIR}/pal/include/ ${ROOT_DIR}/pal/baremetal/base/include/ ${ROOT_DIR}/pal/baremetal/base/src/AArch64/ ${ROOT_DIR}/pal/baremetal/target/${TARGET}/include/ diff --git a/pal/baremetal/target/RDN2/src/pal_bsa.c b/pal/baremetal/target/RDN2/src/pal_bsa.c index 9289d572..a953c4ea 100644 --- a/pal/baremetal/target/RDN2/src/pal_bsa.c +++ b/pal/baremetal/target/RDN2/src/pal_bsa.c @@ -657,7 +657,7 @@ pal_gic_free_irq ( @return - 0 : Success - - NOT_IMPLEMENTED : Feature not implemented + - PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented - non-zero : Failure (implementation-specific error code) **/ uint64_t @@ -667,7 +667,8 @@ pal_smmu_pa2iova(uint64_t SmmuBase, uint64_t Pa, uint64_t *dram_buf_iova) (void) Pa; (void) dram_buf_iova; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -677,7 +678,7 @@ pal_smmu_pa2iova(uint64_t SmmuBase, uint64_t Pa, uint64_t *dram_buf_iova) @return - 0 : Success - - NOT_IMPLEMENTED : Feature not implemented + - PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented - non-zero : Failure (implementation-specific error code) **/ uint32_t pal_smmu_check_device_iova(void *port, uint64_t dma_addr) @@ -685,7 +686,8 @@ uint32_t pal_smmu_check_device_iova(void *port, uint64_t dma_addr) (void) port; (void) dma_addr; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -758,7 +760,7 @@ pal_pcie_device_driver_present(uint32_t seg, uint32_t bus, uint32_t dev, uint32_ @return - 0 : Success - - NOT_IMPLEMENTED : Feature not implemented + - PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented - non-zero : Failure (implementation-specific error code) **/ uint32_t @@ -771,7 +773,8 @@ pal_get_msi_vectors(uint32_t Seg, uint32_t Bus, uint32_t Dev, uint32_t Fn, (void) MVector; (void) Fn; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -1161,7 +1164,7 @@ pal_mem_free_cacheable(uint32_t Bdf, uint32_t Size, void *Va, void *Pa) @return - 0 : Success - - NOT_IMPLEMENTED : Feature not implemented + - PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented - non-zero : Failure (implementation-specific error code) **/ uint64_t @@ -1173,7 +1176,8 @@ pal_dma_mem_alloc(void **buffer, uint32_t length, void *dev, uint32_t flag, addr (void) dma_addr; *buffer = (void *)pal_aligned_alloc(MEM_ALIGN_4K, length); - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -1228,7 +1232,7 @@ pal_dma_scsi_get_dma_addr(void *port, void *dma_addr, unsigned int *dma_len) @return - 0 : Success - - NOT_IMPLEMENTED : Feature not implemented + - PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented - non-zero : Failure (implementation-specific error code) **/ int @@ -1242,5 +1246,6 @@ pal_dma_mem_get_attrs(void *buf, uint32_t *attr, uint32_t *sh) (void) attr; (void) sh; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } diff --git a/pal/baremetal/target/RDN2/src/pal_exerciser.c b/pal/baremetal/target/RDN2/src/pal_exerciser.c index 530de5b0..f515b066 100644 --- a/pal/baremetal/target/RDN2/src/pal_exerciser.c +++ b/pal/baremetal/target/RDN2/src/pal_exerciser.c @@ -785,7 +785,7 @@ pal_exerciser_get_ras_status(uint32_t ras_node, uint32_t bdf, uint32_t rp_bdf) with reads @param bdf - BDF of the device @return status - 0 if implemented, else - - NOT_IMPLEMENTED + - PAL_STATUS_NOT_IMPLEMENTED **/ uint32_t pal_exerciser_set_bar_response(uint32_t bdf) diff --git a/pal/baremetal/target/RDN2/src/pal_sbsa.c b/pal/baremetal/target/RDN2/src/pal_sbsa.c index c222a003..98ac1b96 100644 --- a/pal/baremetal/target/RDN2/src/pal_sbsa.c +++ b/pal/baremetal/target/RDN2/src/pal_sbsa.c @@ -1,6 +1,6 @@ /** @file - * Copyright (c) 2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2025-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -38,14 +38,15 @@ extern WD_INFO_TABLE platform_wd_cfg; @param etr_path full path of ETR device - @return 0 - Success, NOT_IMPLEMENTED - API not implemented, Other values - Failure + @return 0 - Success, PAL_STATUS_NOT_IMPLEMENTED - API not implemented, Other values - Failure **/ uint32_t pal_smmu_is_etr_behind_catu(char *etr_path) { (void) etr_path; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -53,12 +54,12 @@ pal_smmu_is_etr_behind_catu(char *etr_path) @param None - @return 0 - Failure, NOT_IMPLEMENTED - DSM Method not implemented, Other values - PASS + @return 0 - Failure, PAL_STATUS_NOT_IMPLEMENTED - DSM Method not implemented, Other values - PASS **/ uint32_t pal_pcie_dsm_ste_tags(void) { - - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -76,7 +77,8 @@ pal_pmu_check_monitor_count_value(uint64_t interface_acpiid, uint32_t count_valu (void) count_value; (void) eventid; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -97,7 +99,8 @@ pal_generate_traffic(uint64_t interface_acpiid, uint32_t pmu_node_index, (void) mon_index; (void) eventid; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -114,7 +117,8 @@ pal_pmu_get_multi_traffic_support_interface(uint64_t *interface_acpiid, (void) interface_acpiid; (void) num_traffic_type_support; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -137,7 +141,7 @@ pal_ras_check_plat_poison_support() @param in_param - Error Input Parameters. @param *out_param - Parameters returned from platform to be used in the test. - @return 0 - Success, NOT_IMPLEMENTED - API not implemented, Other values - Failure + @return 0 - Success, PAL_STATUS_NOT_IMPLEMENTED - API not implemented, Other values - Failure **/ uint32_t pal_ras_setup_error(RAS_ERR_IN_t in_param, RAS_ERR_OUT_t *out_param) @@ -147,7 +151,8 @@ pal_ras_setup_error(RAS_ERR_IN_t in_param, RAS_ERR_OUT_t *out_param) (void) in_param; (void) out_param; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -156,7 +161,7 @@ pal_ras_setup_error(RAS_ERR_IN_t in_param, RAS_ERR_OUT_t *out_param) @param in_param - Error Input Parameters. @param *out_param - Parameters returned from platform to be used in the test. - @return 0 - Success, NOT_IMPLEMENTED - API not implemented, Other values - Failure + @return 0 - Success, PAL_STATUS_NOT_IMPLEMENTED - API not implemented, Other values - Failure **/ uint32_t pal_ras_inject_error(RAS_ERR_IN_t in_param, RAS_ERR_OUT_t *out_param) @@ -164,6 +169,7 @@ pal_ras_inject_error(RAS_ERR_IN_t in_param, RAS_ERR_OUT_t *out_param) (void) in_param; (void) out_param; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } diff --git a/pal/baremetal/target/RDV3/src/pal_bsa.c b/pal/baremetal/target/RDV3/src/pal_bsa.c index 9a7ead5e..01128946 100644 --- a/pal/baremetal/target/RDV3/src/pal_bsa.c +++ b/pal/baremetal/target/RDV3/src/pal_bsa.c @@ -686,7 +686,7 @@ pal_gic_free_irq ( @return - 0 : Success - - NOT_IMPLEMENTED : Feature not implemented + - PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented - non-zero : Failure (implementation-specific error code) */ uint64_t @@ -696,7 +696,8 @@ pal_smmu_pa2iova(uint64_t SmmuBase, uint64_t Pa, uint64_t *dram_buf_iova) (void) Pa; (void) dram_buf_iova; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -706,7 +707,7 @@ pal_smmu_pa2iova(uint64_t SmmuBase, uint64_t Pa, uint64_t *dram_buf_iova) @return - 0 : Success - - NOT_IMPLEMENTED : Feature not implemented + - PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented - non-zero : Failure (implementation-specific error code) **/ uint32_t pal_smmu_check_device_iova(void *port, uint64_t dma_addr) @@ -714,7 +715,8 @@ uint32_t pal_smmu_check_device_iova(void *port, uint64_t dma_addr) (void) port; (void) dma_addr; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -787,7 +789,7 @@ pal_pcie_device_driver_present(uint32_t seg, uint32_t bus, uint32_t dev, uint32_ @return - 0 : Success - - NOT_IMPLEMENTED : Feature not implemented + - PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented - non-zero : Failure (implementation-specific error code) **/ uint32_t @@ -800,7 +802,8 @@ pal_get_msi_vectors(uint32_t Seg, uint32_t Bus, uint32_t Dev, uint32_t Fn, (void) MVector; (void) Fn; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -1193,7 +1196,7 @@ pal_mem_free_cacheable(uint32_t Bdf, uint32_t Size, void *Va, void *Pa) @return - 0 : Success - - NOT_IMPLEMENTED : Feature not implemented + - PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented - non-zero : Failure (implementation-specific error code) **/ uint64_t @@ -1205,7 +1208,8 @@ pal_dma_mem_alloc(void **buffer, uint32_t length, void *dev, uint32_t flag, addr (void) dma_addr; *buffer = (void *)pal_aligned_alloc(MEM_ALIGN_4K, length); - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -1261,7 +1265,7 @@ pal_dma_scsi_get_dma_addr(void *port, void *dma_addr, unsigned int *dma_len) @return - 0 : Success - - NOT_IMPLEMENTED : Feature not implemented + - PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented - non-zero : Failure (implementation-specific error code) **/ int @@ -1275,5 +1279,6 @@ pal_dma_mem_get_attrs(void *buf, uint32_t *attr, uint32_t *sh) (void) attr; (void) sh; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } diff --git a/pal/baremetal/target/RDV3/src/pal_exerciser.c b/pal/baremetal/target/RDV3/src/pal_exerciser.c index 676eed11..6229a5d2 100644 --- a/pal/baremetal/target/RDV3/src/pal_exerciser.c +++ b/pal/baremetal/target/RDV3/src/pal_exerciser.c @@ -790,7 +790,7 @@ pal_exerciser_get_ras_status(uint32_t ras_node, uint32_t bdf, uint32_t rp_bdf) with reads @param bdf - BDF of the device @return status - 0 if implemented, else - - NOT_IMPLEMENTED + - PAL_STATUS_NOT_IMPLEMENTED **/ uint32_t pal_exerciser_set_bar_response(uint32_t bdf) diff --git a/pal/baremetal/target/RDV3/src/pal_sbsa.c b/pal/baremetal/target/RDV3/src/pal_sbsa.c index c222a003..a0dcde1f 100644 --- a/pal/baremetal/target/RDV3/src/pal_sbsa.c +++ b/pal/baremetal/target/RDV3/src/pal_sbsa.c @@ -1,6 +1,6 @@ /** @file - * Copyright (c) 2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2025-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -38,14 +38,15 @@ extern WD_INFO_TABLE platform_wd_cfg; @param etr_path full path of ETR device - @return 0 - Success, NOT_IMPLEMENTED - API not implemented, Other values - Failure + @return 0 - Success, PAL_STATUS_NOT_IMPLEMENTED - API not implemented, Other values - Failure **/ uint32_t pal_smmu_is_etr_behind_catu(char *etr_path) { (void) etr_path; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -53,12 +54,13 @@ pal_smmu_is_etr_behind_catu(char *etr_path) @param None - @return 0 - Failure, NOT_IMPLEMENTED - DSM Method not implemented, Other values - PASS + @return 0 - Failure, PAL_STATUS_NOT_IMPLEMENTED - DSM Method not implemented, Other values - PASS **/ uint32_t pal_pcie_dsm_ste_tags(void) { - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -76,7 +78,8 @@ pal_pmu_check_monitor_count_value(uint64_t interface_acpiid, uint32_t count_valu (void) count_value; (void) eventid; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -97,7 +100,8 @@ pal_generate_traffic(uint64_t interface_acpiid, uint32_t pmu_node_index, (void) mon_index; (void) eventid; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -114,7 +118,8 @@ pal_pmu_get_multi_traffic_support_interface(uint64_t *interface_acpiid, (void) interface_acpiid; (void) num_traffic_type_support; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -137,7 +142,7 @@ pal_ras_check_plat_poison_support() @param in_param - Error Input Parameters. @param *out_param - Parameters returned from platform to be used in the test. - @return 0 - Success, NOT_IMPLEMENTED - API not implemented, Other values - Failure + @return 0 - Success, PAL_STATUS_NOT_IMPLEMENTED - API not implemented, Other values - Failure **/ uint32_t pal_ras_setup_error(RAS_ERR_IN_t in_param, RAS_ERR_OUT_t *out_param) @@ -147,7 +152,8 @@ pal_ras_setup_error(RAS_ERR_IN_t in_param, RAS_ERR_OUT_t *out_param) (void) in_param; (void) out_param; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -156,7 +162,7 @@ pal_ras_setup_error(RAS_ERR_IN_t in_param, RAS_ERR_OUT_t *out_param) @param in_param - Error Input Parameters. @param *out_param - Parameters returned from platform to be used in the test. - @return 0 - Success, NOT_IMPLEMENTED - API not implemented, Other values - Failure + @return 0 - Success, PAL_STATUS_NOT_IMPLEMENTED - API not implemented, Other values - Failure **/ uint32_t pal_ras_inject_error(RAS_ERR_IN_t in_param, RAS_ERR_OUT_t *out_param) @@ -164,6 +170,7 @@ pal_ras_inject_error(RAS_ERR_IN_t in_param, RAS_ERR_OUT_t *out_param) (void) in_param; (void) out_param; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } diff --git a/pal/baremetal/target/RDV3CFG1/src/pal_bsa.c b/pal/baremetal/target/RDV3CFG1/src/pal_bsa.c index b1487f5e..7c0ca4d2 100644 --- a/pal/baremetal/target/RDV3CFG1/src/pal_bsa.c +++ b/pal/baremetal/target/RDV3CFG1/src/pal_bsa.c @@ -686,7 +686,7 @@ pal_gic_free_irq ( @return - 0 : Success - - NOT_IMPLEMENTED : Feature not implemented + - PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented - non-zero : Failure (implementation-specific error code) */ uint64_t @@ -696,7 +696,8 @@ pal_smmu_pa2iova(uint64_t SmmuBase, uint64_t Pa, uint64_t *dram_buf_iova) (void) Pa; (void) dram_buf_iova; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -706,7 +707,7 @@ pal_smmu_pa2iova(uint64_t SmmuBase, uint64_t Pa, uint64_t *dram_buf_iova) @return - 0 : Success - - NOT_IMPLEMENTED : Feature not implemented + - PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented - non-zero : Failure (implementation-specific error code) **/ uint32_t pal_smmu_check_device_iova(void *port, uint64_t dma_addr) @@ -714,7 +715,8 @@ uint32_t pal_smmu_check_device_iova(void *port, uint64_t dma_addr) (void) port; (void) dma_addr; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -787,7 +789,7 @@ pal_pcie_device_driver_present(uint32_t seg, uint32_t bus, uint32_t dev, uint32_ @return - 0 : Success - - NOT_IMPLEMENTED : Feature not implemented + - PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented - non-zero : Failure (implementation-specific error code) **/ uint32_t @@ -800,7 +802,8 @@ pal_get_msi_vectors(uint32_t Seg, uint32_t Bus, uint32_t Dev, uint32_t Fn, (void) MVector; (void) Fn; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -1193,7 +1196,7 @@ pal_mem_free_cacheable(uint32_t Bdf, uint32_t Size, void *Va, void *Pa) @return - 0 : Success - - NOT_IMPLEMENTED : Feature not implemented + - PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented - non-zero : Failure (implementation-specific error code) **/ uint64_t @@ -1205,7 +1208,8 @@ pal_dma_mem_alloc(void **buffer, uint32_t length, void *dev, uint32_t flag, addr (void) dma_addr; *buffer = (void *)pal_aligned_alloc(MEM_ALIGN_4K, length); - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -1261,7 +1265,7 @@ pal_dma_scsi_get_dma_addr(void *port, void *dma_addr, unsigned int *dma_len) @return - 0 : Success - - NOT_IMPLEMENTED : Feature not implemented + - PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented - non-zero : Failure (implementation-specific error code) **/ int @@ -1275,5 +1279,6 @@ pal_dma_mem_get_attrs(void *buf, uint32_t *attr, uint32_t *sh) (void) attr; (void) sh; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } diff --git a/pal/baremetal/target/RDV3CFG1/src/pal_exerciser.c b/pal/baremetal/target/RDV3CFG1/src/pal_exerciser.c index 676eed11..6229a5d2 100644 --- a/pal/baremetal/target/RDV3CFG1/src/pal_exerciser.c +++ b/pal/baremetal/target/RDV3CFG1/src/pal_exerciser.c @@ -790,7 +790,7 @@ pal_exerciser_get_ras_status(uint32_t ras_node, uint32_t bdf, uint32_t rp_bdf) with reads @param bdf - BDF of the device @return status - 0 if implemented, else - - NOT_IMPLEMENTED + - PAL_STATUS_NOT_IMPLEMENTED **/ uint32_t pal_exerciser_set_bar_response(uint32_t bdf) diff --git a/pal/baremetal/target/RDV3CFG1/src/pal_sbsa.c b/pal/baremetal/target/RDV3CFG1/src/pal_sbsa.c index c222a003..a0dcde1f 100644 --- a/pal/baremetal/target/RDV3CFG1/src/pal_sbsa.c +++ b/pal/baremetal/target/RDV3CFG1/src/pal_sbsa.c @@ -1,6 +1,6 @@ /** @file - * Copyright (c) 2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2025-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -38,14 +38,15 @@ extern WD_INFO_TABLE platform_wd_cfg; @param etr_path full path of ETR device - @return 0 - Success, NOT_IMPLEMENTED - API not implemented, Other values - Failure + @return 0 - Success, PAL_STATUS_NOT_IMPLEMENTED - API not implemented, Other values - Failure **/ uint32_t pal_smmu_is_etr_behind_catu(char *etr_path) { (void) etr_path; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -53,12 +54,13 @@ pal_smmu_is_etr_behind_catu(char *etr_path) @param None - @return 0 - Failure, NOT_IMPLEMENTED - DSM Method not implemented, Other values - PASS + @return 0 - Failure, PAL_STATUS_NOT_IMPLEMENTED - DSM Method not implemented, Other values - PASS **/ uint32_t pal_pcie_dsm_ste_tags(void) { - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -76,7 +78,8 @@ pal_pmu_check_monitor_count_value(uint64_t interface_acpiid, uint32_t count_valu (void) count_value; (void) eventid; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -97,7 +100,8 @@ pal_generate_traffic(uint64_t interface_acpiid, uint32_t pmu_node_index, (void) mon_index; (void) eventid; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -114,7 +118,8 @@ pal_pmu_get_multi_traffic_support_interface(uint64_t *interface_acpiid, (void) interface_acpiid; (void) num_traffic_type_support; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -137,7 +142,7 @@ pal_ras_check_plat_poison_support() @param in_param - Error Input Parameters. @param *out_param - Parameters returned from platform to be used in the test. - @return 0 - Success, NOT_IMPLEMENTED - API not implemented, Other values - Failure + @return 0 - Success, PAL_STATUS_NOT_IMPLEMENTED - API not implemented, Other values - Failure **/ uint32_t pal_ras_setup_error(RAS_ERR_IN_t in_param, RAS_ERR_OUT_t *out_param) @@ -147,7 +152,8 @@ pal_ras_setup_error(RAS_ERR_IN_t in_param, RAS_ERR_OUT_t *out_param) (void) in_param; (void) out_param; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -156,7 +162,7 @@ pal_ras_setup_error(RAS_ERR_IN_t in_param, RAS_ERR_OUT_t *out_param) @param in_param - Error Input Parameters. @param *out_param - Parameters returned from platform to be used in the test. - @return 0 - Success, NOT_IMPLEMENTED - API not implemented, Other values - Failure + @return 0 - Success, PAL_STATUS_NOT_IMPLEMENTED - API not implemented, Other values - Failure **/ uint32_t pal_ras_inject_error(RAS_ERR_IN_t in_param, RAS_ERR_OUT_t *out_param) @@ -164,6 +170,7 @@ pal_ras_inject_error(RAS_ERR_IN_t in_param, RAS_ERR_OUT_t *out_param) (void) in_param; (void) out_param; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } diff --git a/pal/include/pal_status.h b/pal/include/pal_status.h new file mode 100644 index 00000000..18dfbe7a --- /dev/null +++ b/pal/include/pal_status.h @@ -0,0 +1,76 @@ + /** @file + * Copyright (c) 2026, 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 PAL_STATUS_H_ +#define PAL_STATUS_H_ + +#include + +typedef enum pal_status { + PAL_STATUS_SUCCESS = 0x00000000u, + /* Operation completed; outputs valid. */ + PAL_STATUS_FEATURE_SUPPORTED = 0x00000001u, + /* Capability present / positive probe result. */ + PAL_STATUS_FEATURE_UNSUPPORTED = 0x00000002u, + /* Capability absent / negative probe result. */ + PAL_STATUS_ERROR = 0x80000000u, + /* Generic failure when no better code fits. */ + PAL_STATUS_INVALID_PARAM = 0x80000001u, + /* Bad arguments from caller (NULL/out of range). */ + PAL_STATUS_UNSUPPORTED = 0x80000002u, + /* Platform lacks the capability; no implementation planned. */ + PAL_STATUS_NO_RESOURCE = 0x80000003u, + /* Required buffer/register/resource unavailable. */ + PAL_STATUS_BUSY = 0x80000004u, + /* Hardware or service busy; retry later. */ + PAL_STATUS_TIMEOUT = 0x80000005u, + /* Expected response not received in time. */ + PAL_STATUS_NOT_IMPLEMENTED = 0x00004B1Du + /* API stubbed for now but expected to be implemented later. */ +} pal_status_t; + +/* Backwards compatibility shim. */ +#ifndef NOT_IMPLEMENTED +#define NOT_IMPLEMENTED PAL_STATUS_NOT_IMPLEMENTED +#endif + +#define PAL_STATUS_SUCCEEDED(status) \ + ((status) == PAL_STATUS_SUCCESS) + +#define PAL_STATUS_FAILED(status) \ + (!PAL_STATUS_SUCCEEDED(status)) + +#define PAL_STATUS_IS_ERROR(status) \ + PAL_STATUS_FAILED(status) + +#define PAL_STATUS_IS_UNSUPPORTED(status) \ + ((status) == PAL_STATUS_UNSUPPORTED) + +#define PAL_STATUS_IS_NOT_IMPLEMENTED(status) \ + ((status) == PAL_STATUS_NOT_IMPLEMENTED) + +#define PAL_STATUS_IS_RETRYABLE(status) \ + ((status) == PAL_STATUS_BUSY || (status) == PAL_STATUS_TIMEOUT) + +#define PAL_STATUS_FROM_FEATURE(supported) \ + ((supported) ? PAL_STATUS_FEATURE_SUPPORTED : PAL_STATUS_FEATURE_UNSUPPORTED) + +#define PAL_STATUS_IS_FEATURE_SUPPORTED(status) \ + ((status) == PAL_STATUS_FEATURE_SUPPORTED) + +#endif /* PAL_STATUS_H_ */ diff --git a/pal/uefi_acpi/include/pal_uefi.h b/pal/uefi_acpi/include/pal_uefi.h index 3a11f5fb..cca32f41 100644 --- a/pal/uefi_acpi/include/pal_uefi.h +++ b/pal/uefi_acpi/include/pal_uefi.h @@ -18,6 +18,8 @@ #ifndef __PAL_UEFI_H__ #define __PAL_UEFI_H__ +#include "../../include/pal_status.h" + /* include ACPI specification headers */ #include "Include/Guid/Acpi.h" #include @@ -36,6 +38,7 @@ extern UINT32 g_curr_module; extern UINT32 g_enable_module; extern UINT32 g_pcie_p2p; extern UINT32 g_pcie_cache_present; +VOID pal_warn_not_implemented(const CHAR8 *api_name); #define ACS_PRINT_ERR 5 /* Only Errors. use this to de-clutter the terminal and focus only on specifics */ #define ACS_PRINT_WARN 4 /* Only warnings & errors. use this to de-clutter the terminal and focus only on specifics */ @@ -48,7 +51,6 @@ extern UINT32 g_pcie_cache_present; #define PCIE_CAP_NOT_FOUND 0x10000010 /* The specified capability was not found */ #define PCIE_UNKNOWN_RESPONSE 0xFFFFFFFF /* Function not found or UR response from completer */ -#define NOT_IMPLEMENTED 0x4B1D /* Feature or API by default unimplemented */ #define MEM_OFFSET_SMALL 0x10 /* Memory Offset from BAR base value that can be accesed*/ #define TYPE0_MAX_BARS 6 diff --git a/pal/uefi_acpi/src/pal_misc.c b/pal/uefi_acpi/src/pal_misc.c index ecd642ae..096728d7 100644 --- a/pal/uefi_acpi/src/pal_misc.c +++ b/pal/uefi_acpi/src/pal_misc.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2016-2020, 2022-2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2016-2020, 2022-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -207,6 +207,22 @@ pal_print(CHAR8 *string, UINT64 data) AsciiPrint(string, data); } +/** + @brief Emit a warning indicating the given PAL API is not implemented. + @param api_name Name of the unimplemented API (typically __func__). +**/ +VOID +pal_warn_not_implemented(const CHAR8 *api_name) +{ + if (api_name == NULL) + return; + + acs_print(ACS_PRINT_WARN, L"\n %a is not implemented." + "\n Please implement the PAL function in test suite or" + "\n conduct an offline review for this rule.\n", + api_name); +} + /** @brief Sends a string to the output console without using UEFI print function This function will get COMM port address and directly writes to the addr char-by-char diff --git a/pal/uefi_acpi/src/pal_nist.c b/pal/uefi_acpi/src/pal_nist.c index 02828739..71956591 100644 --- a/pal/uefi_acpi/src/pal_nist.c +++ b/pal/uefi_acpi/src/pal_nist.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2024-2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2024-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -26,6 +26,7 @@ UINT32 pal_nist_generate_rng(UINT32 *rng_buffer) { - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } diff --git a/pal/uefi_acpi/src/pal_pcie.c b/pal/uefi_acpi/src/pal_pcie.c index e4ba3ce5..9638e953 100644 --- a/pal/uefi_acpi/src/pal_pcie.c +++ b/pal/uefi_acpi/src/pal_pcie.c @@ -350,11 +350,13 @@ pal_pcie_p2p_support() * This is platform specific API which needs to be populated with system p2p capability * PCIe support for peer to peer * transactions is platform implementation specific - */ + */ if (g_pcie_p2p) return 0; - else - return NOT_IMPLEMENTED; + else { + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; + } } /** @@ -396,7 +398,7 @@ pal_pcie_dev_p2p_support ( @return - 0 : Success - - NOT_IMPLEMENTED : Feature not implemented + - PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented - non-zero : Failure (implementation-specific error code) **/ UINT32 @@ -408,7 +410,8 @@ pal_get_msi_vectors ( PERIPHERAL_VECTOR_LIST **MVector ) { - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -422,7 +425,7 @@ pal_get_msi_vectors ( @return irq_map IRQ routing map @return status code If the device legacy irq map information is filled - return 0, else returns NOT_IMPLEMENTED + return 0, else returns PAL_STATUS_NOT_IMPLEMENTED **/ UINT32 pal_pcie_get_legacy_irq_map ( @@ -433,7 +436,8 @@ pal_pcie_get_legacy_irq_map ( PERIPHERAL_IRQ_MAP *IrqMap ) { - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** Place holder function. Need to be implemented if needed in later releases @@ -481,8 +485,10 @@ pal_pcie_is_cache_present ( { if (g_pcie_cache_present) return 1; - else - return NOT_IMPLEMENTED; + else { + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; + } } /** diff --git a/pal/uefi_acpi/src/pal_pmu.c b/pal/uefi_acpi/src/pal_pmu.c index 422ab706..b2adc0b3 100644 --- a/pal/uefi_acpi/src/pal_pmu.c +++ b/pal/uefi_acpi/src/pal_pmu.c @@ -172,14 +172,19 @@ pal_pmu_get_event_info(UINT32 node_index, PMU_EVENT_TYPE_e event_type, PMU_NODE_ @brief This API checks if pmu monitor count value is valid @param interface_acpiid - acpiid of interface @param count_value - monitor count value - @param eventid - eventid - @return 0 - monitor count value is valid - non-zero - error or invallid count value + @param eventid - eventid + @return PAL_STATUS_SUCCESS when the value is valid, + PAL_STATUS_NOT_IMPLEMENTED when platform-specific validation is absent. **/ UINT32 pal_pmu_check_monitor_count_value(UINT64 interface_acpiid, UINT32 count_value, UINT32 eventid) { - return NOT_IMPLEMENTED; + (void) interface_acpiid; + (void) count_value; + (void) eventid; + + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -188,26 +193,37 @@ pal_pmu_check_monitor_count_value(UINT64 interface_acpiid, UINT32 count_value, U @param pmu_node_index - pmu node index @param mon_index - monitor index @param eventid - eventid - @return 0 - success status - non-zero - error status + @return PAL_STATUS_SUCCESS on success, + PAL_STATUS_NOT_IMPLEMENTED if traffic generation is not available. **/ UINT32 pal_generate_traffic(UINT64 interface_acpiid, UINT32 pmu_node_index, UINT32 mon_index, UINT32 eventid) { - return NOT_IMPLEMENTED; + (void) interface_acpiid; + (void) pmu_node_index; + (void) mon_index; + (void) eventid; + + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @brief This API checks if PMU node is secure only. @param interface_acpiid - acpiid of interface @param num_traffic_type_support - num of traffic type supported. - @return 0 - success status - non-zero - error status + @return PAL_STATUS_SUCCESS on success, + PAL_STATUS_INVALID_PARAM for bad pointers, + PAL_STATUS_NOT_IMPLEMENTED if the capability is not yet provided. **/ UINT32 pal_pmu_get_multi_traffic_support_interface(UINT64 *interface_acpiid, UINT32 *num_traffic_type_support) { - return NOT_IMPLEMENTED; + if ((interface_acpiid == NULL) || (num_traffic_type_support == NULL)) + return PAL_STATUS_INVALID_PARAM; + + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } diff --git a/pal/uefi_acpi/src/pal_ras.c b/pal/uefi_acpi/src/pal_ras.c index b08e012d..c00fc227 100644 --- a/pal/uefi_acpi/src/pal_ras.c +++ b/pal/uefi_acpi/src/pal_ras.c @@ -49,27 +49,42 @@ pal_ras_check_plat_poison_support() @param in_param - Error Input Parameters. @param *out_param - Parameters returned from platform to be used in the test. - @return 0 - Success, NOT_IMPLEMENTED - API not implemented, Other values - Failure + @return PAL_STATUS_SUCCESS if setup completed, + PAL_STATUS_INVALID_PARAM for bad pointers, + PAL_STATUS_NOT_IMPLEMENTED while platform support is pending. **/ UINT32 pal_ras_setup_error(RAS_ERR_IN_t in_param, RAS_ERR_OUT_t *out_param) { - /* Platform Defined way of setting up the Error Environment */ - return NOT_IMPLEMENTED; + (void) in_param; + + if (out_param == NULL) + return PAL_STATUS_INVALID_PARAM; + + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** - @brief Platform Defined way of injecting up the Error Environment + @brief Platform Defined way of injecting the Error Environment @param in_param - Error Input Parameters. @param *out_param - Parameters returned from platform to be used in the test. - @return 0 - Success, NOT_IMPLEMENTED - API not implemented, Other values - Failure + @return PAL_STATUS_SUCCESS if injection completed, + PAL_STATUS_INVALID_PARAM for bad pointers, + PAL_STATUS_NOT_IMPLEMENTED while platform support is pending. **/ UINT32 pal_ras_inject_error(RAS_ERR_IN_t in_param, RAS_ERR_OUT_t *out_param) { - return NOT_IMPLEMENTED; + (void) in_param; + + if (out_param == NULL) + return PAL_STATUS_INVALID_PARAM; + + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** diff --git a/pal/uefi_acpi/src/pal_smmu.c b/pal/uefi_acpi/src/pal_smmu.c index 7d144b1e..fcea42fa 100644 --- a/pal/uefi_acpi/src/pal_smmu.c +++ b/pal/uefi_acpi/src/pal_smmu.c @@ -26,7 +26,7 @@ @return - 0 : Success - - NOT_IMPLEMENTED : Feature not implemented + - PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented - non-zero : Failure (implementation-specific error code) */ UINT64 @@ -35,5 +35,6 @@ pal_smmu_pa2iova( UINT64 Pa, UINT64 *dram_buf_iova ) { - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } diff --git a/pal/uefi_dt/include/pal_uefi.h b/pal/uefi_dt/include/pal_uefi.h index 83064801..f7a49c40 100644 --- a/pal/uefi_dt/include/pal_uefi.h +++ b/pal/uefi_dt/include/pal_uefi.h @@ -18,6 +18,8 @@ #ifndef __PAL_UEFI_H__ #define __PAL_UEFI_H__ +#include "../../include/pal_status.h" + extern VOID* g_acs_log_file_handle; extern UINT32 g_print_level; extern UINT32 g_print_mmio; @@ -25,6 +27,7 @@ extern UINT32 g_curr_module; extern UINT32 g_enable_module; extern UINT32 g_pcie_p2p; extern UINT32 g_pcie_cache_present; +VOID pal_warn_not_implemented(const CHAR8 *api_name); #define ACS_PRINT_ERR 5 /* Only Errors. use this to de-clutter the terminal and focus only on specifics */ #define ACS_PRINT_WARN 4 /* Only warnings & errors. use this to de-clutter the terminal and focus only on specifics */ @@ -37,7 +40,6 @@ extern UINT32 g_pcie_cache_present; #define PCIE_CAP_NOT_FOUND 0x10000010 /* The specified capability was not found */ #define PCIE_UNKNOWN_RESPONSE 0xFFFFFFFF /* Function not found or UR response from completer */ -#define NOT_IMPLEMENTED 0x4B1D /* Feature or API by default unimplemented */ #define MEM_OFFSET_SMALL 0x10 /* Memory Offset from BAR base value that can be accesed*/ #define TYPE0_MAX_BARS 6 diff --git a/pal/uefi_dt/src/pal_misc.c b/pal/uefi_dt/src/pal_misc.c index ab9b621d..152a930f 100644 --- a/pal/uefi_dt/src/pal_misc.c +++ b/pal/uefi_dt/src/pal_misc.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2016-2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2016-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -208,6 +208,22 @@ pal_print(CHAR8 *string, UINT64 data) AsciiPrint(string, data); } +/** + @brief Emit a warning indicating the given PAL API is not implemented. + @param api_name Name of the unimplemented API (typically __func__). +**/ +VOID +pal_warn_not_implemented(const CHAR8 *api_name) +{ + if (api_name == NULL) + return; + + acs_print(ACS_PRINT_WARN, L"\n %a is not implemented." + "\n Please implement the PAL function in test suite or" + "\n conduct an offline review for this rule.\n", + api_name); +} + /** @brief Sends a string to the output console without using UEFI print function This function will get COMM port address and directly writes to the addr char-by-char diff --git a/pal/uefi_dt/src/pal_pcie.c b/pal/uefi_dt/src/pal_pcie.c index 4bcd944d..c41fae7a 100644 --- a/pal/uefi_dt/src/pal_pcie.c +++ b/pal/uefi_dt/src/pal_pcie.c @@ -351,11 +351,13 @@ pal_pcie_p2p_support() * This is platform specific API which needs to be populated with system p2p capability * PCIe support for peer to peer * transactions is platform implementation specific - */ + */ if (g_pcie_p2p) return 0; - else - return NOT_IMPLEMENTED; + else { + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; + } } /** @@ -395,7 +397,7 @@ pal_pcie_dev_p2p_support ( @return - 0 : Success - - NOT_IMPLEMENTED : Feature not implemented + - PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented - non-zero : Failure (implementation-specific error code) **/ UINT32 @@ -407,7 +409,8 @@ pal_get_msi_vectors ( PERIPHERAL_VECTOR_LIST **MVector ) { - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** @@ -421,7 +424,7 @@ pal_get_msi_vectors ( @return irq_map IRQ routing map @return status code If the device legacy irq map information is filled - return 0, else returns NOT_IMPLEMENTED + return 0, else returns PAL_STATUS_NOT_IMPLEMENTED **/ UINT32 pal_pcie_get_legacy_irq_map ( @@ -432,7 +435,8 @@ pal_pcie_get_legacy_irq_map ( PERIPHERAL_IRQ_MAP *IrqMap ) { - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** Place holder function. Need to be implemented if needed in later releases @@ -474,8 +478,10 @@ pal_pcie_is_cache_present ( { if (g_pcie_cache_present) return 1; - else - return NOT_IMPLEMENTED; + else { + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; + } } /** diff --git a/pal/uefi_dt/src/pal_peripherals.c b/pal/uefi_dt/src/pal_peripherals.c index 9f386acb..a20c5ec0 100644 --- a/pal/uefi_dt/src/pal_peripherals.c +++ b/pal/uefi_dt/src/pal_peripherals.c @@ -811,7 +811,8 @@ pal_memory_ioremap(VOID *ptr, UINT32 size, UINT32 attr, VOID **baseptr) { *baseptr = ptr; - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } /** diff --git a/pal/uefi_dt/src/pal_smmu.c b/pal/uefi_dt/src/pal_smmu.c index 0e666e35..058177db 100644 --- a/pal/uefi_dt/src/pal_smmu.c +++ b/pal/uefi_dt/src/pal_smmu.c @@ -27,7 +27,7 @@ @return - 0 : Success - - NOT_IMPLEMENTED : Feature not implemented + - PAL_STATUS_NOT_IMPLEMENTED : Feature not implemented - non-zero : Failure (implementation-specific error code) */ UINT64 @@ -36,5 +36,6 @@ pal_smmu_pa2iova( UINT64 Pa, UINT64 *dram_buf_iova ) { - return NOT_IMPLEMENTED; + pal_warn_not_implemented(__func__); + return PAL_STATUS_NOT_IMPLEMENTED; } diff --git a/test_pool/exerciser/e017.c b/test_pool/exerciser/e017.c index 060d21d4..7d8557b7 100644 --- a/test_pool/exerciser/e017.c +++ b/test_pool/exerciser/e017.c @@ -166,11 +166,9 @@ payload(void *arg) status = val_smmu_pa2iova(smmu_index, (uint64_t)dram_buf_phys, (uint64_t *)&dram_buf_iova); - if (status == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_ERR, - "\n pal_smmu_pa2iova is unimplemented, Skipping test.", 0); + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) goto test_skip_unimplemented; - } + /* * Issue a Memory Read request from exerciser to cause unsupported * request detected bit set in exercise's Device Status Register. @@ -224,7 +222,7 @@ payload(void *arg) val_pcie_enable_bme(erp_bdf); /* Return the buffer to the heap manager */ val_memory_free_pages(dram_buf_virt, TEST_DATA_NUM_PAGES); - val_set_status(pe_index, RESULT_SKIP(test_data->test_num, 02)); + val_set_status(pe_index, RESULT_WARN(test_data->test_num, 02)); } uint32_t diff --git a/test_pool/nist_sts/test_n001.c b/test_pool/nist_sts/test_n001.c index 64b25e79..75b42a3a 100644 --- a/test_pool/nist_sts/test_n001.c +++ b/test_pool/nist_sts/test_n001.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2020, 2023-2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2020, 2023-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); diff --git a/test_pool/pcie/p019.c b/test_pool/pcie/p019.c index 237f6cbe..5ef6b47f 100644 --- a/test_pool/pcie/p019.c +++ b/test_pool/pcie/p019.c @@ -43,11 +43,11 @@ payload(void) pe_index = val_pe_get_index_mpid(val_pe_get_mpid()); /* Check If PCIe Hierarchy supports P2P */ - if (val_pcie_p2p_support() == NOT_IMPLEMENTED) { + if (val_pcie_p2p_support() == ACS_STATUS_PAL_NOT_IMPLEMENTED) { val_print(ACS_PRINT_DEBUG, "\n The test is applicable only if the system supports", 0); val_print(ACS_PRINT_DEBUG, "\n P2P traffic. If the system supports P2P, pass the", 0); val_print(ACS_PRINT_DEBUG, "\n command line option '-p2p' while running the binary", 0); - val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 1)); + val_set_status(pe_index, RESULT_WARN(TEST_NUM, 1)); return; } diff --git a/val/include/val_interface.h b/val/include/val_interface.h index 48df3d58..d163d652 100644 --- a/val/include/val_interface.h +++ b/val/include/val_interface.h @@ -38,7 +38,10 @@ #define ACS_INVALID_INDEX 0xFFFFFFFF #define ACS_STATUS_UNKNOWN 0xFFFFFFFF -#define NOT_IMPLEMENTED 0x4B1D /* Feature or API not implemented */ +#define ACS_STATUS_PAL_NOT_IMPLEMENTED 0x4B1D /* PAL reports feature/API not implemented */ +#ifndef NOT_IMPLEMENTED +#define NOT_IMPLEMENTED ACS_STATUS_PAL_NOT_IMPLEMENTED +#endif #define VAL_EXTRACT_BITS(data, start, end) ((data >> start) & ((1ul << (end-start+1))-1)) From a26a8e3c68d544581db7ca859b8079dcf644c1d8 Mon Sep 17 00:00:00 2001 From: Shanmuga Priya L Date: Fri, 20 Feb 2026 09:36:05 +0000 Subject: [PATCH 2/3] refactor(pal): standardize PAL_NOT_IMPLEMENTED handling - Replace NOT_IMPLEMENTED checks with ACS_STATUS_PAL_NOT_IMPLEMENTED across test cases to align with updated PAL status definitions. - Convert RESULT_SKIP to RESULT_WARN where PAL interfaces are unimplemented - Introduce warn counters in RAS tests to distinguish warnings from functional failures Signed-off-by: Shanmuga Priya L Change-Id: I97618265d943ad5876859e2e96926baac873298b --- pal/baremetal/target/RDN2/src/pal_bsa.c | 1 - pal/baremetal/target/RDV3/src/pal_bsa.c | 1 - pal/baremetal/target/RDV3CFG1/src/pal_bsa.c | 1 - test_pool/exerciser/e003.c | 36 ++++++++--------- test_pool/exerciser/e016.c | 12 +++--- test_pool/exerciser/e021.c | 28 +++++++------ test_pool/exerciser/e039.c | 12 +++--- test_pool/pcie/p045.c | 27 ++++++++----- test_pool/pcie/p046.c | 11 +++--- test_pool/pcie/p091.c | 7 ++-- test_pool/pcie/p094.c | 27 ++++++++----- test_pool/pcie/p095.c | 10 ++--- test_pool/pcie/p097.c | 18 ++++----- test_pool/pcie/p105.c | 16 +++----- test_pool/peripherals/d004.c | 37 +++++++---------- test_pool/pmu/pmu009.c | 16 +++++--- test_pool/ras/ras005.c | 29 +++++++------- test_pool/ras/ras006.c | 27 ++++++++----- test_pool/ras/ras009.c | 25 +++++++----- test_pool/ras/ras011.c | 44 +++++++++++++++------ test_pool/ras/ras012.c | 34 ++++++++++------ test_pool/ras/ras018.c | 21 +++++----- test_pool/smmu/i023.c | 6 +-- 23 files changed, 244 insertions(+), 202 deletions(-) diff --git a/pal/baremetal/target/RDN2/src/pal_bsa.c b/pal/baremetal/target/RDN2/src/pal_bsa.c index a953c4ea..7670dfe5 100644 --- a/pal/baremetal/target/RDN2/src/pal_bsa.c +++ b/pal/baremetal/target/RDN2/src/pal_bsa.c @@ -728,7 +728,6 @@ pal_pcie_p2p_support(void) // in the PCIe platform configuration return 0; - } /** diff --git a/pal/baremetal/target/RDV3/src/pal_bsa.c b/pal/baremetal/target/RDV3/src/pal_bsa.c index 01128946..edef6307 100644 --- a/pal/baremetal/target/RDV3/src/pal_bsa.c +++ b/pal/baremetal/target/RDV3/src/pal_bsa.c @@ -757,7 +757,6 @@ pal_pcie_p2p_support(void) // in the PCIe platform configuration return 0; - } /** diff --git a/pal/baremetal/target/RDV3CFG1/src/pal_bsa.c b/pal/baremetal/target/RDV3CFG1/src/pal_bsa.c index 7c0ca4d2..5e695a27 100644 --- a/pal/baremetal/target/RDV3CFG1/src/pal_bsa.c +++ b/pal/baremetal/target/RDV3CFG1/src/pal_bsa.c @@ -757,7 +757,6 @@ pal_pcie_p2p_support(void) // in the PCIe platform configuration return 0; - } /** diff --git a/test_pool/exerciser/e003.c b/test_pool/exerciser/e003.c index 122ae66c..94ef4ad4 100644 --- a/test_pool/exerciser/e003.c +++ b/test_pool/exerciser/e003.c @@ -34,6 +34,7 @@ static uint32_t transaction_order[] = {1, 1, 0, 1, 0, 0, 0, 0}; static uint32_t pattern[16] = {0}; static uint32_t run_flag; static uint32_t fail_cnt; +static uint32_t warn_cnt; static uint32_t read_config_space(uint32_t *addr) { @@ -247,11 +248,10 @@ cfgspace_transactions_order_check(void) /* Map config space to ARM device memory in MMU page tables */ status = val_memory_ioremap((void *)bdf_addr, 512, DEVICE_nGnRnE, (void **)&baseptr); - /* Handle unimplemented PAL -> SKIP gracefully */ - if (status == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_ERR, - "\n pal_memory_ioremap not implemented, skipping test.", 0); - goto test_skip_unimplemented; + /* Handle unimplemented PAL -> Report WARN */ + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + warn_cnt++; + goto test_warn_unimplemented; } if (status) { @@ -273,7 +273,7 @@ cfgspace_transactions_order_check(void) fail_cnt += test_sequence_4B((uint32_t *)baseptr, 0, instance); } -test_skip_unimplemented: +test_warn_unimplemented: return; } @@ -323,11 +323,10 @@ barspace_transactions_order_check(void) status = val_memory_ioremap((void *)e_data.bar_space.base_addr, 512, DEVICE_nGnRnE, (void **)&baseptr); - /* Handle unimplemented PAL -> SKIP gracefully */ - if (status == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_ERR, - "\n pal_memory_ioremap not implemented, skipping test.", 0); - goto test_skip_unimplemented; + /* Handle unimplemented PAL -> Report WARN */ + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + warn_cnt++; + goto test_warn_unimplemented; } if (status) { @@ -348,7 +347,7 @@ barspace_transactions_order_check(void) fail_cnt += test_sequence_4B((uint32_t *)baseptr, 0, instance); fail_cnt += test_sequence_8B((uint64_t *)baseptr, 0, instance); } -test_skip_unimplemented: +test_warn_unimplemented: return; } @@ -372,15 +371,16 @@ payload(void) cfgspace_transactions_order_check(); barspace_transactions_order_check(); - if (!run_flag) { - val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 2)); - return; - } - - if (fail_cnt) + if (warn_cnt) + val_set_status(pe_index, RESULT_WARN(TEST_NUM, 1)); + else if (!run_flag) + val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 2)); + else if (fail_cnt) val_set_status(pe_index, RESULT_FAIL(TEST_NUM, fail_cnt)); else val_set_status(pe_index, RESULT_PASS(TEST_NUM, 1)); + + return; } uint32_t diff --git a/test_pool/exerciser/e016.c b/test_pool/exerciser/e016.c index de0af188..297accc8 100644 --- a/test_pool/exerciser/e016.c +++ b/test_pool/exerciser/e016.c @@ -101,11 +101,9 @@ payload(void) 512, ARM_DEVICE_MEM_ARRAY[idx], (void **)&baseptr); - /* Handle unimplemented PAL -> SKIP gracefully */ - if (status == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_ERR, - "\n pal_memory_ioremap not implemented, skipping test.", 0); - goto test_skip_unimplemented; + /* Handle unimplemented PAL -> Report WARN */ + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + goto test_warn_unimplemented; } if (status) { @@ -140,9 +138,9 @@ payload(void) val_set_status(pe_index, RESULT_PASS(TEST_NUM, 01)); return; -test_skip_unimplemented: +test_warn_unimplemented: val_memory_unmap(baseptr); - val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 01)); + val_set_status(pe_index, RESULT_WARN(TEST_NUM, 01)); return; test_fail: diff --git a/test_pool/exerciser/e021.c b/test_pool/exerciser/e021.c index 8b169eaa..5553de6b 100644 --- a/test_pool/exerciser/e021.c +++ b/test_pool/exerciser/e021.c @@ -33,6 +33,7 @@ static uint32_t transaction_order[] = {1, 1, 0, 1, 0, 0, 0, 0}; static uint32_t pattern[16] = {0}; static uint32_t run_flag; static uint32_t fail_cnt; +static uint32_t warn_cnt; static uint32_t read_config_space(uint32_t *addr) { @@ -307,11 +308,10 @@ cfgspace_transactions_order_check(void) /* Map config space to ARM device(nGnRnE) memory in MMU page tables */ status = val_memory_ioremap((void *)bdf_addr, 512, DEVICE_nGnRnE, (void **)&baseptr); - /* Handle unimplemented PAL -> SKIP gracefully */ - if (status == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_ERR, - "\n pal_memory_ioremap not implemented, skipping test.", 0); - goto test_skip_unimplemented; + /* Handle unimplemented PAL -> Report WARN */ + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + warn_cnt++; + goto test_warn_unimplemented; } if (status) { @@ -339,7 +339,7 @@ cfgspace_transactions_order_check(void) cfgspace_test_sequence((uint32_t *)baseptr, instance); } -test_skip_unimplemented: +test_warn_unimplemented: return; } @@ -390,11 +390,10 @@ barspace_transactions_order_check(void) status = val_memory_ioremap((void *)e_data.bar_space.base_addr, 512, DEVICE_nGnRnE, (void **)&baseptr); - /* Handle unimplemented PAL -> SKIP gracefully */ - if (status == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_ERR, - "\n pal_memory_ioremap not implemented, skipping test.", 0); - goto test_skip_unimplemented; + /* Handle unimplemented PAL -> Report WARN */ + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + warn_cnt++; + goto test_warn_unimplemented; } if (status) { @@ -420,7 +419,7 @@ barspace_transactions_order_check(void) } -test_skip_unimplemented: +test_warn_unimplemented: return; } @@ -436,7 +435,10 @@ payload(void) cfgspace_transactions_order_check(); barspace_transactions_order_check(); - if (!run_flag) { + if (warn_cnt) { + val_set_status(pe_index, RESULT_WARN(TEST_NUM, 1)); + return; + } else if (!run_flag) { val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 01)); return; } diff --git a/test_pool/exerciser/e039.c b/test_pool/exerciser/e039.c index 035dc30b..08ea99f6 100644 --- a/test_pool/exerciser/e039.c +++ b/test_pool/exerciser/e039.c @@ -104,11 +104,9 @@ payload(void) status = val_memory_ioremap((void *)e_data.bar_space.base_addr, 512, ARM_NORMAL_MEM_ARRAY[idx], (void **)&baseptr); - /* Handle unimplemented PAL -> SKIP gracefully */ - if (status == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_ERR, - "\n pal_memory_ioremap not implemented, skipping test.", 0); - goto test_skip_unimplemented; + /* Handle unimplemented PAL -> Report WARN */ + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + goto test_warn_unimplemented; } if (status) { @@ -145,9 +143,9 @@ payload(void) val_set_status(pe_index, RESULT_PASS(TEST_NUM, 01)); return; - test_skip_unimplemented: +test_warn_unimplemented: val_memory_unmap(baseptr); - val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 02)); + val_set_status(pe_index, RESULT_WARN(TEST_NUM, 01)); return; test_fail: diff --git a/test_pool/pcie/p045.c b/test_pool/pcie/p045.c index 31fad2e8..c1146611 100644 --- a/test_pool/pcie/p045.c +++ b/test_pool/pcie/p045.c @@ -65,7 +65,9 @@ payload(void) char *baseptr; uint32_t index = val_pe_get_index_mpid(val_pe_get_mpid()); uint32_t test_skip = 1; + uint32_t test_warn = 1; uint32_t test_fail = 0; + uint32_t test_abort = 0; uint64_t offset; uint64_t base; pcie_device_bdf_table *bdf_tbl_ptr; @@ -205,16 +207,17 @@ payload(void) branch_to_test = &&exception_return_device; + test_skip = 0; + /* Map the BARs to a DEVICE memory (non-cachable) attribute * and check transaction. */ status = val_memory_ioremap((void *)base, 1024, DEVICE_nGnRnE, (void **)&baseptr); - /* Handle unimplemented PAL -> SKIP gracefully */ - if (status == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_ERR, - "\n pal_memory_ioremap not implemented, skipping test.", 0); - goto test_skip_unimplemented; + /* Handle unimplemented PAL -> Report WARN */ + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + test_abort = 1; + break; } else if (status) { val_print(ACS_PRINT_ERR, "\n Failed in ioremap with status %x", status); @@ -223,7 +226,7 @@ payload(void) goto next_bar; } - test_skip = 0; + test_warn = 0; /* Access check. Not performing data comparison check. */ old_data = *(uint32_t *)(baseptr); @@ -252,13 +255,17 @@ payload(void) if (msa_en) val_pcie_disable_msa(bdf); } + + if (test_abort == 1) + break; } - if (test_skip) { -test_skip_unimplemented: - val_set_status(index, RESULT_SKIP(test_num, 0)); + if (test_warn) { + val_set_status(index, RESULT_WARN(test_num, 0)); return; - } else if (test_fail) + } else if (test_skip) + val_set_status(index, RESULT_SKIP(test_num, 1)); + else if (test_fail) val_set_status(index, RESULT_FAIL(test_num, test_fail)); else val_set_status(index, RESULT_PASS(test_num, 0)); diff --git a/test_pool/pcie/p046.c b/test_pool/pcie/p046.c index 0fd71032..91f0e570 100644 --- a/test_pool/pcie/p046.c +++ b/test_pool/pcie/p046.c @@ -107,10 +107,9 @@ payload (void) /* Read MSI(X) vectors */ ret = val_get_msi_vectors (dev_bdf, &dev_mvec); - if (ret == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_ERR, - "\n pal_get_msi_vectors is unimplemented, Skipping test.", 0); - goto test_skip_unimplemented; + if (ret == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + clean_msi_list (dev_mvec); + goto test_warn_unimplemented; } if (ret) { @@ -145,8 +144,8 @@ payload (void) } return; -test_skip_unimplemented: - val_set_status(index, RESULT_SKIP(TEST_NUM, 1)); +test_warn_unimplemented: + val_set_status(index, RESULT_WARN(TEST_NUM, 1)); } uint32_t diff --git a/test_pool/pcie/p091.c b/test_pool/pcie/p091.c index ebb2718c..6b847a82 100644 --- a/test_pool/pcie/p091.c +++ b/test_pool/pcie/p091.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2024-2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2024-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -36,9 +36,8 @@ payload(void) val_print(ACS_PRINT_DEBUG, "\n STE tag value is %x", status); - if (status == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_DEBUG, "\n DSM method for STE not implemented\n", 0); - val_set_status(index, RESULT_SKIP(TEST_NUM, 0)); + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + val_set_status(index, RESULT_WARN(TEST_NUM, 0)); } else if (status == 0) { val_print(ACS_PRINT_ERR, "\n STE tag value should not be 0\n", 0); diff --git a/test_pool/pcie/p094.c b/test_pool/pcie/p094.c index 17dca359..0baef8f1 100644 --- a/test_pool/pcie/p094.c +++ b/test_pool/pcie/p094.c @@ -66,7 +66,9 @@ payload(void) char *baseptr; uint32_t index = val_pe_get_index_mpid(val_pe_get_mpid()); uint32_t test_skip = 1; + uint32_t test_warn = 1; uint32_t test_fail = 0; + uint32_t test_abort = 0; uint64_t offset; uint64_t base; pcie_device_bdf_table *bdf_tbl_ptr; @@ -206,14 +208,15 @@ payload(void) branch_to_test = &&exception_return_normal; + test_skip = 0; + /* Map the BARs to a NORMAL memory attribute. check unaligned access */ status = val_memory_ioremap((void *)base, 1024, NORMAL_NC, (void **)&baseptr); - /* Handle unimplemented PAL -> SKIP gracefully */ - if (status == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_ERR, - "\n pal_memory_ioremap not implemented, skipping test.", 0); - goto test_skip_unimplemented; + /* Handle unimplemented PAL -> Report WARN */ + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + test_abort = 1; + break; } else if (status) { @@ -224,7 +227,7 @@ payload(void) goto next_bar; } - test_skip = 0; + test_warn = 0; /* Check for unaligned access. Normal memory can be read-only. * Not performing data comparison check. @@ -257,13 +260,17 @@ payload(void) if (msa_en) val_pcie_disable_msa(bdf); } + + if (test_abort == 1) + break; } - if (test_skip) { -test_skip_unimplemented: - val_set_status(index, RESULT_SKIP(test_num, 0)); + if (test_warn) { + val_set_status(index, RESULT_WARN(test_num, 0)); return; - } else if (test_fail) + } else if (test_skip) + val_set_status(index, RESULT_FAIL(test_num, 1)); + else if (test_fail) val_set_status(index, RESULT_FAIL(test_num, test_fail)); else val_set_status(index, RESULT_PASS(test_num, 0)); diff --git a/test_pool/pcie/p095.c b/test_pool/pcie/p095.c index bf34baee..e368ec4f 100644 --- a/test_pool/pcie/p095.c +++ b/test_pool/pcie/p095.c @@ -63,10 +63,8 @@ payload(void) } status = val_smmu_ops(SMMU_CHECK_DEVICE_IOVA, &target_dev_index, &dma_addr); if (status) { - if (status == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_ERR, - "\n pal_smmu_check_device_iova is unimplemented, Skipping test.", 0); - goto test_skip_unimplemented; + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + goto test_warn_unimplemented; } val_print(ACS_PRINT_ERR, "\n The DMA address %lx used by device ", dma_addr); val_print(ACS_PRINT_ERR, "\n is not present in the SMMU IOVA table\n", 0); @@ -82,8 +80,8 @@ payload(void) val_set_status(index, RESULT_SKIP(TEST_NUM, 2)); return; -test_skip_unimplemented: - val_set_status(index, RESULT_SKIP(TEST_NUM, 3)); +test_warn_unimplemented: + val_set_status(index, RESULT_WARN(TEST_NUM, 1)); } diff --git a/test_pool/pcie/p097.c b/test_pool/pcie/p097.c index e5b9cc62..a877f08d 100644 --- a/test_pool/pcie/p097.c +++ b/test_pool/pcie/p097.c @@ -170,10 +170,9 @@ payload (void) ret = val_get_msi_vectors (current_dev_bdf, ¤t_dev_mvec); - if (ret == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_ERR, - "\n pal_get_msi_vectors is unimplemented, Skipping test.", 0); - goto test_skip_unimplemented; + if (ret == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + clean_msi_list (current_dev_mvec); + goto test_warn_unimplemented; } if (ret) { @@ -218,10 +217,9 @@ payload (void) /* Read MSI(X) vectors */ ret = val_get_msi_vectors (next_dev_bdf, &next_dev_mvec); - if (ret == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_ERR, - "\n pal_get_msi_vectors is unimplemented, Skipping test.", 0); - goto test_skip_unimplemented; + if (ret == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + clean_msi_list (next_dev_mvec); + goto test_warn_unimplemented; } if (ret) { @@ -257,8 +255,8 @@ payload (void) } return; -test_skip_unimplemented: - val_set_status(index, RESULT_SKIP(TEST_NUM, 02)); +test_warn_unimplemented: + val_set_status(index, RESULT_WARN(TEST_NUM, 01)); } uint32_t diff --git a/test_pool/pcie/p105.c b/test_pool/pcie/p105.c index d2580a14..133cad55 100644 --- a/test_pool/pcie/p105.c +++ b/test_pool/pcie/p105.c @@ -56,17 +56,13 @@ payload(void) iommu_flag++; /* Allocate DMA-able memory region in DDR */ status = val_dma_mem_alloc(&buffer, 512, target_dev_index, DMA_COHERENT, &dma_addr); - if (status == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_ERR, - "\n pal_dma_mem_alloc is unimplemented, Skipping test.", 0); - goto test_skip_unimplemented; + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + goto test_warn_unimplemented; } status = val_smmu_ops(SMMU_CHECK_DEVICE_IOVA, &target_dev_index, &dma_addr); if (status) { - if (status == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_ERR, - "\n pal_smmu_check_device_iova is unimplemented, Skipping test.", 0); - goto test_skip_unimplemented; + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + goto test_warn_unimplemented; } val_print(ACS_PRINT_ERR, "\n The DMA addr allocated to device %d ", target_dev_index); @@ -85,8 +81,8 @@ payload(void) val_set_status(index, RESULT_SKIP(TEST_NUM, 2)); return; -test_skip_unimplemented: - val_set_status(index, RESULT_SKIP(TEST_NUM, 3)); +test_warn_unimplemented: + val_set_status(index, RESULT_WARN(TEST_NUM, 1)); } diff --git a/test_pool/peripherals/d004.c b/test_pool/peripherals/d004.c index f5c3b682..18f8ac73 100644 --- a/test_pool/peripherals/d004.c +++ b/test_pool/peripherals/d004.c @@ -64,26 +64,20 @@ payload_check_dma_mem_attribute(void) if (val_dma_get_info(DMA_HOST_COHERENT, target_dev_index)) { status = val_dma_mem_alloc(&buffer, 512, target_dev_index, DMA_COHERENT, &dma_addr); - if (status == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_ERR, - "\n pal_dma_mem_alloc is unimplemented, Skipping test.", 0); - goto test_skip_unimplemented; + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + goto test_warn_unimplemented; } } else { status = val_dma_mem_alloc(&buffer, 512, target_dev_index, DMA_NOT_COHERENT, &dma_addr); - if (status == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_ERR, - "\n pal_dma_mem_alloc is unimplemented, Skipping test.", 0); - goto test_skip_unimplemented; + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + goto test_warn_unimplemented; } } ret = val_dma_mem_get_attrs(buffer, &attr, &sh); if (ret) { - if (ret == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_ERR, - "\n pal_dma_mem_get_attrs is unimplemented, Skipping test.", 0); - goto test_skip_unimplemented; + if (ret == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + goto test_warn_unimplemented; } val_print(ACS_PRINT_ERR, "\n DMA controller %d: Failed to get" @@ -112,8 +106,8 @@ payload_check_dma_mem_attribute(void) val_set_status(index, RESULT_PASS(TEST_NUM, 0)); return; -test_skip_unimplemented: - val_set_status(index, RESULT_SKIP(TEST_NUM, 2)); +test_warn_unimplemented: + val_set_status(index, RESULT_WARN(TEST_NUM, 1)); } /* This test verifies I/O coherent DMA traffic must have the attribute @@ -148,14 +142,13 @@ payload_check_io_coherent_dma_mem_attribute(void) if (val_dma_get_info(DMA_HOST_COHERENT, target_dev_index)) { status = val_dma_mem_alloc(&buffer, 512, target_dev_index, DMA_COHERENT, &dma_addr); - if (status == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_ERR, - "\n pal_dma_mem_alloc is unimplemented, Skipping test.", 0); - goto test_skip_unimplemented; + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + goto test_warn_unimplemented; } ret = val_dma_mem_get_attrs(buffer, &attr, &sh); - if (ret) - { + if (ret == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + goto test_warn_unimplemented; + } else if (ret) { val_print(ACS_PRINT_ERR, "\n DMA controller %d: Failed to get memory attributes\n", target_dev_index); @@ -181,8 +174,8 @@ payload_check_io_coherent_dma_mem_attribute(void) val_set_status(index, RESULT_PASS(TEST_NUM1, 0)); return; -test_skip_unimplemented: - val_set_status(index, RESULT_SKIP(TEST_NUM1, 2)); +test_warn_unimplemented: + val_set_status(index, RESULT_WARN(TEST_NUM1, 2)); } uint32_t diff --git a/test_pool/pmu/pmu009.c b/test_pool/pmu/pmu009.c index d967a198..f1df24b2 100644 --- a/test_pool/pmu/pmu009.c +++ b/test_pool/pmu/pmu009.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2023-2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2023-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -73,8 +73,8 @@ static void payload(void) and all the types of traffic supported */ ret_status = val_pmu_get_multi_traffic_support_interface(&interface_acpiid, &num_traffic_support); - if (ret_status == NOT_IMPLEMENTED) { - val_set_status(index, RESULT_SKIP(TEST_NUM, 04)); + if (ret_status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + val_set_status(index, RESULT_WARN(TEST_NUM, 1)); return; } @@ -112,7 +112,10 @@ static void payload(void) /* generate workload */ ret_status = val_generate_traffic(interface_acpiid, pmu_node_index, mon_index, config_events[i]); - if (ret_status) { + if (ret_status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + val_set_status(index, RESULT_WARN(TEST_NUM, 2)); + return; + } else if (ret_status) { val_print(ACS_PRINT_ERR, "\n workload generate function failed", 0); val_set_status(index, RESULT_FAIL(TEST_NUM, 7)); return; @@ -122,7 +125,10 @@ static void payload(void) /* check if the monitor count value is as expected */ ret_status = val_pmu_check_monitor_count_value(interface_acpiid, mon_count_value, config_events[i]); - if (ret_status) { + if (ret_status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + val_set_status(index, RESULT_WARN(TEST_NUM, 3)); + return; + } else if (ret_status) { val_print(ACS_PRINT_ERR, "\n count value not as expected", 0); val_set_status(index, RESULT_FAIL(TEST_NUM, 8)); return; diff --git a/test_pool/ras/ras005.c b/test_pool/ras/ras005.c index 5b440018..2a2f7cb8 100644 --- a/test_pool/ras/ras005.c +++ b/test_pool/ras/ras005.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2023-2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2023-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -50,7 +50,7 @@ payload() { uint32_t status; - uint32_t fail_cnt = 0, test_skip = 1; + uint32_t fail_cnt = 0, test_skip = 1, warn_cnt = 0; uint64_t num_node; uint32_t node_index; uint32_t index = val_pe_get_index_mpid(val_pe_get_mpid()); @@ -125,9 +125,9 @@ payload() /* Setup an error in an implementation defined way */ status = val_ras_setup_error(err_in_params, &err_out_params); - if (status == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_DEBUG, "\n Skipping Functional Check, node %d", node_index); - continue; + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + warn_cnt++; + break; } else if (status) { val_print(ACS_PRINT_ERR, "\n val_ras_setup_error failed, node %d", node_index); fail_cnt++; @@ -136,9 +136,9 @@ payload() /* Inject error in an implementation defined way */ status = val_ras_inject_error(err_in_params, &err_out_params); - if (status == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_DEBUG, "\n Skipping Functional Check, node %d", node_index); - continue; + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + warn_cnt++; + break; } else if (status) { val_print(ACS_PRINT_ERR, "\n val_ras_inject_error failed, node %d", node_index); fail_cnt++; @@ -156,15 +156,16 @@ payload() } } - if (fail_cnt) { + if (fail_cnt) val_set_status(index, RESULT_FAIL(TEST_NUM, 01)); - return; - } else if (test_skip) { + else if (warn_cnt) + val_set_status(index, RESULT_WARN(TEST_NUM, 01)); + else if (test_skip) val_set_status(index, RESULT_SKIP(TEST_NUM, 02)); - return; - } + else + val_set_status(index, RESULT_PASS(TEST_NUM, 01)); - val_set_status(index, RESULT_PASS(TEST_NUM, 01)); + return; } uint32_t diff --git a/test_pool/ras/ras006.c b/test_pool/ras/ras006.c index a07c0b15..1af7082e 100644 --- a/test_pool/ras/ras006.c +++ b/test_pool/ras/ras006.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2023-2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2023-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -44,7 +44,7 @@ payload() uint64_t data; uint32_t status; - uint32_t fail_cnt = 0, test_skip = 0; + uint32_t fail_cnt = 0, test_skip = 0, warn_cnt = 0; uint32_t node_index; uint64_t mc_prox_domain; uint32_t err_rec_addrmode; @@ -147,7 +147,10 @@ payload() /* Setup error in an implementation defined way */ status = val_ras_setup_error(err_in_params, &err_out_params); - if (status) { + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + warn_cnt++; + break; + } else if (status) { val_print(ACS_PRINT_ERR, "\n val_ras_setup_error failed, node %d", node_index); fail_cnt++; break; @@ -155,7 +158,10 @@ payload() /* Inject error in an implementation defined way */ status = val_ras_inject_error(err_in_params, &err_out_params); - if (status) { + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + warn_cnt++; + break; + } else if (status) { val_print(ACS_PRINT_ERR, "\n val_ras_inject_error failed, node %d", node_index); fail_cnt++; break; @@ -278,15 +284,16 @@ payload() } } - if (fail_cnt) { + if (fail_cnt) val_set_status(index, RESULT_FAIL(TEST_NUM, 02)); - return; - } else if (test_skip) { + else if (warn_cnt) + val_set_status(index, RESULT_WARN(TEST_NUM, 01)); + else if (test_skip) val_set_status(index, RESULT_SKIP(TEST_NUM, 03)); - return; - } + else + val_set_status(index, RESULT_PASS(TEST_NUM, 01)); - val_set_status(index, RESULT_PASS(TEST_NUM, 01)); + return; } uint32_t diff --git a/test_pool/ras/ras009.c b/test_pool/ras/ras009.c index 64a74157..18ce8b33 100644 --- a/test_pool/ras/ras009.c +++ b/test_pool/ras/ras009.c @@ -57,7 +57,7 @@ payload() uint64_t anerr = 0; uint32_t status; - uint32_t fail_cnt = 0, test_skip = 0; + uint32_t fail_cnt = 0, test_skip = 0, warn_cnt = 0; uint32_t node_index; uint64_t mc_prox_domain; uint32_t err_inj_addr_data = 0; @@ -159,7 +159,10 @@ payload() /* Setup error in an implementation defined way */ status = val_ras_setup_error(err_in_params, &err_out_params); - if (status) { + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + warn_cnt++; + break; + } else if (status) { val_print(ACS_PRINT_ERR, "\n val_ras_setup_error failed, node %d", node_index); fail_cnt++; break; @@ -170,7 +173,10 @@ payload() record the error on reading with address syndrome in one of the error records present for the current RAS node */ status = val_ras_inject_error(err_in_params, &err_out_params); - if (status) { + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + warn_cnt++; + break; + } else if (status) { val_print(ACS_PRINT_ERR, "\n val_ras_inject_error failed, node %d", node_index); fail_cnt++; break; @@ -197,15 +203,16 @@ payload() } } - if (fail_cnt) { + if (fail_cnt) val_set_status(index, RESULT_FAIL(TEST_NUM, 02)); - return; - } else if (test_skip) { + else if (warn_cnt) + val_set_status(index, RESULT_WARN(TEST_NUM, 01)); + else if (test_skip) val_set_status(index, RESULT_SKIP(TEST_NUM, 02)); - return; - } + else + val_set_status(index, RESULT_PASS(TEST_NUM, 02)); - val_set_status(index, RESULT_PASS(TEST_NUM, 02)); + return; } uint32_t diff --git a/test_pool/ras/ras011.c b/test_pool/ras/ras011.c index 6b22a7b8..fe84bf22 100644 --- a/test_pool/ras/ras011.c +++ b/test_pool/ras/ras011.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2023-2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2023-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -70,7 +70,7 @@ payload_poison_supported() { uint32_t status; - uint32_t fail_cnt = 0, test_skip = 1; + uint32_t fail_cnt = 0, test_skip = 1, warn_cnt = 0; uint64_t num_node; uint64_t value; uint64_t num_mc_node; @@ -174,7 +174,11 @@ payload_poison_supported() /* Setup an error in an implementation defined way */ status = val_ras_setup_error(err_in_params, &err_out_params); - if (status) { + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + val_print(ACS_PRINT_DEBUG, "\n ras_setup_error unimplemented, node %d", node_index); + warn_cnt++; + break; + } else if (status) { val_print(ACS_PRINT_ERR, "\n val_ras_setup_error failed, node %d", node_index); fail_cnt++; break; @@ -182,7 +186,10 @@ payload_poison_supported() /* Inject error in an implementation defined way */ status = val_ras_inject_error(err_in_params, &err_out_params); - if (status) { + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + warn_cnt++; + break; + } else if (status) { val_print(ACS_PRINT_ERR, "\n val_ras_inject_error failed, node %d", node_index); fail_cnt++; break; @@ -243,15 +250,16 @@ payload_poison_supported() } } - if (fail_cnt) { + if (fail_cnt) val_set_status(index, RESULT_FAIL(TEST_NUM, 04)); - return; - } else if (test_skip) { + else if (warn_cnt) + val_set_status(index, RESULT_WARN(TEST_NUM, 01)); + else if (test_skip) val_set_status(index, RESULT_SKIP(TEST_NUM, 03)); - return; - } + else + val_set_status(index, RESULT_PASS(TEST_NUM, 01)); - val_set_status(index, RESULT_PASS(TEST_NUM, 01)); + return; } /* @@ -265,7 +273,7 @@ payload_poison_unsupported() { uint32_t status; - uint32_t fail_cnt = 0, test_skip = 1; + uint32_t fail_cnt = 0, test_skip = 1, warn_cnt = 0; uint64_t num_node; uint64_t value; uint64_t num_mc_node; @@ -367,7 +375,11 @@ payload_poison_unsupported() /* Setup an error in an implementation defined way */ status = val_ras_setup_error(err_in_params, &err_out_params); - if (status) { + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + val_print(ACS_PRINT_DEBUG, "\n ras_setup_error unimplemented, node %d", node_index); + warn_cnt++; + break; + } else if (status) { val_print(ACS_PRINT_ERR, "\n val_ras_setup_error failed, node %d", node_index); fail_cnt++; break; @@ -375,7 +387,10 @@ payload_poison_unsupported() /* Inject error in an implementation defined way */ status = val_ras_inject_error(err_in_params, &err_out_params); - if (status) { + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + warn_cnt++; + break; + } else if (status) { val_print(ACS_PRINT_ERR, "\n val_ras_inject_error failed, node %d", node_index); fail_cnt++; break; @@ -409,6 +424,9 @@ payload_poison_unsupported() if (fail_cnt) { val_set_status(index, RESULT_FAIL(TEST_NUM1, 04)); return; + } else if (warn_cnt) { + val_set_status(index, RESULT_WARN(TEST_NUM1, 01)); + return; } else if (test_skip) { val_set_status(index, RESULT_SKIP(TEST_NUM1, 03)); return; diff --git a/test_pool/ras/ras012.c b/test_pool/ras/ras012.c index dadac64b..15a062e8 100644 --- a/test_pool/ras/ras012.c +++ b/test_pool/ras/ras012.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2023-2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2023-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -44,7 +44,7 @@ payload() { uint32_t status; - uint32_t fail_cnt = 0, test_skip = 1; + uint32_t fail_cnt = 0, test_skip = 1, warn_cnt = 0; uint64_t num_node; uint32_t node_index; uint32_t index = val_pe_get_index_mpid(val_pe_get_mpid()); @@ -91,14 +91,21 @@ payload() /* Setup an error in an implementation defined way */ status = val_ras_setup_error(err_in_params, &err_out_params); - if (status == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_ERR, "\n ras_setup_error API unimplemented", 0); - val_set_status(index, RESULT_SKIP(TEST_NUM, 01)); + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + val_set_status(index, RESULT_WARN(TEST_NUM, 01)); return; } /* Inject error in an implementation defined way */ status = val_ras_inject_error(err_in_params, &err_out_params); + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + warn_cnt++; + break; + } else if (status) { + val_print(ACS_PRINT_ERR, "\n val_ras_inject_error failed, node %d", node_index); + fail_cnt++; + break; + } exception_return: /* Read Status Register for RAS Nodes */ @@ -110,15 +117,16 @@ payload() } } - if (fail_cnt) { + if (fail_cnt) val_set_status(index, RESULT_FAIL(TEST_NUM, 03)); - return; - } else if (test_skip) { - val_set_status(index, RESULT_SKIP(TEST_NUM, 02)); - return; - } - - val_set_status(index, RESULT_PASS(TEST_NUM, 01)); + else if (warn_cnt) + val_set_status(index, RESULT_WARN(TEST_NUM, 01)); + else if (test_skip) + val_set_status(index, RESULT_SKIP(TEST_NUM, 01)); + else + val_set_status(index, RESULT_PASS(TEST_NUM, 01)); + + return; } uint32_t diff --git a/test_pool/ras/ras018.c b/test_pool/ras/ras018.c index 5f6c6b93..10fa9203 100644 --- a/test_pool/ras/ras018.c +++ b/test_pool/ras/ras018.c @@ -54,7 +54,7 @@ payload() uint32_t status; uint32_t fail_cnt = 0; - uint32_t test_skip = 0; + uint32_t test_skip = 0, warn_cnt = 0; uint32_t node_index; uint32_t usable_node_cnt = 0; uint64_t aderr = 0; @@ -140,7 +140,10 @@ payload() /* Setup error in an implementation defined way */ status = val_ras_setup_error(err_in_params, &err_out_params); - if (status) { + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + warn_cnt++; + break; + } else if (status) { val_print(ACS_PRINT_ERR, "\n val_ras_setup_error failed, node %d", node_index); fail_cnt++; break; @@ -184,16 +187,16 @@ payload() return; } - if (fail_cnt) { + if (fail_cnt) val_set_status(index, RESULT_FAIL(TEST_NUM, 03)); - return; - } - else if (test_skip) { + else if (warn_cnt) + val_set_status(index, RESULT_WARN(TEST_NUM, 01)); + else if (test_skip) val_set_status(index, RESULT_SKIP(TEST_NUM, 02)); - return; - } + else + val_set_status(index, RESULT_PASS(TEST_NUM, 02)); - val_set_status(index, RESULT_PASS(TEST_NUM, 02)); + return; } uint32_t diff --git a/test_pool/smmu/i023.c b/test_pool/smmu/i023.c index 2970c9f2..0e71e734 100644 --- a/test_pool/smmu/i023.c +++ b/test_pool/smmu/i023.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2023-2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2023-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -95,10 +95,10 @@ payload(void) /*Check the CATU in ETR path*/ status = val_smmu_is_etr_behind_catu((char8_t *)etr_path[i]); - if (status == NOT_IMPLEMENTED) { + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { val_print(ACS_PRINT_DEBUG, "\n val_smmu_is_etr_behind_catu API not implemented", 0); - val_set_status(index, RESULT_SKIP(TEST_NUM, 2)); + val_set_status(index, RESULT_WARN(TEST_NUM, 1)); return; } else if (status) { val_print(ACS_PRINT_DEBUG, "\n No CATU found in ETR path at index %d", i); From ca4df0c39d6adacb392af4292e660c271ebb3ece Mon Sep 17 00:00:00 2001 From: Shanmuga Priya L Date: Fri, 20 Feb 2026 13:15:28 +0000 Subject: [PATCH 3/3] refactor(pal): extend PAL_NOT_IMPLEMENTED handling to remaining tests - Replace NOT_IMPLEMENTED checks with ACS_STATUS_PAL_NOT_IMPLEMENTED across test cases to align with updated PAL status definitions. - Convert RESULT_SKIP to RESULT_WARN where PAL interfaces are unimplemented - Introduce warn counters in RAS tests to distinguish warnings from functional failures Signed-off-by: Shanmuga Priya L Change-Id: Ib3476ef1bd82584a4dd56a49a467dd7d738b2b92 --- pal/uefi_acpi/src/pal_pcie.c | 2 ++ pal/uefi_dt/src/pal_pcie.c | 2 ++ test_pool/exerciser/e001.c | 11 ++++------- test_pool/exerciser/e002.c | 11 ++++------- test_pool/exerciser/e006.c | 16 ++++++++-------- test_pool/exerciser/e025.c | 9 +++------ test_pool/pcie/p006.c | 20 +++++++------------- test_pool/pcie/p017.c | 9 +++------ test_pool/pcie/p018.c | 9 +++------ test_pool/pcie/p019.c | 3 --- test_pool/pcie/p023.c | 22 ++++++++-------------- test_pool/pcie/p078.c | 21 +++++++-------------- test_pool/pcie/p080.c | 21 ++++++++++++++++----- test_pool/pcie/p081.c | 11 ++++------- test_pool/pcie/p082.c | 11 ++++------- test_pool/pcie/p093.c | 11 ++++------- test_pool/pcie/p096.c | 21 +++++++++++---------- 17 files changed, 90 insertions(+), 120 deletions(-) diff --git a/pal/uefi_acpi/src/pal_pcie.c b/pal/uefi_acpi/src/pal_pcie.c index 9638e953..9a0241ae 100644 --- a/pal/uefi_acpi/src/pal_pcie.c +++ b/pal/uefi_acpi/src/pal_pcie.c @@ -355,6 +355,8 @@ pal_pcie_p2p_support() return 0; else { pal_warn_not_implemented(__func__); + acs_print(ACS_PRINT_WARN, L"\n Test is applicable only if the system supports P2P." + "\n Pass command line option '-p2p' when running."); return PAL_STATUS_NOT_IMPLEMENTED; } } diff --git a/pal/uefi_dt/src/pal_pcie.c b/pal/uefi_dt/src/pal_pcie.c index c41fae7a..a546fda9 100644 --- a/pal/uefi_dt/src/pal_pcie.c +++ b/pal/uefi_dt/src/pal_pcie.c @@ -356,6 +356,8 @@ pal_pcie_p2p_support() return 0; else { pal_warn_not_implemented(__func__); + acs_print(ACS_PRINT_WARN, L"\n Test is applicable only if the system supports P2P." + "\n Pass command line option '-p2p' when running."); return PAL_STATUS_NOT_IMPLEMENTED; } } diff --git a/test_pool/exerciser/e001.c b/test_pool/exerciser/e001.c index 0ed15a62..b337b327 100644 --- a/test_pool/exerciser/e001.c +++ b/test_pool/exerciser/e001.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2020,2021,2023-2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2020,2021,2023-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -234,11 +234,8 @@ payload(void) uint32_t acsctrl_default[bdf_tbl_ptr->num_entries][1]; /* Check If PCIe Hierarchy supports P2P. */ - if (val_pcie_p2p_support() == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_DEBUG, "\n The test is applicable only if the system supports", 0); - val_print(ACS_PRINT_DEBUG, "\n P2P traffic. If the system supports P2P, pass the", 0); - val_print(ACS_PRINT_DEBUG, "\n command line option '-p2p' while running the binary", 0); - val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 1)); + if (val_pcie_p2p_support() == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + val_set_status(pe_index, RESULT_WARN(TEST_NUM, 1)); return; } @@ -317,7 +314,7 @@ payload(void) val_pcie_write_acsctrl(acsctrl_default); if (test_skip == 1) - val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 2)); + val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 1)); else if (fail_cnt) val_set_status(pe_index, RESULT_FAIL(TEST_NUM, fail_cnt)); else diff --git a/test_pool/exerciser/e002.c b/test_pool/exerciser/e002.c index 99b2a581..92895d10 100644 --- a/test_pool/exerciser/e002.c +++ b/test_pool/exerciser/e002.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2020,2021,2023-2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2020,2021,2023-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -361,11 +361,8 @@ payload(void) uint32_t acsctrl_default[bdf_tbl_ptr->num_entries][1]; /* Check If PCIe Hierarchy supports P2P. */ - if (val_pcie_p2p_support() == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_DEBUG, "\n The test is applicable only if the system supports", 0); - val_print(ACS_PRINT_DEBUG, "\n P2P traffic. If the system supports P2P, pass the", 0); - val_print(ACS_PRINT_DEBUG, "\n command line option '-p2p' while running the binary", 0); - val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 1)); + if (val_pcie_p2p_support() == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + val_set_status(pe_index, RESULT_WARN(TEST_NUM, 1)); return; } @@ -477,7 +474,7 @@ payload(void) val_pcie_write_acsctrl(acsctrl_default); if (test_skip == 1) - val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 2)); + val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 1)); else if (fail_cnt) val_set_status(pe_index, RESULT_FAIL(TEST_NUM, fail_cnt)); else diff --git a/test_pool/exerciser/e006.c b/test_pool/exerciser/e006.c index 01ef5fe7..f832bb4b 100644 --- a/test_pool/exerciser/e006.c +++ b/test_pool/exerciser/e006.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2018-2021, 2023-2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2018-2021, 2023-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -31,6 +31,7 @@ static uint32_t instance; static uint32_t e_intr_line; static uint32_t test_fail; +static uint32_t warn_cnt; static volatile uint32_t e_intr_pending; uint32_t e_bdf; @@ -170,13 +171,10 @@ payload (void) val_gic_disableInterruptSource(e_intr_line); val_gic_free_irq(e_intr_line, 0); } - } else { - if (status == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_DEBUG, - "\n pal_pcie_get_legacy_irq_map unimplemented for bdf: 0x%x", e_bdf); - val_print(ACS_PRINT_DEBUG, "\n The API is platform specific and to be populated", 0); - val_print(ACS_PRINT_DEBUG, "\n by partners with system legacy irq map", 0); - continue; + } else { + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + warn_cnt++; + break; } else { val_print(ACS_PRINT_DEBUG, "\n PCIe Legacy IRQs unmapped. Skipping bdf: 0x%x", e_bdf); @@ -187,6 +185,8 @@ payload (void) if (test_fail) val_set_status(pe_index, RESULT_FAIL(TEST_NUM, 03)); + else if (warn_cnt) + val_set_status(pe_index, RESULT_WARN(TEST_NUM, 01)); else if (test_skip) val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 01)); else diff --git a/test_pool/exerciser/e025.c b/test_pool/exerciser/e025.c index 7e69496d..9369967b 100644 --- a/test_pool/exerciser/e025.c +++ b/test_pool/exerciser/e025.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2023-2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2023-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -173,11 +173,8 @@ payload(void) req_instance = val_exerciser_get_info(EXERCISER_NUM_CARDS); /* Check If PCIe Hierarchy supports P2P. */ - if (val_pcie_p2p_support() == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_DEBUG, "\n The test is applicable only if the system supports", 0); - val_print(ACS_PRINT_DEBUG, "\n P2P traffic. If the system supports P2P, pass the", 0); - val_print(ACS_PRINT_DEBUG, "\n command line option '-p2p' while running the binary", 0); - val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 01)); + if (val_pcie_p2p_support() == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + val_set_status(pe_index, RESULT_WARN(TEST_NUM, 01)); return; } diff --git a/test_pool/pcie/p006.c b/test_pool/pcie/p006.c index d576af87..fdf54c0a 100644 --- a/test_pool/pcie/p006.c +++ b/test_pool/pcie/p006.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2016-2018, 2021, 2023-2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2016-2018, 2021, 2023-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -73,22 +73,16 @@ payload(void) status = val_pci_get_legacy_irq_map(bdf, intr_map); if (status) { - // Skip the test if the Legacy IRQ map does not exist - if (status == NOT_IMPLEMENTED) { - val_print (ACS_PRINT_DEBUG, - "\n pal_pcie_get_legacy_irq_map unimplemented. Skipping test", 0); - val_print(ACS_PRINT_DEBUG, "\n The API is platform specific and to be populated", 0); - val_print(ACS_PRINT_DEBUG, "\n by partners with system legacy irq map", 0); - val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 2)); - } - else { + // Report warn if the Legacy IRQ map does not exist + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + val_set_status(pe_index, RESULT_WARN(TEST_NUM, 1)); + return; + } else { val_print (ACS_PRINT_DEBUG, "\n PCIe Legacy IRQs unmapped. Skipping BDF %llx", bdf); - val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 3)); + val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 2)); continue; } - - return; } /* If test runs for atleast an endpoint */ diff --git a/test_pool/pcie/p017.c b/test_pool/pcie/p017.c index bb6ac6bf..09f9b519 100644 --- a/test_pool/pcie/p017.c +++ b/test_pool/pcie/p017.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2020-2021, 2024-2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2020-2021, 2024-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -47,11 +47,8 @@ payload(void) pe_index = val_pe_get_index_mpid(val_pe_get_mpid()); /* Check If PCIe Hierarchy supports P2P */ - if (val_pcie_p2p_support() == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_DEBUG, "\n The test is applicable only if the system supports", 0); - val_print(ACS_PRINT_DEBUG, "\n P2P traffic. If the system supports P2P, pass the", 0); - val_print(ACS_PRINT_DEBUG, "\n command line option '-p2p' while running the binary", 0); - val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 1)); + if (val_pcie_p2p_support() == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + val_set_status(pe_index, RESULT_WARN(TEST_NUM, 1)); return; } diff --git a/test_pool/pcie/p018.c b/test_pool/pcie/p018.c index a7bd96ab..53014653 100644 --- a/test_pool/pcie/p018.c +++ b/test_pool/pcie/p018.c @@ -41,11 +41,8 @@ payload(void) pe_index = val_pe_get_index_mpid(val_pe_get_mpid()); /* Check If PCIe Hierarchy supports P2P */ - if (val_pcie_p2p_support() == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_DEBUG, "\n The test is applicable only if the system supports", 0); - val_print(ACS_PRINT_DEBUG, "\n P2P traffic. If the system supports P2P, pass the", 0); - val_print(ACS_PRINT_DEBUG, "\n command line option '-p2p' while running the binary", 0); - val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 1)); + if (val_pcie_p2p_support() == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + val_set_status(pe_index, RESULT_WARN(TEST_NUM, 1)); return; } @@ -86,7 +83,7 @@ payload(void) if (test_skip == 1) { val_print(ACS_PRINT_DEBUG, "\n No RP type device found. Skipping test", 0); - val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 2)); + val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 1)); } else if (test_fails) val_set_status(pe_index, RESULT_FAIL(TEST_NUM, test_fails)); diff --git a/test_pool/pcie/p019.c b/test_pool/pcie/p019.c index 5ef6b47f..5094d0eb 100644 --- a/test_pool/pcie/p019.c +++ b/test_pool/pcie/p019.c @@ -44,9 +44,6 @@ payload(void) /* Check If PCIe Hierarchy supports P2P */ if (val_pcie_p2p_support() == ACS_STATUS_PAL_NOT_IMPLEMENTED) { - val_print(ACS_PRINT_DEBUG, "\n The test is applicable only if the system supports", 0); - val_print(ACS_PRINT_DEBUG, "\n P2P traffic. If the system supports P2P, pass the", 0); - val_print(ACS_PRINT_DEBUG, "\n command line option '-p2p' while running the binary", 0); val_set_status(pe_index, RESULT_WARN(TEST_NUM, 1)); return; } diff --git a/test_pool/pcie/p023.c b/test_pool/pcie/p023.c index c41db4a8..0b7c9e72 100644 --- a/test_pool/pcie/p023.c +++ b/test_pool/pcie/p023.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2025-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -75,22 +75,16 @@ payload(void) status = val_pci_get_legacy_irq_map(bdf, intr_map); if (status) { - // Skip the test if the Legacy IRQ map does not exist - if (status == NOT_IMPLEMENTED) { - val_print (ACS_PRINT_DEBUG, - "\n pal_pcie_get_legacy_irq_map unimplemented. Skipping test", 0); - val_print(ACS_PRINT_DEBUG, "\n The API is platform specific and to be populated", 0); - val_print(ACS_PRINT_DEBUG, "\n by partners with system legacy irq map", 0); - val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 2)); - } - else { + // Report warn if the Legacy IRQ map does not exist + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + val_set_status(pe_index, RESULT_WARN(TEST_NUM, 1)); + return; + } else { val_print (ACS_PRINT_DEBUG, "\n PCIe Legacy IRQs unmapped. Skipping BDF %llx", bdf); - val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 3)); + val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 2)); continue; } - - return; } /* If test runs for atleast an endpoint */ @@ -106,7 +100,7 @@ payload(void) } else { val_print(ACS_PRINT_ERR, "\n Int id %d is not SPI", intr_line); - val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 4)); + val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 3)); return; } diff --git a/test_pool/pcie/p078.c b/test_pool/pcie/p078.c index 81e9b49b..da053e38 100644 --- a/test_pool/pcie/p078.c +++ b/test_pool/pcie/p078.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2020-2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2020-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -82,25 +82,18 @@ payload_primary(void) status = val_pci_get_legacy_irq_map(bdf, intr_map); if (status) { - /* Skip the test if the Legacy IRQ map does not exist */ - if (status == NOT_IMPLEMENTED) { - val_print (ACS_PRINT_WARN, - "\n pal_pcie_get_legacy_irq_map unimplemented. Skipping test", 0); - val_print(ACS_PRINT_WARN, - "\n The API is platform specific and to be populated", 0); - val_print(ACS_PRINT_WARN, - "\n by partners with system legacy irq map", 0); - val_set_status(pe_index, RESULT_SKIP(test_num, 02)); + /* Report warn if the Legacy IRQ map does not exist */ + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + val_set_status(pe_index, RESULT_WARN(test_num, 01)); + val_memory_free_aligned(intr_map); + return; } else { val_print (ACS_PRINT_DEBUG, "\n PCIe Legacy IRQs unmapped. Skipping BDF %llx", bdf); - val_set_status(pe_index, RESULT_SKIP(test_num, 3)); + val_set_status(pe_index, RESULT_SKIP(test_num, 2)); continue; } - - val_memory_free_aligned(intr_map); - return; } /* If test runs for atleast an endpoint */ diff --git a/test_pool/pcie/p080.c b/test_pool/pcie/p080.c index d8a36252..39e8ca8f 100644 --- a/test_pool/pcie/p080.c +++ b/test_pool/pcie/p080.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2020-2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2020-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -36,7 +36,9 @@ payload(void) uint32_t dp_type; uint32_t cap_base; bool test_skip; + uint32_t warn_cnt; uint32_t test_fails; + uint32_t status; pcie_device_bdf_table *bdf_tbl_ptr; pe_index = val_pe_get_index_mpid(val_pe_get_mpid()); @@ -44,6 +46,7 @@ payload(void) test_fails = 0; test_skip = 1; + warn_cnt = 0; /* Check for all the function present in bdf table */ for (tbl_index = 0; tbl_index < bdf_tbl_ptr->num_entries; tbl_index++) @@ -61,9 +64,15 @@ payload(void) val_print(ACS_PRINT_DEBUG, "\n BDF - 0x%x", bdf); /* Check if Address Translation Cache is Present in this device. */ /* If ATC Not present or capabilty not filled, skip the test.*/ - if ((val_pcie_is_cache_present(bdf) == NOT_IMPLEMENTED) || - (val_pcie_is_cache_present(bdf) == 0)) - continue; + status = val_pcie_is_cache_present(bdf); + + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + warn_cnt++; + break; + } + + if (status == 0) + continue; test_skip = 0; @@ -76,7 +85,9 @@ payload(void) } } - if (test_skip) { + if (warn_cnt) + val_set_status(pe_index, RESULT_WARN(TEST_NUM, warn_cnt)); + else if (test_skip) { val_print(ACS_PRINT_DEBUG, "\n No target device type found with ATC available. Skipping test", 0); val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 01)); diff --git a/test_pool/pcie/p081.c b/test_pool/pcie/p081.c index ed82a9ad..e7f5811b 100644 --- a/test_pool/pcie/p081.c +++ b/test_pool/pcie/p081.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2020-2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2020-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -46,11 +46,8 @@ payload(void) pe_index = val_pe_get_index_mpid(val_pe_get_mpid()); /* Check If PCIe Hierarchy supports P2P */ - if (val_pcie_p2p_support() == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_DEBUG, "\n The test is applicable only if the system supports", 0); - val_print(ACS_PRINT_DEBUG, "\n P2P traffic. If the system supports P2P, pass the", 0); - val_print(ACS_PRINT_DEBUG, "\n command line option '-p2p' while running the binary", 0); - val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 01)); + if (val_pcie_p2p_support() == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + val_set_status(pe_index, RESULT_WARN(TEST_NUM, 01)); return; } @@ -153,7 +150,7 @@ payload(void) if (test_skip == 1) { val_print(ACS_PRINT_DEBUG, "\n No iEP_EP type device found with P2P support. Skipping test", 0); - val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 02)); + val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 01)); } else if (test_fails) val_set_status(pe_index, RESULT_FAIL(TEST_NUM, test_fails)); diff --git a/test_pool/pcie/p082.c b/test_pool/pcie/p082.c index fa19a7e7..557c8a7c 100644 --- a/test_pool/pcie/p082.c +++ b/test_pool/pcie/p082.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2020-2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2020-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -78,11 +78,8 @@ payload(void *arg) pe_index = val_pe_get_index_mpid(val_pe_get_mpid()); /* Check If PCIe Hierarchy supports P2P */ - if (val_pcie_p2p_support() == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_DEBUG, "\n The test is applicable only if the system supports", 0); - val_print(ACS_PRINT_DEBUG, "\n P2P traffic. If the system supports P2P, pass the", 0); - val_print(ACS_PRINT_DEBUG, "\n command line option '-p2p' while running the binary", 0); - val_set_status(pe_index, RESULT_SKIP(test_data->test_num, 01)); + if (val_pcie_p2p_support() == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + val_set_status(pe_index, RESULT_WARN(test_data->test_num, 01)); return; } @@ -167,7 +164,7 @@ payload(void *arg) if (test_skip == 1) { val_print(ACS_PRINT_DEBUG, "\n No target device type with Multifunction and P2P support.Skipping test", 0); - val_set_status(pe_index, RESULT_SKIP(test_data->test_num, 02)); + val_set_status(pe_index, RESULT_SKIP(test_data->test_num, 01)); } else if (test_fails + aer_cap_fail) val_set_status(pe_index, RESULT_FAIL(test_data->test_num, test_fails)); diff --git a/test_pool/pcie/p093.c b/test_pool/pcie/p093.c index b6e5c029..4d1ce8f0 100644 --- a/test_pool/pcie/p093.c +++ b/test_pool/pcie/p093.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2025-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -45,11 +45,8 @@ payload(void) pe_index = val_pe_get_index_mpid(val_pe_get_mpid()); /* Check If PCIe Hierarchy supports P2P */ - if (val_pcie_p2p_support() == NOT_IMPLEMENTED) { - val_print(ACS_PRINT_DEBUG, "\n The test is applicable only if the system supports", 0); - val_print(ACS_PRINT_DEBUG, "\n P2P traffic. If the system supports P2P, pass the", 0); - val_print(ACS_PRINT_DEBUG, "\n command line option '-p2p' while running the binary", 0); - val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 1)); + if (val_pcie_p2p_support() == ACS_STATUS_PAL_NOT_IMPLEMENTED) { + val_set_status(pe_index, RESULT_WARN(TEST_NUM, 1)); return; } @@ -138,7 +135,7 @@ payload(void) if (test_skip == 1) { val_print(ACS_PRINT_DEBUG, "\n No Downstream Port of Switch found. Skipping device", 0); - val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 2)); + val_set_status(pe_index, RESULT_SKIP(TEST_NUM, 1)); } else if (test_fails) val_set_status(pe_index, RESULT_FAIL(TEST_NUM, test_fails)); diff --git a/test_pool/pcie/p096.c b/test_pool/pcie/p096.c index d8d8b53a..cd54f39d 100644 --- a/test_pool/pcie/p096.c +++ b/test_pool/pcie/p096.c @@ -1,5 +1,5 @@ /** @file - * Copyright (c) 2016-2018, 2021-2025, Arm Limited or its affiliates. All rights reserved. + * Copyright (c) 2016-2018, 2021-2026, Arm Limited or its affiliates. All rights reserved. * SPDX-License-Identifier : Apache-2.0 * Licensed under the Apache License, Version 2.0 (the "License"); @@ -42,6 +42,7 @@ payload (void) uint32_t ccnt; uint32_t ncnt; uint32_t test_skip; + uint32_t warn_cnt = 0; current_irq_pin = 0; status = 0; @@ -97,8 +98,8 @@ payload (void) val_print(ACS_PRINT_ERR, "\n Maximum number of interrupts has been reached", 0); break; default: - if (status == NOT_IMPLEMENTED) - val_print (ACS_PRINT_ERR, "\n API not implemented", 0); + if (status == ACS_STATUS_PAL_NOT_IMPLEMENTED) + warn_cnt++; else val_print (ACS_PRINT_ERR, "\n Unknown error", 0); break; @@ -140,16 +141,16 @@ payload (void) val_memory_free_aligned(irq_map); - if (test_skip) { + if (warn_cnt) + val_set_status(index, RESULT_WARN (TEST_NUM, 1)); + else if (test_skip) val_set_status(index, RESULT_SKIP (TEST_NUM, 2)); - return; - } - - if (!status) { + else if (!status) val_set_status(index, RESULT_PASS (TEST_NUM, 1)); - } else { + else val_set_status(index, RESULT_FAIL (TEST_NUM, status)); - } + + return; } uint32_t