Skip to content

boards/risc-v: add NTFC test for ksmp64 - #20127

Open
imeghar2408-max wants to merge 1 commit into
apache:masterfrom
imeghar2408-max:fix/qemu-rv-kernel-ntfc
Open

imeghar2408-max wants to merge 1 commit into
apache:masterfrom
imeghar2408-max:fix/qemu-rv-kernel-ntfc

Conversation

@imeghar2408-max

@imeghar2408-max imeghar2408-max commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Assisted-by: GitHub Copilot

Summary

Add NTFC (NuttX Test Framework Configuration) support for the existing RISC-V ksmp64 kernel SMP configuration (rv-virt:ksmp64).

This enables automated CI test coverage for the SMP kernel build, exercising ostest and SMP-specific test cases across 4 harts under QEMU.

Testing

Build

$ ./tools/configure.sh rv-virt:ksmp64
$ make -j$(nproc)

Verified key configuration options:

CONFIG_BUILD_KERNEL=y
CONFIG_ARCH_USE_S_MODE=y
CONFIG_SMP=y
CONFIG_SMP_NCPUS=4
CONFIG_SYSTEM_NSH=y
CONFIG_TESTING_OSTEST=y
CONFIG_TESTING_SMP=y

Kernel application build/import

$ make export -j$(nproc)
$ cd ../apps
$ ./tools/mkimport.sh -z -x ../nuttx/nuttx-export-*.tar.gz
$ make import -j$(nproc)

QEMU SMP boot

$ qemu-system-riscv64 -semihosting -M virt,aclint=on -cpu rv64 -smp 4 -kernel ./nuttx -nographic

Boots cleanly to NSH with all 4 harts recognized by OpenSBI.

NTFC test run

$ NTFCDIR=/tmp/nuttx-ntfc ./tools/testbuild.sh -C -R /tmp/nuttx-ksmp64-testlist

933 tests collected, 3 skipped, exit code 0 — no failures.

Static checks

$ git diff --check
$ ./tools/checkpatch.sh -c -u -m -g "$BASE..HEAD"
$ ./tools/checkpatch.sh -c

All checks pass.

Fixes #20031

@github-actions github-actions Bot added Size: S The size of the change in this PR is small Board: risc-v labels Sep 13, 2026
@github-actions

github-actions Bot commented Sep 13, 2026

Copy link
Copy Markdown

MemBrowse Memory Report

No memory changes detected for:

@imeghar2408-max

Copy link
Copy Markdown
Contributor Author

CI is currently failing during the NTFC boot wait for the ksmp64 test. The kernel builds successfully and boots locally with 4 HARTs, but CI uses ntfc==0.0.1, whose boot wait appears to be limited to ~5s. Newer NTFC changes add configurable boot_timeout and exec_cwd.

What would be the preferred approach here — update/release NTFC first and then use those options in this PR, or handle it another way?

acassis
acassis previously approved these changes Sep 14, 2026
@acassis

acassis commented Sep 14, 2026

Copy link
Copy Markdown
Contributor

@raiden00pl what is the Issue reported by CI?

Is it this warning promoted to error:

Warning: fpu.c:57:8: warning: #warning "FPU test not built; Only available in the flat build (CONFIG_BUILD_FLAT)" [-Wcpp]

?

@raiden00pl

Copy link
Copy Markdown
Member

https://github.com/apache/nuttx/actions/runs/34754691570/job/103750583002?pr=20127#step:10:842

TimeoutError: device boot timeout

I'm not sure if this PR is correct, here is the last NTFC config I used to test kernel build with risc-v: https://github.com/apache/nuttx-ntfc/blob/main/config/nuttx-qemu-riscv-rv-virt-knsh64.yaml

Another thing is NTFC kernel-build mode works only with cmake, I dont remember which build system is used by rv-virt:ksmp64 in CI

@acassis

acassis commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

https://github.com/apache/nuttx/actions/runs/34754691570/job/103750583002?pr=20127#step:10:842

TimeoutError: device boot timeout

I'm not sure if this PR is correct, here is the last NTFC config I used to test kernel build with risc-v: https://github.com/apache/nuttx-ntfc/blob/main/config/nuttx-qemu-riscv-rv-virt-knsh64.yaml

Another thing is NTFC kernel-build mode works only with cmake, I dont remember which build system is used by rv-virt:ksmp64 in CI

@raiden00pl so we need to create an issue to random it, everything on NuttX should work with make and cmake, maybe in the future we can move only to cmake (or maybe not), but for now we need to support both.

@raiden00pl

raiden00pl commented Sep 15, 2026

Copy link
Copy Markdown
Member

@acassis I don't think so. NTFC is a testing tool, not main project. NTFC is an auxiliary tool, and no one is required to use it. Automatic building in NTFC is possible only with cmake.
You still can write your own scripts that build nuttx with make and run NTFC on created binaries, but auto-build is not supported for make

@acassis

acassis commented Sep 15, 2026

Copy link
Copy Markdown
Contributor

@acassis I don't think so. NTFC is a testing tool, not main project. NTFC is an auxiliary tool, and no one is required to use it. Automatic building in NTFC is possible only with cmake. You still can write your own scripts that build nuttx with make and run NTFC on created binaries, but auto-build is not supported for make

Fair enough! But it could prevent people using Makefile to test it.

@imeghar2408-max

Copy link
Copy Markdown
Contributor Author

hello @acassis @raiden00pl
Updated the ksmp64 NTFC configuration based on local validation.

Changes:

  • Added app_bindir and exec_cwd so NTFC can discover the imported kernel-mode applications.
  • Added CONFIG_FS_TMPFS=y to provide /tmp for the NSH filesystem tests.
  • Added CONFIG_SYSTEM_SETLOGMASK=y required by the ostest integration.
  • Set boot_timeout: 15 for reliable QEMU SMP startup.
  • Kept ksmp64 on the existing Make-based CI build path.

Local validation:

  • Kernel build passed.
  • Export/import passed.
  • NTFC ran 64 selected tests: 57 passed, 0 failed, 7 skipped.
  • checkpatch.sh passed all checks.

Add NTFC configuration for the ksmp64 kernel SMP build so it can
be exercised by the CI test infrastructure.

Assisted by: GitHub Copilot

Signed-off-by: Megha Rajput <i.meghar.2408@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Board: risc-v Size: S The size of the change in this PR is small

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[FEATURE] Add kernel build tests for CI

4 participants