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

Update doorbell->size to support large default PAGE_SIZE kernels #100

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Xinmudotmoe
Copy link
Contributor

In some architectures, the default page size of the kernel can be configured (such as PPC, LoongArch). In ROCK-Kernel-Driver, PAGE_SIZE is processed to ensure that there will be no abnormal allocation.

However, this project does not deal with PAGE_SIZE changes. When PAGE_SIZE exceeds 8K, an exception will occur.

This patch does not affect the architecture of the 4K default page size (such as AMD64) as much as possible. And when the page size exceeds 8K, keep it as consistent with the driver as possible.

The following is the general process of triggering an exception, and there will be no exception after repair.

sequenceDiagram
process ->> hsaKmtCreateQueue : 
hsaKmtCreateQueue ->> get_doorbell_map_info : only gen `4k` or `8k`
get_doorbell_map_info ->> hsaKmtCreateQueue : 
hsaKmtCreateQueue ->> map_doorbell_dgpu : 
map_doorbell_dgpu ->> k.kfd_ioctl_alloc_memory_of_gpu : 
k.kfd_ioctl_alloc_memory_of_gpu ->> k.kfd_doorbell_process_slice : check size
k.kfd_doorbell_process_slice ->> k.PAGE_SIZE : roundup BY PAGE_SIZE
k.kfd_doorbell_process_slice -->> map_doorbell_dgpu : if PAGE_SIZE > 8k, will EINVAL .
map_doorbell_dgpu -->> hsaKmtCreateQueue : FAILED
Loading

@kentrussell
Copy link
Contributor

We've pulled this internally and it should make it to the next release. Thanks for your contribution!

@kentrussell
Copy link
Contributor

So this one missed 6.1, but it should be in the 6.2 release.

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