drm/amdgpu: fix sdma doorbell comments typo
Subsystems (2)
PATCH 1/2 drm/amdgpu: fix sdma doorbell comments typo
--- drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu.h +1 -1
@@ -432,7 +432,7 @@ typedef enum _AMDGPU_DOORBELL64_ASSIGNMENT* default non-graphics QWORD index is 0xe0 - 0xFF inclusive */ -/* sDMA engines reserved from 0xe0 -oxef */ +/* sDMA engines reserved from 0xe0 -0xef */ AMDGPU_DOORBELL64_sDMA_ENGINE0 =0xE0 , AMDGPU_DOORBELL64_sDMA_HI_PRI_ENGINE0 =0xE1 , AMDGPU_DOORBELL64_sDMA_ENGINE1 = 0xE8,
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1539259752-15172-1-git-send-email-Frank.Min-5C7GfCeVMHo@public.gmane.org
PATCH 2/2 drm/amdgpu: skip vm entries checking while in sriov vf
vm page table would be allocated while in amdgpu_vm_init by amdgpu_allocate_static_csa for sriov, so the checking here would be skipped.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +5 -4
@@ -3100,11 +3100,12 @@ int amdgpu_vm_make_compute(struct amdgpu_device *adev, struct amdgpu_vm *vm, unsreturn r;/* Sanity checks */ -if (!RB_EMPTY_ROOT (&vm->va.rb_root) || vm->root.entries) { - r = -EINVAL ; - goto unreserve_bo; +if (!amdgpu_sriov_vf (adev)) { +if (!RB_EMPTY_ROOT (&vm->va.rb_root) || vm->root.entries) { + r = -EINVAL ; + goto unreserve_bo; + } } -if (pasid) {unsigned long flags;
Signature · 6 lines
2.7.4 _______________________________________________ amd-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 1539259752-15172-2-git-send-email-Frank.Min-5C7GfCeVMHo@public.gmane.org
Christian König
NAKRe: [PATCH 2/2] drm/amdgpu: skip vm entries checking while in sriov vf
Am 11.10.2018 um 14:09 schrieb Frank.Min:
Quoted 3 lines
vm page table would be allocated while in
amdgpu_vm_initbyamdgpu_allocate_static_csafor sriov, so the checking here would be skipped.
NAK, that checking is actually correct and points out that this doesn't work correctly.
Fix the function to be able to handle the case when there are already mappings in the VM.
Christian.
Quoted 18 lines
Change-Id Id30b86ad15ae509aeed9ed8ab60c259c88af3df5Signed-off-by Frank.Min <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-3@@ -3100,11 +3100,12 @@ int amdgpu_vm_make_compute(struct amdgpu_device *adev, struct amdgpu_vm *vm, unsreturn r;/* Sanity checks */ -if (!RB_EMPTY_ROOT (&vm->va.rb_root) || vm->root.entries) { - r = -EINVAL ; - goto unreserve_bo;
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c int amdgpu_vm_make_compute(struct amdgpu_device *adev, struct amdgpu_vm *vm, uns · line 3111
Quoted 10 lines
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +5
-1+if (!amdgpu_sriov_vf (adev)) { +if (!RB_EMPTY_ROOT (&vm->va.rb_root) || vm->root.entries) { + r = -EINVAL ; + goto unreserve_bo; + } } -if (pasid) {unsigned long flags;
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): b776d7bb-dd47-4130-fd45-9b4a432b92d5-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
Re: [PATCH 2/2] drm/amdgpu: skip vm entries checking while in sriov vf
Quoted 10 lines · Christian König
Am 11.10.2018 um 14:09 schrieb Frank.Min:
Quoted 3 lines
vm page table would be allocated while in
amdgpu_vm_initbyamdgpu_allocate_static_csafor sriov, so the checking here would be skipped.NAK, that checking is actually correct and points out that this doesn't work correctly.
Fix the function to be able to handle the case when there are already mappings in the VM.
KFD and the Thunk assume that they own the entire address space. If something is already mapped, KFD and the Thunk would not be aware of it.
amdgpu_allocate_static_csa runs during driver initialization, before there are any VMs. Looks like amdgpu_map_static_csa is the more important function here, which currently runs in amdgpu_driver_open_kms.
Could amdgpu_map_static_csa be delayed to the first time user mode maps memory into the VM through GEM APIs? That way it would allow turning a VM into a compute VM that hasn't been used for any GEM memory mappings.
Regards,
Felix
Quoted 29 lines
Christian.
Quoted 26 lines
Change-Id Id30b86ad15ae509aeed9ed8ab60c259c88af3df5Signed-off-by Frank.Min <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c| 9 +++++----1 file changed, 5 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-0@@ -3100,11 +3100,12 @@ int amdgpu_vm_make_compute(struct
amdgpu_device*adev, structamdgpu_vm*vm, uns
return r;
/* Sanity checks */
- if (!RB_EMPTY_ROOT(&vm->va.rb_root) ||vm->root.entries) { - r =-EINVAL;
- gotounreserve_bo;
+ if (!amdgpu_sriov_vf(adev)) {
+ if (!RB_EMPTY_ROOT(&vm->va.rb_root) ||vm->root.entries) { + r =-EINVAL;
+ gotounreserve_bo;
+ }
}
-
Quoted 8 lines
Quoted 3 lines
if (pasid) {
unsigned long flags;_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 9dcce91a-2176-feea-9a89-19fa1b55959a-5C7GfCeVMHo@public.gmane.org
RE: [PATCH 2/2] drm/amdgpu: skip vm entries checking while in sriov vf
Quoted 24 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Felix Kuehling
Sent: Friday, October 12, 2018 3:46 AM
To: Koenig, Christian <[email protected]>; Min, Frank <[email protected]>; [email protected]
Subject: Re: [PATCH 2/2] drm/amdgpu: skip vm entries checking while in sriov vfQuoted 10 lines · Christian König
Am 11.10.2018 um 14:09 schrieb Frank.Min:
Quoted 3 lines
vm page table would be allocated while in
amdgpu_vm_initbyamdgpu_allocate_static_csafor sriov, so the checking here would be skipped.NAK, that checking is actually correct and points out that this doesn't work correctly.
Fix the function to be able to handle the case when there are already mappings in the VM.
KFD and the Thunk assume that they own the entire address space. If something is already mapped, KFD and the Thunk would not be aware of it.
Quoted 9 lines
amdgpu_allocate_static_csaruns during driver initialization, before there are any VMs. Looks likeamdgpu_map_static_csais the more important function here, which currently runs inamdgpu_driver_open_kms.Could
amdgpu_map_static_csabe delayed to the first time user mode maps memory into the VM through GEM APIs? That way it would allow turning a VM into a compute VM that hasn't been used for any GEM memory mappings.
Yes. Frank and I found, while we do acquire_process_vm(), the vm->va RB trees are always not empty under SRIOV, because amdgpu_map_static_csa() will be called while vm inits under SRIOV, that will actually map the CSA BO to the VM and insert the node into vm->va before it acquires process VM in KFD.
Thanks,
Ray
Quoted 41 lines
Regards,
FelixQuoted 29 lines
Christian.
Quoted 26 lines
Change-Id Id30b86ad15ae509aeed9ed8ab60c259c88af3df5Signed-off-by Frank.Min <[email protected]>---
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c| 9 +++++----1 file changed, 5 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-0@@ -3100,11 +3100,12 @@ int amdgpu_vm_make_compute(struct
amdgpu_device*adev, structamdgpu_vm*vm, uns
return r;
/* Sanity checks */
- if (!RB_EMPTY_ROOT(&vm->va.rb_root) ||vm->root.entries) { - r =-EINVAL;
- gotounreserve_bo;
+ if (!amdgpu_sriov_vf(adev)) {
+ if (!RB_EMPTY_ROOT(&vm->va.rb_root) ||vm->root.entries) { + r =-EINVAL;
+ gotounreserve_bo;
+ }
}
-Quoted 8 lines
Quoted 3 lines
if (pasid) {
unsigned long flags;_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): BY2PR12MB00408D294FB316A26BD59330ECE20-K//h7OWB4q7Zvl48JdS6+wdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Re: [PATCH 2/2] drm/amdgpu: skip vm entries checking while in sriov vf
Am 12.10.2018 um 06:05 schrieb Huang, Ray:
Quoted 26 lines
Quoted 26 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Felix Kuehling
Sent: Friday, October 12, 2018 3:46 AM
To: Koenig, Christian <[email protected]>; Min, Frank <[email protected]>; [email protected]
Subject: Re: [PATCH 2/2] drm/amdgpu: skip vm entries checking while in sriov vfQuoted 9 lines · Christian König
Am 11.10.2018 um 14:09 schrieb Frank.Min:
Quoted 3 lines
vm page table would be allocated while in
amdgpu_vm_initbyamdgpu_allocate_static_csafor sriov, so the checking here would be skipped.NAK, that checking is actually correct and points out that this doesn't work correctly.
Fix the function to be able to handle the case when there are already mappings in the VM.
KFD and the Thunk assume that they own the entire address space. If something is already mapped, KFD and the Thunk would not be aware of it.
amdgpu_allocate_static_csaruns during driver initialization, before there are any VMs. Looks likeamdgpu_map_static_csais the more important function here, which currently runs inamdgpu_driver_open_kms.
Quoted 6 lines
Quoted 5 lines
Could
amdgpu_map_static_csabe delayed to the first time user mode maps memory into the VM through GEM APIs? That way it would allow turning a VM into a compute VM that hasn't been used for any GEM memory mappings.Yes. Frank and I found, while we do
acquire_process_vm(), thevm->vaRB trees are always not empty under SRIOV, becauseamdgpu_map_static_csa()will be called while vm inits under SRIOV, that will actually map the CSA BO to the VM and insert the node intovm->vabefore it acquires process VM in KFD.
Yeah and exactly that will clash with the KFD.
Could be that it still works initially because the CSA is not mapped at the beginning of the address space IIRC, but we need to clean that up in the long term.
We should either delay adding the CSA BO to the VM (probably best done during context creation).
Or we start to make nails with heads and move the CSA BO into the context altogether. We are going to need this anyway for MCBP, so that would be a good first step.
Ray/Frank can anybody of you take care of this?
Thanks,
Christian.
Quoted 45 lines
Thanks,
RayQuoted 41 lines
Regards,
FelixQuoted 26 lines
Christian.
Quoted 24 lines
Change-Id Id30b86ad15ae509aeed9ed8ab60c259c88af3df5Signed-off-by Frank.Min <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-0@@ -3100,11 +3100,12 @@ int amdgpu_vm_make_compute(struct
amdgpu_device*adev, structamdgpu_vm*vm, uns
return r;
/* Sanity checks */
- if (!RB_EMPTY_ROOT(&vm->va.rb_root) ||vm->root.entries) { - r =-EINVAL;
- gotounreserve_bo;
+ if (!amdgpu_sriov_vf(adev)) {
+ if (!RB_EMPTY_ROOT(&vm->va.rb_root) ||vm->root.entries) { + r =-EINVAL;
+ gotounreserve_bo;
+ }
}Quoted 8 lines
Quoted 4 lines
-
if (pasid) {
unsigned long flags;_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): 27b55866-bacf-422e-b357-79459cf8a911-5C7GfCeVMHo@public.gmane.org
RE: [PATCH 2/2] drm/amdgpu: skip vm entries checking while in sriov vf
Quoted 51 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Koenig, Christian
Sent: Friday, October 12, 2018 3:25 PM
To: Huang, Ray <[email protected]>; Kuehling, Felix <[email protected]>; Min, Frank <[email protected]>; amd- [email protected]
Subject: Re: [PATCH 2/2] drm/amdgpu: skip vm entries checking while in sriov vfAm 12.10.2018 um 06:05 schrieb Huang, Ray:
Quoted 14 lines
Quoted 14 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Felix Kuehling
Sent: Friday, October 12, 2018 3:46 AM
To: Koenig, Christian <[email protected]>; Min, Frank <[email protected]>; [email protected]
Subject: Re: [PATCH 2/2] drm/amdgpu: skip vm entries checking while in sriov vfQuoted 4 lines · Christian König
Am 11.10.2018 um 14:09 schrieb Frank.Min:
Quoted 3 lines
vm page table would be allocated while in
amdgpu_vm_initbyamdgpu_allocate_static_csafor sriov, so the checking here would be skipped.Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
NAK, that checking is actually correct and points out that this doesn't work correctly.
Fix the function to be able to handle the case when there are already mappings in the VM.
KFD and the Thunk assume that they own the entire address space. If something is already mapped, KFD and the Thunk would not be aware of
it.
Quoted 4 lines
Quoted 4 lines
amdgpu_allocate_static_csaruns during driver initialization, before there are any VMs. Looks likeamdgpu_map_static_csais the more important function here, which currently runs in
amdgpu_driver_open_kms.Quoted 7 lines
Quoted 6 lines
Could
amdgpu_map_static_csabe delayed to the first time user mode maps memory into the VM through GEM APIs? That way it would allow turning a VM into a compute VM that hasn't been used for any GEM memory mappings.Yes. Frank and I found, while we do
acquire_process_vm(), thevm->vaRBtrees are always not empty under SRIOV, because
amdgpu_map_static_csa()will be called while vm inits under SRIOV, that will actually map the CSA BO to the VM and insert the node intovm->vabefore it acquires process VM in KFD.
Quoted 8 lines
Yeah and exactly that will clash with the KFD.
Could be that it still works initially because the CSA is not mapped at the beginning of the address space IIRC, but we need to clean that up in the long term.
We should either delay adding the CSA BO to the VM (probably best done during context creation).
Yes, we planed to create sdma csa buffer when context creation.
Quoted 1 line
Or we start to make nails with heads and move the CSA BO into the context
So we can add the sdma_csa bo/static_csa in the struct amdgpu_ctx?
Best Regards
Rex
Quoted 54 lines
altogether. We are going to need this anyway for MCBP, so that would be a good first step.
Ray/Frank can anybody of you take care of this?
Thanks,
Christian.Quoted 45 lines
Thanks,
RayQuoted 41 lines
Regards,
FelixQuoted 26 lines
Christian.
Quoted 24 lines
Change-Id Id30b86ad15ae509aeed9ed8ab60c259c88af3df5Signed-off-by Frank.Min <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-0@@ -3100,11 +3100,12 @@ int amdgpu_vm_make_compute(struct
amdgpu_device*adev, structamdgpu_vm*vm, uns
return r;
/* Sanity checks */
- if (!RB_EMPTY_ROOT(&vm->va.rb_root) ||vm->root.entries) { - r =-EINVAL;
- gotounreserve_bo;
+ if (!amdgpu_sriov_vf(adev)) {
+ if (!RB_EMPTY_ROOT(&vm->va.rb_root) ||vm->root.entries) { + r =-EINVAL;
+ gotounreserve_bo;
+ }
}Quoted 8 lines
Quoted 4 lines
-
if (pasid) {
unsigned long flags;_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
Quoted 4 lines
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
A message that is not in the archive (sent off-list or not yet received): BYAPR12MB2775CBBCA321F3C4A0317BBFFBE20-ZGDeBxoHBPmJeBUhB162ZQdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org
Re: [PATCH 2/2] drm/amdgpu: skip vm entries checking while in sriov vf
Am 12.10.2018 um 09:31 schrieb Zhu, Rex:
Quoted 54 lines
Quoted 54 lines
-----Original Message-----
From: amd-gfx <[email protected]> On Behalf Of Koenig, Christian
Sent: Friday, October 12, 2018 3:25 PM
To: Huang, Ray <[email protected]>; Kuehling, Felix <[email protected]>; Min, Frank <[email protected]>; amd- [email protected]
Subject: Re: [PATCH 2/2] drm/amdgpu: skip vm entries checking while in sriov vfAm 12.10.2018 um 06:05 schrieb Huang, Ray:
Quoted 14 lines
Quoted 14 lines
-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Felix Kuehling
Sent: Friday, October 12, 2018 3:46 AM
To: Koenig, Christian <[email protected]>; Min, Frank <[email protected]>; [email protected]
Subject: Re: [PATCH 2/2] drm/amdgpu: skip vm entries checking while in sriov vfQuoted 4 lines · Christian König
Am 11.10.2018 um 14:09 schrieb Frank.Min:
Quoted 3 lines
vm page table would be allocated while in
amdgpu_vm_initbyamdgpu_allocate_static_csafor sriov, so the checking here would be skipped.Quoted 7 lines
Quoted 7 lines
Quoted 5 lines
NAK, that checking is actually correct and points out that this doesn't work correctly.
Fix the function to be able to handle the case when there are already mappings in the VM.
KFD and the Thunk assume that they own the entire address space. If something is already mapped, KFD and the Thunk would not be aware of
it.
Quoted 3 lines
Quoted 3 lines
amdgpu_allocate_static_csaruns during driver initialization, before there are any VMs. Looks likeamdgpu_map_static_csais the more important function here, which currently runs in
amdgpu_driver_open_kms.Quoted 6 lines
Quoted 5 lines
Could
amdgpu_map_static_csabe delayed to the first time user mode maps memory into the VM through GEM APIs? That way it would allow turning a VM into a compute VM that hasn't been used for any GEM memory mappings.Yes. Frank and I found, while we do
acquire_process_vm(), thevm->vaRBtrees are always not empty under SRIOV, because
amdgpu_map_static_csa()will be called while vm inits under SRIOV, that will actually map the CSA BO to the VM and insert the node intovm->vabefore it acquires process VM in KFD.Yeah and exactly that will clash with the KFD.
Could be that it still works initially because the CSA is not mapped at the beginning of the address space IIRC, but we need to clean that up in the long term.
Quoted 6 lines
Quoted 2 lines
We should either delay adding the CSA BO to the VM (probably best done during context creation).
Yes, we planed to create sdma csa buffer when context creation.
Quoted 1 line
Or we start to make nails with heads and move the CSA BO into the context
So we can add the
sdma_csabo/static_csa in the structamdgpu_ctx?
Yes, exactly that's my idea as well.
Regards,
Christian.
Quoted 59 lines
Best Regards
RexQuoted 55 lines
altogether. We are going to need this anyway for MCBP, so that would be a good first step.
Ray/Frank can anybody of you take care of this?Thanks,
Christian.Quoted 44 lines
Thanks,
RayQuoted 41 lines
Regards,
FelixQuoted 26 lines
Christian.
Quoted 24 lines
Change-Id Id30b86ad15ae509aeed9ed8ab60c259c88af3df5Signed-off-by Frank.Min <[email protected]>--- drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-)drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c +0
-0@@ -3100,11 +3100,12 @@ int amdgpu_vm_make_compute(struct
amdgpu_device*adev, structamdgpu_vm*vm, uns
return r;
/* Sanity checks */
- if (!RB_EMPTY_ROOT(&vm->va.rb_root) ||vm->root.entries) { - r =-EINVAL;
- gotounreserve_bo;
+ if (!amdgpu_sriov_vf(adev)) {
+ if (!RB_EMPTY_ROOT(&vm->va.rb_root) ||vm->root.entries) { + r =-EINVAL;
+ gotounreserve_bo;
+ }
}Quoted 8 lines
Quoted 4 lines
-
if (pasid) {
unsigned long flags;_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx