Add TESTING build flag to enable timer test_standalone on V61+#30
Open
zbelinsk wants to merge 1 commit into
Open
Add TESTING build flag to enable timer test_standalone on V61+#30zbelinsk wants to merge 1 commit into
zbelinsk wants to merge 1 commit into
Conversation
Plumbs a TESTING define from the top-level makefile through kernel/Makefile into timer.ref.c and timer.v60opt.S, bypassing the V61+ core-timer-register read path so the test can drive the timer via device pointer registers. Background: On ARCHV > 60 (V61 and later) the hypervisor reads the hardware tick count from the per-core timer registers (TIMERHILO / H2K_get_timer_reg). These registers cannot be written from software, so kernel/time/timer/test_standalone - which needs to set the tick count to drive the test - cannot run on those architectures. On ARCHV <= 60 the tick count is read from device-pointer MMIO registers (HW_COUNT_HI / HW_COUNT_LO) which the test can write, so the test already works there. The TESTING flag forces V61+ builds to use the same device-pointer read path as V60 and earlier, making the test runnable. The flag has no effect on ARCHV <= 60 builds (they already use the device-pointer path unconditionally), so it is only meaningful for ARCHV > 60. Changes: - kernel/Makefile: forward TESTING to CFLAGS as -DTESTING - makefile: pass TESTING=$(TESTING) to kernel sub-make for opt and ref - timer.ref.c, timer.v60opt.S: gate the V61+ TIMERHILO path behind !TESTING - scripts/testlist.v61, scripts/testlist.v81: re-enable kernel/time/timer/test_standalone - .github/workflows/h2_reg.yml: pass TESTING=1 in the regression test step so test_standalone runs against the device-pointer read path in CI Usage: TESTING only takes effect at build time, and only for ARCHV > 60. The build and the test run are two separate steps - you must build with TESTING=1 first, and only then run the tests. Running the tests without rebuilding will exercise the normal (non-TESTING) code path. # 1. Build the hypervisor with TESTING enabled (only meaningful for ARCHV > 60) make TARGET=opt ARCHV=81 TESTING=1 # (or TARGET=ref for the reference build) # 2. Run the tests against the TESTING-built hypervisor make TARGET=opt ARCHV=81 test CI note: Because the testlists now include test_standalone, the GitHub regression workflow is also updated to pass TESTING=1 to make testall. This means CI exercises the device-pointer timer-read path on V61+ rather than the production TIMERHILO path. If preserving production-path coverage in CI is required, a follow-up can split this into two passes (with and without TESTING=1). Without TESTING=1 the build behaves exactly as before, so existing CI flows that do not opt into TESTING are unaffected. Signed-off-by: Zeev Belinsky <zbelinsk@qti.qualcomm.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plumbs a TESTING define from the top-level makefile through kernel/Makefile into timer.ref.c and timer.v60opt.S, bypassing the V61+ core-timer-register read path so the test can drive the timer via device pointer registers.
Background:
On ARCHV > 60 (V61 and later) the hypervisor reads the hardware tick count from the per-core timer registers (TIMERHILO / H2K_get_timer_reg). These registers cannot be written from software, so kernel/time/timer/test_standalone
The TESTING flag forces V61+ builds to use the same device-pointer read path as V60 and earlier, making the test runnable. The flag has no effect on ARCHV <= 60 builds (they already use the device-pointer path unconditionally), so it is only meaningful for ARCHV > 60.
Changes:
Usage:
TESTING only takes effect at build time, and only for ARCHV > 60. The build and the test run are two separate steps - you must build with TESTING=1 first, and only then run the tests. Running the tests without rebuilding will exercise the normal (non-TESTING) code path.
1. Build the hypervisor with TESTING enabled (only meaningful for ARCHV > 60)
make TARGET=opt ARCHV=81 TESTING=1
(or TARGET=ref for the reference build)
2. Run the tests against the TESTING-built hypervisor
make TARGET=opt ARCHV=81 test
CI note: Because the testlists now include test_standalone, the GitHub regression workflow is also updated to pass TESTING=1 to make testall. This means CI exercises the device-pointer timer-read path on V61+ rather than the production TIMERHILO path. If preserving production-path coverage in CI is required, a follow-up can split this into two passes (with and without TESTING=1).
Without TESTING=1 the build behaves exactly as before, so existing CI flows that do not opt into TESTING are unaffected.