Repository navigation
atelet, hardware: record cpu_features from runsc cpu-features --bitmask - #3825
Open
Shrutiya Mohan (shrutiyam-glitch) wants to merge 3 commits into
Open
Shrutiya Mohan (shrutiyam-glitch) wants to merge 3 commits into
Shrutiya Mohan (shrutiyam-glitch) wants to merge 3 commits into
Conversation
Shrutiya Mohan (shrutiyam-glitch)
marked this pull request as ready for review
November 12, 2026 21:47
Shrutiya Mohan (shrutiyam-glitch)
force-pushed
the
cpu-features-bitmask
branch
from
November 20, 2026 19:33
a4f64d1 to
626555b
Compare
runsc prints its feature set as a bitmask since gVisor release 20261026.0, in the numbering the cpu_features attribute already uses. Probe with --bitmask and encode the blocks directly, so a gVisor feature newer than the name tables no longer fails the probe. The recorded value is unchanged, so snapshots taken before this keep matching. An older runsc fails the probe permanently. ateworker-gvisor needs that release anyway, as the gvisor-default SandboxConfig notes. Signed-off-by: Shrutiya <shrutiyam@google.com>
atelet no longer maps runsc feature names to bits, so the tables, EncodeCPUFeatures and DecodeCPUFeatures have no callers outside their tests. Signed-off-by: Shrutiya <shrutiyam@google.com>
Shrutiya Mohan (shrutiyam-glitch)
force-pushed
the
cpu-features-bitmask
branch
from
November 20, 2026 21:59
626555b to
6895162
Compare
Document in the API guide that gVisor SandboxConfigs require release 20261026.0 or newer. Older runsc binaries lack `runsc cpu-features --bitmask` and the `-no-root-container` restore fix. Describe how atelet handles an older release when a SandboxConfig lists one. Update EncodeCPUFeatureMask to ignore all-zero blocks past 12 blocks. `runsc` prints blocks up to its highest compiled feature even when those bits are zero on the host, so a future runsc with a 13th block would otherwise fail on existing CPUs. Non-zero bits past 12 blocks still fail. Update the cpuFeaturesTimeout comment in atelet to reference `runsc cpu-features --bitmask`. Signed-off-by: Shrutiya <shrutiyam@google.com>
Shrutiya Mohan (shrutiyam-glitch)
force-pushed
the
cpu-features-bitmask
branch
from
November 20, 2026 22:42
6895162 to
d643b73
Compare
This branch has not been deployed
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.
Fixes #3828
ateletpreviously ranrunsc cpu-featuresand mapped the printed feature names to bit numbers through per-architecture tables ininternal/hardware. That required updating the tables whenever gVisor added a CPU feature, or the probe would fail on the unknown name.Since gVisor release 20261026.0 (
google/gvisor@3fdb673dc0a3),runsc cpu-features --bitmaskprints the feature set directly as comma-separated0x%08xuint32block bitmasks in the same bit numberingcpu_featuresuses.gvisor-defaultin release 1.0.0 already ships20261026.0and20261102.0, so--bitmaskworks across 1.0 to 1.1 upgrades and rollbacks under the version skew policy.runsc cpu-features --bitmaskinrunRunscCPUFeaturesand encode the blocks withhardware.EncodeCPUFeatureMask. The storedcpu_featuresstring is unchanged, so existing snapshots keep matching.cpufeatures_table.go),EncodeCPUFeatures, andDecodeCPUFeatures.docs/reference/api-guide.mdthat customgvisorSandboxConfigs require gVisor release20261026.0or newer, and howatelethandles older releases.Verified on a GKE cluster: after upgrading atelet, the existing worker and a new one on the same node both record
cpu_features2e500800004003f30000000700400004219c01ab178bfbfffef83203, identical to the value the pre-upgrade atelet recorded through the name tables.AI disclosure: Used an AI coding assistant to check
runsc cpu-features --bitmasksupport in gVisor and review the diff.