Repository navigation
Build OpenSSL 3.5 LTS with C906 -O3 flags - #504
Conversation
Build outputsCompared with the build of main at 2571baa. 4 changed, 158 added, 145 removed of 583 outputs.
|
dormancygrace
left a comment
There was a problem hiding this comment.
What I checked:
- The
sources.lockpin matches the real openssl-3.5.9 tarball. - The README percentages are consistent with their tables.
Configure linux64-riscv64accepts the profile.
CI runs test-openssl-package.py only with fixture payloads, so the device transition, ABI and reproducibility results in the description are the evidence for those claims.
Not in the diff, so noted here:
- The web UI has its own copies of the protected-package list (
web/src/pages/desktop/menu/settings/software/index.tsx) and the package labels (web/src/lib/update-components.ts). Neither includesnanokvm-openssl. So the Software page offers Remove (which the server then rejects), and update notices show the raw package name. Please add it in both places, with a locale key as for zlib. - Several docs still say "thirteen" core packages:
docs/BUILD.md,docs/UPDATES.md,firmware/alpine/README.mdandREADME.md. So does.github/upstream-candidates/alpine-minirootfs.json(nanokvm_packages_installed: 13).
dormancygrace
left a comment
There was a problem hiding this comment.
Review completed at ad3d5ad. Corrected the production OpenSSL ISA to exclude XTheadVector, and added signed higher-version-provider regression coverage using the real release dependency. The zlib-ng-style named-package policy already prevents replacement by a newer Alpine provider; the test verifies it and its unconstrained negative control. Updated protected-package UI/component labels and current package counts; preserved the historical 13-package Alpine qualification record.
Validation: complete target build; 408 AEAD correctness cases on QEMU C906 plus corrupted-KAT control; all 6,418 Alpine exported symbol/version entries retained; real signed stock → custom → stock transition, higher-version provider and incompatible-dependency tests; all 14-package channel/interrupted rollback tests; affected Go race/vet, CPU/platform/config/package/upstream tests, web type/lint/i18n checks. Weblate export was current with main and unlocked before locale edits.
The ISA correction changes the cryptographic runtime build, so this PR remains open under the instruction to hold substantive fixes. Physical performance figures remain attributed to the earlier measured implementation.
dormancygrace
left a comment
There was a problem hiding this comment.
Final review at 2e4ad51: integrated current main with a regular merge and preserved both sets of validation documentation. This removes the merge conflict that prevented PR workflows from starting. Rechecked the combined platform build/configuration and web type/i18n/component/menu tests; all passed. The OpenSSL build, cryptographic correctness, ABI and signed APK results from ad3d5ad still apply: those files are unchanged by this merge. The substantive runtime build correction remains held for a separate merge instruction.
dormancygrace
left a comment
There was a problem hiding this comment.
Reviewed the current head and its merge with current main. The OpenSSL baseline ISA excludes XTheadVector; historical physical measurements remain explicitly attributed to the older measured profile. The named release dependency protects the selected OpenSSL provider against a newer Alpine package, with the signed install/upgrade/rollback fixture and unconstrained negative control verified in the earlier fix pass. The narrowed build passed 408 AEAD known-answer cases plus a corrupted-answer control and retained all 6,418 exported symbols/version nodes.
Repeated on the final integration: Go race tests and vet for update/rollback/VM services; CPU-profile, platform-build/config, package-version, stock-profile and upstream-update/watch tests; TypeScript, affected ESLint and i18n/update/menu tests. Production crypto/package inputs are unchanged from the previously reviewed final head. All 15 current-head CI checks passed. Weblate export has no outstanding commits and is unlocked. No new findings.
Alpine supplies a generic size-optimized OpenSSL runtime. This adds a reproducible OpenSSL 3.5.9 LTS build using the existing C906 toolchain and -O3, delivered as
nanokvm-openssl. The source is unmodified; custom crypto assembly and CryptoDMA integration are deferred. The upstream monitor follows patch releases only in the selected 3.5.x LTS branch.The new package provides the existing OpenSSL ABI3 libraries and command, joins the release/core package inventories, and preserves user configuration. Rollback to a release that predates this package atomically restores Alpine OpenSSL. A contradictory rollback is rejected by the APK solver.
Physical C906 measurements
The current production profile removes
xtheadvectorfrom its baseline ISA, matching zlib-ng. The physical figures below describe the earlier0c78b2caprofile; the narrower ISA has been rebuilt and checked for correctness and ABI compatibility, but has not been remeasured on the device.Same OpenSSL 3.5.9, installed curl, active video, 16 MiB HTTPS transfer over Wi-Fi with SHA-256 and SD writes; medians of five rotating-order trials:
This is 23.5% less curl CPU at a cost of 592 KiB peak RSS. It compares the full build profiles (Alpine GCC 15.2/-Os versus project GCC 16.2/C906/-O3), not the optimization level alone. No encoder FPS benefit was demonstrated, including the separate capped-rate control.
Compiler vector memory expansion was measured separately. It helps some unaligned memcpy sizes, regresses aligned copies, and provides no measured HTTPS CPU benefit. Production uses scalar inline memory operations. The report includes the 16-byte identical-code control's placement sensitivity, all native trials and reproduction sources: benchmark report.
Validation
Installed device libraries and services remain unchanged; measurements used isolated temporary runtimes.
Review validation: the rebuilt scalar runtime passed 408 AEAD cases on QEMU C906 and rejected the corrupted known-answer control. All 5,809 libcrypto and 609 libssl exported symbols/version nodes match Alpine. Signed package tests use the real release dependency and a higher-version Alpine fixture: fresh installs and upgrades retain NanoKVM, removing the release constraint selects Alpine, incompatible newer library requests fail, and rollback restores Alpine atomically. All 14-package channel/recovery, affected Go race/vet, CPU/build/config/upstream, and web type/lint/i18n checks passed.