Backport the ARM64 VNCR fixmap state fix - #920
Conversation
Apply Linux 5949004d7032 unchanged to the 6.18.44 ARM host and guest patch set. Keep the per-CPU mapped flag, owner CPU, fixmap PTE and map count synchronized before translating a replacement VNCR page. The actual-C regression fails on successful retranslation and early translation failure without the patch, passes with it, and fails again with only the patch removed. All four kernel-patch tests and make lint pass. The full host patch set applies to official 6.18.44 source with zero fuzz; guest kernel compilation is pending the shared setup slot.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 📒 Files selected for processing (4)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughThe patch centralizes VNCR fixmap teardown and updates translation handling to reset mapping state before retranslating. New fixtures and an integration test compile and execute the patched kernel code across mapped, unmapped, successful, and failing translation scenarios. ChangesVNCR fixmap state
Priority: ⬇️ Low — Defer this ARM64 KVM VNCR state fix because its scope is limited to synchronizing fixmap teardown and regression coverage for a specific kernel path. Estimated code review effort: 3 (Moderate) | ~20 minutes Merge Risk: ⚪ Minimal · up to This change keeps ARM64 nested-virtualization VNCR mapping state synchronized during retranslation and vCPU teardown, preventing stale state from triggering teardown failures. Covered state-transition scenarios pass with no active merge-blocking risk. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 8 functions across 3 files. (1 skipped: 1 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
@coderabbitai review |
|
|
@coderabbitai review |
✅ Action performedReview finished.
|
ejc3
left a comment
There was a problem hiding this comment.
NOT-A-DEFECT: The docstring-percentage warning is a style metric. The nested.c fixture intentionally preserves verbatim Linux 6.18.44 functions; the fixture, harness and Rust test document their provenance and tested scenarios. Adding comments solely to meet a percentage would alter the upstream excerpt without improving this regression test.
Backport upstream Linux 5949004d7032767e8fde1e8c986a33f241b2a192 to the carried ARM64 kernel patches. The pinned 6.18.44 source still invalidates the VNCR fixmap without clearing its per-CPU flag or map count. Successful retranslation then sets the CPU ID to -1, leaving state that can trigger the schedule-out BUG_ON.
Targets
mainafter parent #919 merged.The production patch is byte-identical to upstream, with its authorship retained: 17 additions and 10 deletions in nested.c. It shares the CPU-local reset helper between translation and vCPU put. The normal patch globs include it in both ARM host and guest build inputs. No kernel version, DSB barrier, PSCI/WFx patch, or FUSE change is included.
Evidence:
arm64_vncr_retranslation_releases_cpu_mapping_before_vcpu_putcompiles and executes verbatim v6.18.44 C functions with dependencies stubbed, after applying the carried patch.vmlinux-nested-6.18.44-aarch64-0f3464ff2fe9.bin. All 16 expected jobs are present (15 passed; the unrelated benchmark harness job was skipped).The C regression proves this single-CPU state transition, not hardware TLB behavior or the remaining nested-ARM hypotheses. Without the fix, it fails its inconsistent-state assertion before the later vCPU-put call; it does not reproduce a hardware kernel crash. No host kernel has been installed, no host reboot or crashing nested reproduction has been attempted, and no upstream submission has been opened.
Addresses the VNCR-fix item in #770. The remaining patch audit and ARM validation stay open.
Upstream: torvalds/linux@5949004
Summary by CodeRabbit
Bug Fixes
Tests