m001.c (B_MEM_02) detects only 2 of the 4 rule-permitted terminations
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 55/100
- Issue type
- Bug
- Clarity
- Mostly clear
- Activity status
- Active
- Tech stack
- c
- Domain
- operating-systems, testing-qa
Research direction
Start with test_pool/memory_map/m001.c, especially the two ESR registrations, esr(), the store probe, and the verdict after val_mem_issue_dsb(). Compare GIC ISR registration in test_pool/exerciser/e004.c and related tests, then review val_gic_install_isr in val/include/val_interface.h. Done means SPI/LPI terminations are handled without false failure, or the result is explicitly indeterminate and docs/bsa/arm_bsa_testcase_checklist.md records the limitation.
Written by the indexing model from the issue text.
Description
Component: sysarch-acs, test_pool/memory_map/m001.c
Rule: B_MEM_02 (BSA), test num 101, "Memory Access to Un-Populated addr"
Type: Incomplete test coverage / false negative
Summary
B_MEM_02 permits four different terminations for an access to unpopulated
address space. m001.c can only observe two of them. A platform that
terminates via the other two - both explicitly allowed by the rule - is reported
as FAILED even though it is conformant.
Rule text
Where a memory access is to an unpopulated part of the addressable memory
space, accesses must be terminated in a manner that is presented to the PE as
either a precise Data Abort, or as a system error interrupt, or an SPI, or LPI
interrupt to be delivered to the GIC.
Four permitted terminations:
| # | Termination | Detected by m001.c |
|---|---|---|
| 1 | Precise Data Abort | Yes - EXCEPT_AARCH64_SYNCHRONOUS_EXCEPTIONS |
| 2 | System error interrupt (SError) | Yes - EXCEPT_AARCH64_SERROR |
| 3 | SPI delivered to the GIC | No |
| 4 | LPI delivered to the GIC | No |
Evidence
m001.c installs exactly two handlers, both PE exception handlers, and no GIC
interrupt handler:
60: val_pe_install_esr(EXCEPT_AARCH64_SYNCHRONOUS_EXCEPTIONS, esr);
61: val_pe_install_esr(EXCEPT_AARCH64_SERROR, esr);
The verdict is pre-set to FAIL and is only ever cleared by that PE exception
handler:
84: val_set_status(index, RESULT_FAIL(1)); /* default */
88: *((volatile uint64_t*)addr) = 0x100; /* the probe (a STORE) */
91: val_mem_issue_dsb();
esr() at line 46 is the sole writer of RESULT_PASS. There is no path by
which an SPI or LPI can produce a PASS, so options 3 and 4 are unreachable
verdicts.
Impact
Any platform that reports unpopulated-address accesses by interrupt to the GIC -
a legal choice under the rule - fails B_MEM_02 unconditionally. The failure
signature is indistinguishable from a platform that reports nothing at all,
which is a genuine violation. The test cannot separate a conformant
interrupt-reporting platform from a non-conformant silent one, which is the
practical harm: it forces manual architectural investigation on every platform
that does not use aborts.
Additional finding: the checklist overstates coverage
docs/bsa/arm_bsa_testcase_checklist.md (lines 302-303) lists B_MEM_02 with
coverage "Yes / Yes" and records no limitation. If partial coverage is intended
and accepted, the checklist should say so; as written it implies the rule is
fully verified.
The framework already supports the fix
This is not a missing-infrastructure problem. val_gic_install_isr(uint32_t int_id, void (*isr)(void)) is declared in val/include/val_interface.h:205,
and the pattern is already used across the suite - test_pool/exerciser/e004.c,
e006.c, e012.c, e013.c, e023.c, e024.c, e027.c, e033.c and others.
Suggested resolution
Preferred - close the coverage gap:
- Register a GIC ISR alongside the two ESRs, using the existing
val_gic_install_isrpath, and setRESULT_PASSfrom it asesr()does. - Poll for a bounded interval after
val_mem_issue_dsb()before declaring
FAIL, since interrupt delivery is asynchronous whereas an abort is
synchronous with the store. The current code evaluates the verdict
immediately after thedsb, which would race an interrupt even if a handler
were installed. - Source the interrupt ID from the PAL so platforms can declare which SPI/LPI
signals the condition.
Minimum acceptable alternative - if interrupt observation is considered out of
scope, emit a distinct, non-FAIL result (e.g. WARNING or a documented
"indeterminate") stating that options 3 and 4 were not evaluated, and record the
limitation in the checklist. That preserves the useful signal while not
mislabelling conformant platforms as failing.
Notes for the reviewer
- The probe is a store, so on platforms whose unmapped-access behaviour is
write-ignore the write is silently dropped; there is no returned data for the
test to inspect as a fallback signal. - Point 2 above (the async race) is worth fixing regardless of whether point 1
is accepted, and is arguably a latent bug in its own right.
- Dominant language
- C
- Stars
- 23
- Forks
- 39
- Avg merge
- 21h 56m
- Merged PRs (30d)
- 28
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from ARM-software/sysarch-acs
-
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
ARM-software/sysarch-acs#556 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 1/5 Under an hour Newbie friendliness 85/100
ARM-software/sysarch-acs#525 · 1 comment ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 64/100
ARM-software/sysarch-acs#540 ·
Maintainers usually reply within 1 day
-
Difficulty 3/5 1-2 days Newbie friendliness 72/100
ARM-software/sysarch-acs#528 ·
Maintainers usually reply within 1 day
-
Difficulty 4/5 3-5 days Newbie friendliness 52/100
ARM-software/sysarch-acs#527 · 1 comment ·
Maintainers usually reply within 1 day
All issues in ARM-software/sysarch-acs
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 84/100
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
fastfetch-cli/fastfetch#2628 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
FujiNetWIFI/fujinet-firmware#1736 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
Maintainers usually reply within 3 days
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100