TLS13-C13: cut the guest stack cost of signature verification by 17 KiB - #1321
Merged
Merged
Conversation
Measured, not guessed. The class-B gate's fault pointed at a 79,856-byte stack frame in FETCHS.BIN against the guest's 32,768-byte stack. The contributor was the certificate-signature path, inlined end-to-end into the handshake frame: chain validation -> RSA/ECDSA verify -> bigint modexp, each carrying its working sets, all summed into one frame. A hard call boundary on the three verification entry points: largest frame in FETCHS.BIN 79,856 B -> 62,784 B (-21%) second largest 34,032 B -> 34,032 B `noinline` here is a stack-budget statement, not a performance one: these run a handful of times per handshake, and the alternative was a frame no guest task can hold. Stated plainly: this does NOT close the gap. 62,784 B still exceeds 32,768 B. It is committed because it is a strict improvement with no semantic change, and because it is the measured starting point for the remaining decision -- a further client restructure, or a larger per-task stack (kernel-wide, and visible to the verify-bss-budget gate). zig build test: 200/200 steps, 3599/3599 tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Follow-up to #1299, which is where the class-B gate first ran and measured a 79,856-byte stack frame in
FETCHS.BINagainst the guest's 32,768-byte stack.The contributor was the certificate-signature path, inlined end-to-end into the handshake frame: chain validation → RSA/ECDSA verify → bigint modexp, each carrying its working sets, all summed into one frame.
A hard call boundary on the three verification entry points:
noinlinehere is a stack-budget statement, not a performance one — these run a handful of times per handshake, and the alternative was a frame no guest task can hold.This does not close the gap. 62,784 B still exceeds 32,768 B. It is committed because it is a strict improvement with no semantic change, and because it is the measured starting point for the remaining decision:
verify-bss-budgetgate.zig build test: 200/200 steps, 3599/3599 tests.