Skip to content

perf: compile-time opt-out for SMS and OTA - #160

Open
benjaminbruun wants to merge 7 commits into
masterfrom
feat/subsystem-gates
Open

perf: compile-time opt-out for SMS and OTA#160
benjaminbruun wants to merge 7 commits into
masterfrom
feat/subsystem-gates

Conversation

@benjaminbruun

@benjaminbruun benjaminbruun commented Aug 25, 2026

Copy link
Copy Markdown
Member

One build option, off by default, so the default build is unchanged (the four static libraries define the same symbols at the same sizes as before):

  • CONFIG_DISABLE_SMS — drops the SMS codec and rx/tx and, with them, RFM/OTA remote commands, 3DES and the REFRESH they drive (incl. both changed-file lists): OTA only ever arrives over SMS-PP and nothing else uses the SMS layer. Host -Os text of the four libraries 65,051 → 52,289 B, sizeof(struct ss_context) 2,936 → 872 B.

CAT stays. An SMS-PP DOWNLOAD envelope answers 6F00, which TS 31.111 clause 7.1.1.1 maps to an RP-ACK, and logs an error. Leave EF.UST service n°28 set: clearing it makes the terminal store class-2 messages in EF.SMS, which the shipped profile does not have.

The OTA AES wrapper (utils_aes.c) now builds into the crypto library, next to the aes-encblock.c that calls back into it: with OTA compiled out nothing in libuicc.a referenced the wrapper any more, so a single pass over the archives left it unresolved. Same archive, no link-order dependency, consumer link lines untouched; ss_utils_aes_* move from libuicc.a to libcrypto.a.

Tests: the des/envelope/ota/sms suites are skipped in the gated build; tests/opt_out pins SELECT MF, TERMINAL PROFILE, the 6F00 answer and the log line. CI gains an SMS-off row; docs list the option.

@benjaminbruun benjaminbruun changed the title feat: compile-time opt-outs for OTA, SMS, REFRESH and proactive perf: compile-time opt-outs for OTA, SMS, REFRESH and proactive Aug 27, 2026
@benjaminbruun
benjaminbruun force-pushed the feat/subsystem-gates branch 2 times, most recently from 9ce8169 to 7ef1963 Compare September 1, 2026 12:21
@benjaminbruun
benjaminbruun marked this pull request as ready for review September 1, 2026 12:21
@benjaminbruun
benjaminbruun requested a review from a team as a code owner September 1, 2026 12:21
@benjaminbruun
benjaminbruun marked this pull request as draft September 2, 2026 07:09
@linear-code

linear-code Bot commented Sep 2, 2026

Copy link
Copy Markdown

SOFTSIM-209

@benjaminbruun benjaminbruun changed the title perf: compile-time opt-outs for OTA, SMS, REFRESH and proactive perf: ompile-time opt-outs for SMS and OTA Sep 2, 2026
@benjaminbruun benjaminbruun changed the title perf: ompile-time opt-outs for SMS and OTA perf: compile-time opt-outs for SMS and OTA Sep 2, 2026
An integration that never uses a subsystem can compile it out via
CONFIG_DISABLE_* (all off by default, so default builds are unchanged);
instructions of a disabled subsystem answer 6D00 per TS 102 221.
Also declares the uicc<->crypto static-library cycle the opt-outs
exposed, so archive member extraction no longer depends on the OTA
call chain.

Signed-off-by: Benjamin Bruun <bb@onomondo.com>
6D00 is defined in TS 102 221 clause 10.2.1.5.0 (base checking errors);
10.2.1.1 is normal processing.

Signed-off-by: Benjamin Bruun <bb@onomondo.com>
The only standalone gate the matrix did not compile; it uniquely covers
ss_new_ctx without the filelist and the SMS-only proactive task array.

Signed-off-by: Benjamin Bruun <bb@onomondo.com>
…BLE_SMS

Two states are wanted: SMS without RFM, and SMS with RFM. REFRESH is only
ever fed by remote commands, so it goes with OTA; SMS off implies OTA off;
CAT stays in every build so the terminal sees the same card at boot. A
compiled-out subsystem logs the profile fix when the terminal still offers
it, and tests/opt_out pins the gated answers.

Signed-off-by: Benjamin Bruun <bb@onomondo.com>
aes-encblock.c (crypto) calls ss_utils_aes_encrypt (utils_aes.c, uicc). With OTA
compiled out nothing in the uicc archive references the wrapper any more, so a single
pass over the archives left aes-encblock.o unresolved. Building utils_aes.c into the
crypto library puts caller and callee in one archive: the link graph stays acyclic and
consumer link lines are untouched. The four archives together define the same symbols.

Signed-off-by: Benjamin Bruun <bb@onomondo.com>
The SMS-implies-OTA rule already lives in CMake, a prototype without a definition is
inert, no build here enables -Wunused-parameter, opt_out_test includes only public
headers, and wrapping the existing lines of ss_new_ctx keeps the default build's code
byte for byte. The sms suite moves under the OTA gate instead of patching #171's test:
its reassembly case expects the remote command handler's status word.

Signed-off-by: Benjamin Bruun <bb@onomondo.com>
OTA only ever arrives over SMS-PP and the SMS layer has no other caller, so a build without
OTA but with SMS kept six kilobytes of code whose only reachable outcome was a reject. One
option now drops both. The gated ENVELOPE answers 6F00, which TS 31.111 clause 7.1.1.1 maps
to an RP-ACK; no clause attaches a network-side behaviour to the 6A81 it answered before.

Signed-off-by: Benjamin Bruun <bb@onomondo.com>
@benjaminbruun benjaminbruun changed the title perf: compile-time opt-outs for SMS and OTA perf: compile-time opt-outs for SMS Sep 2, 2026
@benjaminbruun benjaminbruun changed the title perf: compile-time opt-outs for SMS perf: compile-time opt-out for SMS Sep 2, 2026
@benjaminbruun benjaminbruun changed the title perf: compile-time opt-out for SMS perf: compile-time opt-out for SMS and OTA Sep 2, 2026
@benjaminbruun
benjaminbruun marked this pull request as ready for review September 2, 2026 16:12
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