Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prep for DriverKit #23

Open
wants to merge 5 commits into
base: main
Choose a base branch
from
Open

Prep for DriverKit #23

wants to merge 5 commits into from

Conversation

birkelund
Copy link
Collaborator

@birkelund birkelund commented Sep 6, 2024

This PR tracks preparations for merging the DriverKit backend.

The first part of this is the new iommu_dmabuf API. This encapsulates memory allocation and mapping which should remove the need for the opaque pointer changes to iommu_map_vaddr and the pgmap APIs. Instead, the DriverKit backend can implement its own version of the iommu_dmabuf API.

The second part is to abstract register mmio. DriverKit cannot read/write to specific addresses and must call an API function that expects the base address and an offset. Abstract this in nvme/core but leave the public API otherwise unchanged for now.

Move nvme_set_errno_from_cqe to header such that rq_test does not need
to link with nvme/util.c.

Signed-off-by: Klaus Jensen <[email protected]>
Add iommu/dmabuf.h which helps allocating and mapping DMA buffers.

Signed-off-by: Klaus Jensen <[email protected]>
Replace all pgmap/iommu_map_vaddr pairs with iommu_get/put_dmabuf.

Signed-off-by: Klaus Jensen <[email protected]>
@birkelund birkelund added enhancement New feature or request help wanted Extra attention is needed approved Approved for device testing labels Sep 6, 2024
@birkelund birkelund self-assigned this Sep 6, 2024
The mmio helpers assume that we can read and write to a specific
address. The proposed DriverKit backend cannot do that and must call
specific functions on a base address and an offset.

In the core, prepare for DriverKit to provide its own implementation of
doing that.

This is a simplified version of commit "mmio: convert calls of 'addr +
offset' to 'base-addr, offset'" to limit the change to the nvme core.

Signed-off-by: Mads Ynddal <[email protected]>
[k.jensen: limit the change to nvme/core for now]
Signed-off-by: Klaus Jensen <[email protected]>
Within DriverKit we cannot use malloc/free but have to use the DriverKit
specific IOMallocZero and IOFree.

Signed-off-by: Mads Ynddal <[email protected]>
[k.jensen: allowed more generic functions to be retained]
Signed-off-by: Klaus Jensen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Approved for device testing enhancement New feature or request help wanted Extra attention is needed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants