[M] Change in fuchsia/fuchsia[main]: [kstring] Add crate for kernel strings

0 views
Skip to first unread message

'Adam Barth (Gerrit)' via owners-override

unread,
May 27, 2026, 8:20:53 PM (8 days ago) May 27
to Owners Override
Attention needed from Owners Override

Adam Barth has uploaded the change for review

Adam Barth would like Owners Override to review this change.

Commit message

[kstring] Add crate for kernel strings

This CL adds a crate for working with string in the kernel. The first
feature of this crate is support for fxt::InternedString, see
src/performance/lib/fxt/include/lib/fxt/interned_string.h.

This crate makes interned strings in the same linker section as the fxt
library, but the string pointers are not deduplicated, which means if a
string is used by Rust and C++, we'll end up with two entries for that
string in the linker section.

This support is needed to make Zircon kernel mutexes work in Rust
because Zircon uses these interned strings to define class names for
Zircon mutexes.
Bug: b/516863941
Change-Id: Ib2952389bdd2456f9b8f02860cdbafc6a28f2c73

Change diff


Change information

Files:
  • M src/lib/BUILD.gn
  • A src/lib/kstring/BUILD.gn
  • A src/lib/kstring/OWNERS
  • A src/lib/kstring/src/interned_string.rs
  • A src/lib/kstring/src/lib.rs
Change size: M
Delta: 5 files changed, 178 insertions(+), 0 deletions(-)
Open in Gerrit

Related details

Attention is currently required from:
  • Owners Override
Submit Requirements:
  • requirement is not satisfiedCode-Owners
  • requirement satisfiedCode-Review
  • requirement is not satisfiedNo-Unresolved-Comments
  • requirement satisfiedReview-Enforcement
Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
Gerrit-MessageType: newchange
Gerrit-Project: fuchsia
Gerrit-Branch: main
Gerrit-Change-Id: Ib2952389bdd2456f9b8f02860cdbafc6a28f2c73
Gerrit-Change-Number: 1628776
Gerrit-PatchSet: 2
Gerrit-Owner: Adam Barth <aba...@google.com>
Gerrit-Reviewer: Adam Barth <aba...@google.com>
Gerrit-Reviewer: Adrian Danis <ada...@google.com>
Gerrit-Reviewer: Gwen Mittertreiner <gm...@google.com>
Gerrit-Reviewer: Owners Override <owners-...@fuchsia.dev>
Gerrit-CC: Corey Tabaka <ei...@google.com>
Gerrit-CC: Ethan Williams <eth...@google.com>
Gerrit-Attention: Owners Override <owners-...@fuchsia.dev>

--
You received this message because you are subscribed to the Google Groups "owners-override" group.
To unsubscribe from this group and stop receiving emails from it, send an email to owners-overri...@fuchsia.dev.
To view this discussion visit https://groups.google.com/a/fuchsia.dev/d/msgid/owners-override/af34065fb1635ec05bb4b735f557d5b04f6d0b9b-HTML%40fuchsia-review.googlesource.com.
unsatisfied_requirement
satisfied_requirement
open
diffy

'Adam Barth (Gerrit)' via owners-override

unread,
May 28, 2026, 12:22:27 PM (7 days ago) May 28
to Owners Override, Adrian Danis, Gwen Mittertreiner, global-integrat...@fuchsia-infra.iam.gserviceaccount.com, fuchsia-int...@luci-project-accounts.iam.gserviceaccount.com, Corey Tabaka, Ethan Williams
Attention needed from Owners Override

Adam Barth added 1 comment

File src/lib/kstring/src/interned_string.rs
Line 101, Patchset 3 (Latest): // Verify conversion to standard Rust &str
Adam Barth . resolved

Done. Updated to use direct C-string literal comparisons.

Open in Gerrit

Related details

Attention is currently required from:
  • Owners Override
