Skip to content

Add TESTING build flag to enable timer test_standalone on V61+#30

Open
zbelinsk wants to merge 1 commit into
masterfrom
testing_flag_timer_standalone
Open

Add TESTING build flag to enable timer test_standalone on V61+#30
zbelinsk wants to merge 1 commit into
masterfrom
testing_flag_timer_standalone

Conversation

@zbelinsk
Copy link
Copy Markdown
Contributor

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.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant