Skip to content

Commit

Permalink
MPAM Resource Select change added (#396)
Browse files Browse the repository at this point in the history
- 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 <[email protected]>
  • Loading branch information
rajatgoyal47 authored Sep 28, 2023
1 parent f78ddfc commit 99b9ce7
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 6 deletions.
3 changes: 2 additions & 1 deletion platform/pal_uefi/include/pal_mpam.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,8 @@ typedef struct {

typedef struct {
UINT16 length;
UINT16 reserved;
UINT8 InterfaceType;
UINT8 reserved;
UINT32 identifier;
UINT64 base_address;
UINT32 mmio_size;
Expand Down
31 changes: 26 additions & 5 deletions test_pool/pe/operating_system/test_c016.c
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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++) {

Expand All @@ -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));
Expand Down

0 comments on commit 99b9ce7

Please sign in to comment.