Skip to content

zocl: release the AIE partition unless libdfx owns it - #10142

Merged
chvamshi-xilinx merged 2 commits into
Xilinx:masterfrom
ManojTakasi:zocl-libdfx-aie-and-edf-yocto
Oct 28, 2026
Merged

chvamshi-xilinx merged 2 commits into
Xilinx:masterfrom
ManojTakasi:zocl-libdfx-aie-and-edf-yocto

Conversation

@ManojTakasi

@ManojTakasi ManojTakasi commented Oct 27, 2026 •

Copy link
Copy Markdown
Collaborator

Problem solved by the commit

Slot 0 is used for both libdfx and non-libdfx loads. zocl_detach_aie() skipped aie_partition_release() for every slot 0, so a non-libdfx load never released the AIE partition zocl had requested with aie_partition_request().

On a libdfx load the destroy-hw-context ioctl runs first, and libdfxRemoveOverlay() does the configfs rmdir only after that ioctl returns. That rmdir runs aie_part_remove(). Releasing the partition inside the ioctl removes it a second time and oopses. That skip has to follow the libdfx dtbo path, not the slot index.

Bug / issue (if any) fixed, which PR introduced the bug, how it was discovered

Follow-up to #10124 (CR-1285405). The slot-0 detach fixed the libdfx double remove, and it also skipped the release on a non-libdfx slot 0 load.

How problem was solved, alternative solutions (if any) and why they were rejected

zocl_destroy_aie() now skips aie_partition_release() only when slot->slot_xclbin->zx_dtbo_path is non-empty. That path is stored at load time from za_dtbo_path_len. An empty path is not libdfx, because the ioctl still passes a pointer. zocl_detach_aie() is removed, and both hardware-context destroy paths call zocl_destroy_aie().

Keeping a second function that is identical except for the release call was rejected. The two paths differ by one condition, and that condition is known on the slot at destroy time.

Risks (if any) associated the changes in the commit

A libdfx slot with a non-empty dtbo path no longer releases the partition from zocl. The overlay rmdir remains the single aie_part_remove(). A non-libdfx slot, including slot 0, releases the partition it requested. zocl_aie_slot_reset() still releases unconditionally; the hardware-context exit path does not call reset.

What has been tested and how, request additional testing if necessary

Tested both the testcases:

  • libdfx VCK190: run host.exe twice back to back (CR-1285405).
  • non-libdfx VEK280: slot 0 AIE xclbin: destroy the hardware context and load again.

Documentation impact (if any)

None.

ManojTakasi and others added 2 commits October 27, 2026 13:58
Slot number is not a libdfx marker. Skip aie_partition_release only when
the slot has a non-empty dtbo path, so a second run does not double-free
a libdfx partition and a non-libdfx slot still releases the partition
zocl requested.

Co-authored-by: Cursor <cursoragent@cursor.com>
The current EDF flow sources edf-init-build-env and packages xrt into
amd_cortexa72_common, not cortexa72_cortexa53. Copy those RPMs with the
zocl packages and point the manifest at Yocto_edf_2026.2_10230002.

Co-authored-by: Cursor <cursoragent@cursor.com>
@github-actions

Copy link
Copy Markdown
Contributor

clang-tidy review says "All clean, LGTM! 👍"

@chvamshi-xilinx
chvamshi-xilinx merged commit cf4177d into Xilinx:master Oct 28, 2026
26 checks passed
ManojTakasi added a commit to ManojTakasi/XRT that referenced this pull request Oct 28, 2026
* zocl: release the AIE partition unless libdfx owns it

Slot number is not a libdfx marker. Skip aie_partition_release only when
the slot has a non-empty dtbo path, so a second run does not double-free
a libdfx partition and a non-libdfx slot still releases the partition
zocl requested.

Co-authored-by: Cursor <cursoragent@cursor.com>

* build: copy EDF xrt RPMs from the common arch directory

The current EDF flow sources edf-init-build-env and packages xrt into
amd_cortexa72_common, not cortexa72_cortexa53. Copy those RPMs with the
zocl packages and point the manifest at Yocto_edf_2026.2_10230002.

Co-authored-by: Cursor <cursoragent@cursor.com>

---------

Co-authored-by: Cursor <cursoragent@cursor.com>
(cherry picked from commit cf4177d)
chvamshi-xilinx pushed a commit that referenced this pull request Oct 28, 2026
* zocl: release the AIE partition unless libdfx owns it

Slot number is not a libdfx marker. Skip aie_partition_release only when
the slot has a non-empty dtbo path, so a second run does not double-free
a libdfx partition and a non-libdfx slot still releases the partition
zocl requested.



* build: copy EDF xrt RPMs from the common arch directory

The current EDF flow sources edf-init-build-env and packages xrt into
amd_cortexa72_common, not cortexa72_cortexa53. Copy those RPMs with the
zocl packages and point the manifest at Yocto_edf_2026.2_10230002.



---------


(cherry picked from commit cf4177d)

Co-authored-by: Cursor <cursoragent@cursor.com>
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