Commit 3c141216b1 for openssl.org
commit 3c141216b1e17092d1be4a1068fcf19363f9123e
Author: Christoph Müllner <christoph.muellner@vrull.eu>
Date: Tue Apr 7 21:47:44 2026 +0200
riscv: add capscheck assertion to hwprobe CI entries
The two hwprobe-based matrix entries exercise hwprobe_to_cap() but
previously contained no assertion to verify that expected extensions
were actually detected; tests pass regardless of which code path is
taken because both the optimised and fallback paths produce correct
output.
Add an optional capscheck field to the matrix schema. When set, a
new "check detected capabilities" step runs
"openssl info -cpusettings" and asserts the output matches the
given extended regular expression.
Set capscheck for the two hwprobe entries:
- rv64gc_novector_hwprobe: assert "_ZBB" is present.
With the IS_IN_DEPEND_VECTOR bug, scalar extensions are gated on
VECTOR_CAPABLE (false when V is absent), so ZBB is not detected
and the assertion fails.
- rv64gc_v_zvkned_hwprobe: assert "_V_ZVKNED" is present.
Signed-off-by: Christoph Müllner <christoph.muellner@vrull.eu>
Reviewed-by: Eugene Syromiatnikov <esyr@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.foundation>
MergeDate: Thu Apr 16 17:03:42 2026
(Merged from https://github.com/openssl/openssl/pull/30713)
diff --git a/.github/workflows/riscv-more-cross-compiles.yml b/.github/workflows/riscv-more-cross-compiles.yml
index 2c86b75e4b..3d4378aeef 100644
--- a/.github/workflows/riscv-more-cross-compiles.yml
+++ b/.github/workflows/riscv-more-cross-compiles.yml
@@ -52,6 +52,9 @@ jobs:
# opensslcaps: optional; if opensslcapsname (see above) is set, then
# this string will be used as content for the OpenSSL
# capabilities variable.
+ # capscheck: optional; ERE pattern passed to grep -E to assert that
+ # "openssl info -cpusettings" output contains expected
+ # capabilities when using the hwprobe detection path.
# ppa: Launchpad PPA repository to download packages from.
platform: [
# Scalar Crypto
@@ -214,6 +217,8 @@ jobs:
qemucpu: "rv64,zbb=true,zbc=true,zbs=true,zbkb=true,v=false",
# No opensslcapsname: hwprobe is used for capability detection.
opensslcaps: "rv64gc_novector_hwprobe",
+ # ZBB must be detected
+ capscheck: "_ZBB",
}, {
# hwprobe path: RV64GC + V + ZVKNED (vlen=128), no OPENSSL_riscvcap override.
# Forces the hwprobe_to_cap() code path (skipped when OPENSSL_riscvcap is set).
@@ -225,6 +230,8 @@ jobs:
qemucpu: "rv64,v=true,vlen=128,zvkned=true",
# No opensslcapsname: hwprobe is used for capability detection.
opensslcaps: "rv64gc_v_zvkned_hwprobe",
+ # Both V and ZVKNED must be detected.
+ capscheck: "_V_ZVKNED|_ZVKNED.*_V",
}
]
runs-on: ubuntu-latest
@@ -283,6 +290,13 @@ jobs:
if: matrix.platform.tests != 'none'
run: QEMU_LD_PREFIX=/usr/${{ matrix.platform.arch }} ./util/opensslwrap.sh info -cpusettings
+ - name: check detected capabilities
+ if: matrix.platform.capscheck != ''
+ run: |
+ QEMU_LD_PREFIX=/usr/${{ matrix.platform.arch }} \
+ ./util/opensslwrap.sh info -cpusettings | \
+ grep -qE "${{ matrix.platform.capscheck }}"
+
- name: make all tests
if: github.event_name == 'push' && matrix.platform.tests == ''
run: |