Skip to content

Commit 868382c

Browse files
SrikarJosyulaprashymh
authored andcommitted
fix(gic): mark multiple GICDs as S_L5GI_01 violation
- Exposing multiple GICDs via MADT would be treated as a non-standard GICv3 implementation - Add helpers to fetch num_gicd from MADT ACPI table Signed-off-by: Srikar Josyula <srikar.josyula@arm.com> Change-Id: I08af82f231897bb55f9cf72deec9598e9c88d292
1 parent ec25c68 commit 868382c

5 files changed

Lines changed: 18 additions & 5 deletions

File tree

docs/sbsa/arm_sbsa_testcase_checklist.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -400,7 +400,7 @@ The checklist provides information about:
400400
<td>S_L5GI_01</td>
401401
<td>S_L5GI_01</td>
402402
<td>216</td>
403-
<td>Check Non GIC Interrupts</td>
403+
<td>Check Non standard GICv3 implmentation</td>
404404
<td>Yes</td>
405405
<td>Yes</td>
406406
<td>No</td>

test_pool/gic/g016.c

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,15 @@
2121

2222
#define TEST_NUM (ACS_GIC_TEST_NUM_BASE + 16)
2323
#define TEST_RULE "S_L5GI_01"
24-
#define TEST_DESC "Check Non GIC Interrupts "
24+
#define TEST_DESC "Check Non standard GICv3 implmentation"
2525

2626
static
2727
void
2828
payload(void)
2929
{
3030
uint32_t index = val_pe_get_index_mpid(val_pe_get_mpid());
3131
uint32_t num_non_gic = 0;
32-
32+
uint32_t num_gicd = 0;
3333

3434
num_non_gic = val_get_num_nongic_ctrl();
3535

@@ -40,6 +40,15 @@ payload(void)
4040
return;
4141
}
4242

43+
/* MADT permits only a single GICD structure. Exposing multiple GICDs via MADT would be treated
44+
as a non-standard GICv3 implementation */
45+
num_gicd = val_gic_get_info(GIC_INFO_NUM_GICD);
46+
if (num_gicd > 1) {
47+
val_print(ERROR, "\n GIC Distributor count is greater than 1");
48+
val_set_status(index, RESULT_FAIL(02));
49+
return;
50+
}
51+
4352
val_set_status(index, RESULT_PASS);
4453
return;
4554
}

val/include/val_interface.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,8 @@ typedef enum {
168168
GIC_INFO_NUM_ITS,
169169
GIC_INFO_ITS_BASE,
170170
GIC_INFO_NUM_MSI_FRAME,
171-
GIC_INFO_NUM_GICR_GICRD
171+
GIC_INFO_NUM_GICR_GICRD,
172+
GIC_INFO_NUM_GICD
172173
}GIC_INFO_e;
173174

174175
/* GICv2m APIs */

val/src/acs_gic.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -367,6 +367,9 @@ val_gic_get_info(GIC_INFO_e type)
367367
case GIC_INFO_NUM_GICR_GICRD:
368368
return g_gic_info_table->header.num_gicr_rd;
369369

370+
case GIC_INFO_NUM_GICD:
371+
return g_gic_info_table->header.num_gicd;
372+
370373
default:
371374
val_print(ERROR, "\n GIC Info - TYPE not recognized %d ", type);
372375
break;

val/src/rule_metadata.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -698,7 +698,7 @@ rule_test_map_t rule_test_map[RULE_ID_SENTINEL] = {
698698
[S_L5GI_01] = {
699699
.test_entry_id = G016_ENTRY,
700700
.module_id = GIC,
701-
.rule_desc = "Check Non GIC Interrupts",
701+
.rule_desc = "Check Non standard GICv3 implmentation",
702702
.platform_bitmask = PLATFORM_BAREMETAL | PLATFORM_UEFI,
703703
.flag = BASE_RULE,
704704
.test_num = ACS_GIC_TEST_NUM_BASE + 16,

0 commit comments

Comments
 (0)