Skip to content

Fix MAILBOX_SIZE constant: 256 KB → 16 KB#3651

Draft
Copilot wants to merge 2 commits intomainfrom
copilot/fix-mailbox-size-constant
Draft

Fix MAILBOX_SIZE constant: 256 KB → 16 KB#3651
Copilot wants to merge 2 commits intomainfrom
copilot/fix-mailbox-size-constant

Conversation

Copy link
Copy Markdown

Copilot AI commented Apr 23, 2026

MAILBOX_SIZE in api/src/mailbox.rs was still set to 256 KB after the mailbox was reduced to 16 KB, causing MAX_CM_SHA_INPUT_SIZE (derived as MAILBOX_SIZE - 12) to be ~262 KB instead of the correct ~16 KB.

Changes

  • api/src/mailbox.rs
    • MAILBOX_SIZE: 256 * 102416 * 1024, comment updated to match
    • MAX_CM_SHA_INPUT_SIZE: implicitly fixed to 16372 (was 262132) since it derives from MAILBOX_SIZE
    • mbox_write_fifo local constant: renamed MAILBOX_SIZEPASSIVE_MAILBOX_SIZE (value stays 256 * 1024) — this function is called in passive mode for large writes like firmware load and must retain the hardware FIFO capacity, distinct from the software API mailbox size
// Before
/// Mailbox size in bytes (256 KB).
pub const MAILBOX_SIZE: usize = 256 * 1024;

// After
/// Mailbox size in bytes (16 KB).
pub const MAILBOX_SIZE: usize = 16 * 1024;

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla Bot commented Apr 23, 2026

CLA Not Signed

The mailbox size was reduced to 16KB in PR #3097, but the MAILBOX_SIZE
constant in api/src/mailbox.rs still had the old 256KB value. This also
incorrectly caused MAX_CM_SHA_INPUT_SIZE to be derived as 256KB-12 instead
of the correct 16KB-12.

Also rename the local MAILBOX_SIZE in mbox_write_fifo to PASSIVE_MAILBOX_SIZE
to clarify it represents the hardware passive mode capacity (256KB) which is
distinct from the software-level MAILBOX_SIZE constant.

Agent-Logs-Url: https://github.com/chipsalliance/caliptra-sw/sessions/7a0da863-a46e-4291-8130-8567f5525047

Co-authored-by: mhatrevi <38512878+mhatrevi@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix mailbox size constant from 256KB to 16KB Fix MAILBOX_SIZE constant: 256 KB → 16 KB Apr 23, 2026
Copilot AI requested a review from mhatrevi April 23, 2026 18:53
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.

2 participants