From 99b9ce7a7883feaa60f3eb6cebd73034ac736e0f Mon Sep 17 00:00:00 2001 From: Rajat Goyal Date: Thu, 28 Sep 2023 18:42:39 +0530 Subject: [PATCH] MPAM Resource Select change added (#396) - MPAM Table Structure changed according to MPAM v2.0 ACPI Table - Now the test is updated to change RIS_SEL based on the rsrc_index Signed-off-by: Rajat Goyal --- platform/pal_uefi/include/pal_mpam.h | 3 ++- test_pool/pe/operating_system/test_c016.c | 31 +++++++++++++++++++---- 2 files changed, 28 insertions(+), 6 deletions(-) diff --git a/platform/pal_uefi/include/pal_mpam.h b/platform/pal_uefi/include/pal_mpam.h index ff0baf8c..43f48a43 100644 --- a/platform/pal_uefi/include/pal_mpam.h +++ b/platform/pal_uefi/include/pal_mpam.h @@ -29,7 +29,8 @@ typedef struct { typedef struct { UINT16 length; - UINT16 reserved; + UINT8 InterfaceType; + UINT8 reserved; UINT32 identifier; UINT64 base_address; UINT32 mmio_size; diff --git a/test_pool/pe/operating_system/test_c016.c b/test_pool/pe/operating_system/test_c016.c index 030543b0..3155d9bf 100644 --- a/test_pool/pe/operating_system/test_c016.c +++ b/test_pool/pe/operating_system/test_c016.c @@ -33,6 +33,8 @@ static void payload(void) uint32_t llc_index; uint64_t cache_identifier; uint32_t test_run = 0; + uint32_t ris_supported = 0; + uint32_t cpor_supported = 0; if (g_sbsa_level < 5) { val_set_status(index, RESULT_SKIP(g_sbsa_level, TEST_NUM, 01)); @@ -76,7 +78,12 @@ static void payload(void) rsrc_node_cnt = val_mpam_get_info(MPAM_MSC_RSRC_COUNT, msc_index, 0); val_print(AVS_PRINT_DEBUG, "\n msc index = %d", msc_index); - val_print(AVS_PRINT_DEBUG, "\n Resource count %d = ", rsrc_node_cnt); + val_print(AVS_PRINT_DEBUG, "\n Resource count = %d", rsrc_node_cnt); + + cpor_supported = 0; + + ris_supported = val_mpam_msc_supports_ris(msc_index); + val_print(AVS_PRINT_INFO, "\n RIS Support = %d", ris_supported); for (rsrc_index = 0; rsrc_index < rsrc_node_cnt; rsrc_index++) { @@ -89,21 +96,35 @@ static void payload(void) val_print(AVS_PRINT_DEBUG, "\n rsrc index = %d", rsrc_index); test_run = 1; + + /* Select resource instance if RIS feature implemented */ + if (ris_supported) + val_mpam_memory_configure_ris_sel(msc_index, rsrc_index); + /* Check CPOR are present */ - if (!val_mpam_supports_cpor(msc_index)) { - val_print(AVS_PRINT_ERR, "\n CPOR unsupported by LLC", 0); - val_set_status(index, RESULT_FAIL(g_sbsa_level, TEST_NUM, 04)); - return; + if (val_mpam_supports_cpor(msc_index)) { + val_print(AVS_PRINT_DEBUG, + "\n CPOR Supported by LLC for rsrc_index %d", rsrc_index); + cpor_supported = 1; + break; } + val_print(AVS_PRINT_DEBUG, + "\n CPOR Not Supported by LLC for rsrc_index %d", rsrc_index); } } } + if (cpor_supported) + break; } if (!test_run) { val_print(AVS_PRINT_ERR, "\n No LLC MSC found", 0); val_set_status(index, RESULT_FAIL(g_sbsa_level, TEST_NUM, 05)); return; + } else if (!cpor_supported) { + val_print(AVS_PRINT_ERR, "\n CPOR unsupported by LLC", 0); + val_set_status(index, RESULT_FAIL(g_sbsa_level, TEST_NUM, 04)); + return; } val_set_status(index, RESULT_PASS(g_sbsa_level, TEST_NUM, 01));