Submit Requirements:
    • requirement is not satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: fuchsia
    Gerrit-Branch: main
    Gerrit-Change-Id: Ib2952389bdd2456f9b8f02860cdbafc6a28f2c73
    Gerrit-Change-Number: 1628776
    Gerrit-PatchSet: 3
    Gerrit-Owner: Adam Barth <aba...@google.com>
    Gerrit-Reviewer: Adam Barth <aba...@google.com>
    Gerrit-Reviewer: Adrian Danis <ada...@google.com>
    Gerrit-Reviewer: Gwen Mittertreiner <gm...@google.com>
    Gerrit-Reviewer: Owners Override <owners-...@fuchsia.dev>
    Gerrit-CC: Corey Tabaka <ei...@google.com>
    Gerrit-CC: Ethan Williams <eth...@google.com>
    Gerrit-Attention: Owners Override <owners-...@fuchsia.dev>
    Gerrit-Comment-Date: Thu, 28 May 2026 16:22:18 +0000
    Gerrit-HasComments: Yes
    Gerrit-Has-Labels: No

    --
    You received this message because you are subscribed to the Google Groups "owners-override" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to owners-overri...@fuchsia.dev.
    To view this discussion visit https://groups.google.com/a/fuchsia.dev/d/msgid/owners-override/d1f7de6a0f825c3c13221644339cf5fa88045c1a-EmailReviewComments-HTML%40fuchsia-review.googlesource.com.
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    'Adam Barth (Gerrit)' via owners-override

    unread,
    May 28, 2026, 12:23:46 PM (7 days ago) May 28
    to Owners Override, Adrian Danis, Gwen Mittertreiner, global-integrat...@fuchsia-infra.iam.gserviceaccount.com, fuchsia-int...@luci-project-accounts.iam.gserviceaccount.com, Corey Tabaka, Ethan Williams
    Attention needed from Owners Override

    Adam Barth voted

    Commit-Queue+1
    Fuchsia-Auto-Submit+1
    Gerrit-Comment-Date: Thu, 28 May 2026 16:23:36 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes

    --
    You received this message because you are subscribed to the Google Groups "owners-override" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to owners-overri...@fuchsia.dev.
    To view this discussion visit https://groups.google.com/a/fuchsia.dev/d/msgid/owners-override/332929266043d82f09670db6a89089a68349b71d-EmailReviewComments-HTML%40fuchsia-review.googlesource.com.
    unsatisfied_requirement
    satisfied_requirement
    open
    diffy

    'James Robinson (Gerrit)' via owners-override

    unread,
    May 28, 2026, 1:01:13 PM (7 days ago) May 28
    to Adam Barth, Owners Override, Adrian Danis, Gwen Mittertreiner, global-integrat...@fuchsia-infra.iam.gserviceaccount.com, fuchsia-int...@luci-project-accounts.iam.gserviceaccount.com, Corey Tabaka, Ethan Williams
    Attention needed from Adam Barth and Owners Override

    James Robinson voted Owners-Override+1

    Owners-Override+1
    Open in Gerrit

    Related details

    Attention is currently required from:
    • Adam Barth
    • Owners Override
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: fuchsia
    Gerrit-Branch: main
    Gerrit-Change-Id: Ib2952389bdd2456f9b8f02860cdbafc6a28f2c73
    Gerrit-Change-Number: 1628776
    Gerrit-PatchSet: 4
    Gerrit-Owner: Adam Barth <aba...@google.com>
    Gerrit-Reviewer: Adam Barth <aba...@google.com>
    Gerrit-Reviewer: Adrian Danis <ada...@google.com>
    Gerrit-Reviewer: Gwen Mittertreiner <gm...@google.com>
    Gerrit-Reviewer: James Robinson <jam...@google.com>
    Gerrit-Attention: Adam Barth <aba...@google.com>
    Gerrit-Comment-Date: Thu, 28 May 2026 17:01:04 +0000
    Gerrit-HasComments: No
    Gerrit-Has-Labels: Yes

    --
    You received this message because you are subscribed to the Google Groups "owners-override" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to owners-overri...@fuchsia.dev.
    To view this discussion visit https://groups.google.com/a/fuchsia.dev/d/msgid/owners-override/98d36a9a3d66df000ee019d334538ac919b5e8f8-EmailReviewComments-HTML%40fuchsia-review.googlesource.com.
    satisfied_requirement
    open
    diffy

    'fuchsia-internal-scoped@luci-project-accounts.iam.gserviceaccount.com (Gerrit)' via owners-override

    unread,
    May 28, 2026, 1:08:06 PM (7 days ago) May 28
    to Adam Barth, James Robinson, Owners Override, Adrian Danis, Gwen Mittertreiner, global-integrat...@fuchsia-infra.iam.gserviceaccount.com, Corey Tabaka, Ethan Williams

    fuchsia-int...@luci-project-accounts.iam.gserviceaccount.com submitted the change with unreviewed changes

    Unreviewed changes

    1 is the latest approved patch-set.
    The change was submitted with unreviewed changes in the following files:

    ```
    The name of the file: src/lib/kstring/src/interned_string.rs
    Insertions: 13, Deletions: 9.

    The diff is too large to show. Please review the diff.
    ```

    Change information

    Commit message:
    [kstring] Add crate for kernel strings

    This CL adds a crate for working with string in the kernel. The first
    feature of this crate is support for fxt::InternedString, see
    src/performance/lib/fxt/include/lib/fxt/interned_string.h.

    This crate makes interned strings in the same linker section as the fxt
    library, but the string pointers are not deduplicated, which means if a
    string is used by Rust and C++, we'll end up with two entries for that
    string in the linker section.

    This support is needed to make Zircon kernel mutexes work in Rust
    because Zircon uses these interned strings to define class names for
    Zircon mutexes.
    Bug: b/516863941
    Change-Id: Ib2952389bdd2456f9b8f02860cdbafc6a28f2c73
    Fuchsia-Auto-Submit: Adam Barth <aba...@google.com>
    Reviewed-by: Gwen Mittertreiner <gm...@google.com>
    Owners-Override: James Robinson <jam...@google.com>
    Reviewed-by: Adrian Danis <ada...@google.com>
    Commit-Queue: Adam Barth <aba...@google.com>
    Files:
    • M src/lib/BUILD.gn
    • A src/lib/kstring/BUILD.gn
    • A src/lib/kstring/OWNERS
    • A src/lib/kstring/src/interned_string.rs
    • A src/lib/kstring/src/lib.rs
    Change size: M
    Delta: 5 files changed, 182 insertions(+), 0 deletions(-)
    Branch: refs/heads/main
    Submit Requirements:
    • requirement satisfiedCode-Review: +2 by Gwen Mittertreiner, +2 by Adrian Danis
    Open in Gerrit
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: merged
    Gerrit-Project: fuchsia
    Gerrit-Branch: main
    Gerrit-Change-Id: Ib2952389bdd2456f9b8f02860cdbafc6a28f2c73
    Gerrit-Change-Number: 1628776
    Gerrit-PatchSet: 5
    Gerrit-Owner: Adam Barth <aba...@google.com>
    Gerrit-Reviewer: Adam Barth <aba...@google.com>
    Gerrit-Reviewer: Adrian Danis <ada...@google.com>
    Gerrit-Reviewer: Gwen Mittertreiner <gm...@google.com>
    Gerrit-Reviewer: James Robinson <jam...@google.com>
    Gerrit-Reviewer: Owners Override <owners-...@fuchsia.dev>
    Gerrit-CC: Corey Tabaka <ei...@google.com>
    Gerrit-CC: Ethan Williams <eth...@google.com>

    --
    You received this message because you are subscribed to the Google Groups "owners-override" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to owners-overri...@fuchsia.dev.
    To view this discussion visit https://groups.google.com/a/fuchsia.dev/d/msgid/owners-override/29dff5a18ae9ac9430af111495ac89420150c204-HTML%40fuchsia-review.googlesource.com.
    open
    diffy
    satisfied_requirement

    'global-integration-ci-builder@fuchsia-infra.iam.gserviceaccount.com (Gerrit)' via owners-override

    unread,
    May 28, 2026, 1:17:04 PM (7 days ago) May 28
    to Adam Barth, fuchsia-int...@luci-project-accounts.iam.gserviceaccount.com, James Robinson, Owners Override, Adrian Danis, Gwen Mittertreiner, global-integrat...@fuchsia-infra.iam.gserviceaccount.com, Corey Tabaka, Ethan Williams

    Message from global-integra...@fuchsia-infra.iam.gserviceaccount.com

    Open in Gerrit

    Related details

    Attention set is empty
    Submit Requirements:
    • requirement satisfiedCode-Owners
    • requirement satisfiedCode-Review
    • requirement satisfiedReview-Enforcement
    Inspect html for hidden footers to help with email filtering. To unsubscribe visit settings. DiffyGerrit
    Gerrit-MessageType: comment
    Gerrit-Project: fuchsia
    Gerrit-Branch: main
    Gerrit-Change-Id: Ib2952389bdd2456f9b8f02860cdbafc6a28f2c73
    Gerrit-Change-Number: 1628776
    Gerrit-PatchSet: 5
    Gerrit-Owner: Adam Barth <aba...@google.com>
    Gerrit-Reviewer: Adam Barth <aba...@google.com>
    Gerrit-Reviewer: Adrian Danis <ada...@google.com>
    Gerrit-Reviewer: Gwen Mittertreiner <gm...@google.com>
    Gerrit-Reviewer: James Robinson <jam...@google.com>
    Gerrit-Reviewer: Owners Override <owners-...@fuchsia.dev>
    Gerrit-CC: Corey Tabaka <ei...@google.com>
    Gerrit-CC: Ethan Williams <eth...@google.com>

    --
    You received this message because you are subscribed to the Google Groups "owners-override" group.
    To unsubscribe from this group and stop receiving emails from it, send an email to owners-overri...@fuchsia.dev.
    To view this discussion visit https://groups.google.com/a/fuchsia.dev/d/msgid/owners-override/e87d64e3b114f87b1a0a6961124d394f114409d9-EmailReviewComments-HTML%40fuchsia-review.googlesource.com.
    satisfied_requirement
    open
    diffy
    Reply all
    Reply to author
    Forward
    0 new messages