Skip to content

[rocjitsu] Avoid GuestKfd sysfs re-entry on reopen - #9793

Merged
kuhar merged 1 commit into
developfrom
users/kuhar/fix-guest-kfd-reopen
Aug 7, 2026
Merged

kuhar merged 1 commit into
developfrom
users/kuhar/fix-guest-kfd-reopen

Conversation

@kuhar

@kuhar kuhar commented Aug 6, 2026

Copy link
Copy Markdown
Member

PR #9213 added physical topology validation while GuestKfd::mutex_ is held. Enumerating the real topology through std::filesystem re-enters the sysfs interposer, which attempts to acquire the same mutex and blocks subsequent /dev/kfd opens.

Enumerate and inspect topology nodes through libc_passthrough so host validation reaches the real sysfs directly. Add a focused lifecycle test covering close followed by reopen.

Tests:

  • GuestKfd timeout cluster: 9/9 passed
  • GuestKfd tests: 12/12 passed
  • Full CTest: 2720 passed, 3 skipped, 2 unrelated failures

@kuhar
kuhar requested review from amd-arosa and atgutier August 6, 2026 19:42
@kuhar
kuhar requested a review from a team as a code owner August 6, 2026 19:42
Copilot AI lite review requested due to automatic review settings August 6, 2026 19:42

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot encountered an error and was unable to review this pull request. You can try again by re-requesting a review.

@atgutier atgutier left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

PR #9213 added physical topology validation while GuestKfd::mutex_ is held. Enumerating the real topology through std::filesystem re-enters the sysfs interposer, which attempts to acquire the same mutex and blocks subsequent /dev/kfd opens.

Enumerate and inspect topology nodes through libc_passthrough so host validation reaches the real sysfs directly. Add a focused lifecycle test covering close followed by reopen.

Tests:
- GuestKfd timeout cluster: 9/9 passed
- GuestKfd tests: 12/12 passed
- Full CTest: 2720 passed, 3 skipped, 2 unrelated failures
@kuhar
kuhar force-pushed the users/kuhar/fix-guest-kfd-reopen branch from 4d3a4b7 to f9f4236 Compare August 7, 2026 01:15
@therock-pr-bot

therock-pr-bot Bot commented Aug 7, 2026 •

Copy link
Copy Markdown

✅ All Checks Passed — Ready for Review

Check Status Details
📝 PR Description ✅ Pass —
⛔ Forbidden Files ✅ Pass —
🧪 Unit Test ✅ Pass —
🔎 pre-commit ✅ Pass —
🚫 Draft PR 🔜 To Be Enabled —
🚩 Feature Flag 🔜 To Be Enabled —
📊 Code Coverage 🔜 To Be Enabled —
🤖 therock-pr-bot ✅ Pass —

🎉 All checks passed! This PR is ready for review.

📖 Need help? See the Policy FAQ for details on every check and how to fix failures.

🙋 Wish to Override Policy?

@therock-pr-bot

therock-pr-bot Bot commented Aug 7, 2026

Copy link
Copy Markdown

🎉 All checks passed! This PR is ready for review.

@kuhar
kuhar merged commit 92115a2 into develop Aug 7, 2026
31 of 36 checks passed
@kuhar
kuhar deleted the users/kuhar/fix-guest-kfd-reopen branch August 7, 2026 11:16
theSK2005 added a commit that referenced this pull request Aug 7, 2026
Reconciles this branch's evolved EXEC/register-spilling work with develop's
official EXEC-tracking merge (#7470) and picks up develop-only changes
(#9793 GuestKfd, scoped_cfg_edges extraction, analysis-layer additions).

Conflict resolution:
- amdgpu_code_object.{h,cpp} and tests/code/amdgpu_code_object_test.cpp:
  kept this branch's version. Its kernel_descriptor_scan / KernelDescriptorInfo
  refactor supersedes #7470's AmdGpuCodeObject::kernel_wavefront_size and
  ::kernel_entry_text_offsets members, which are removed here.
- patch/instrumentor.cpp: kept this branch's body (scan_kernel_descriptors +
  the kernel_wavefront_size free function), and added develop's
  analysis/exec_state.h include -- required because develop's LivenessAnalysis
  now holds a unique_ptr<ExecMaskAnalysis>, whose complete type is needed
  wherever a LivenessAnalysis is destroyed (instrumentor.cpp constructs one).
- tests/patch/instrumentor_test.cpp: kept this branch's version; develop's
  added cases exercised the removed members (covered here by
  kernel_descriptor_scan_test.cpp instead).

Adopted develop's analysis layer (liveness 4-arg exec signature,
exec_state/def_use, scoped_cfg_edges.{h,cpp}, binary_translator refactor)
which this branch had not modified. Builds clean.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants