fix bad DMA from INTERRUPT_CNTL2
Subsystems (2)
v2 cover fix bad DMA from INTERRUPT_CNTL2
A couple of notes:
- Initial discussion:
https://lists.freedesktop.org/archives/dri-devel/2019-November/244090.html
- I have only tested the case that uses r600_irq_init(), but they are all very similar.
Cheers,
Sam.
Patch set changelog follows:
Patch set v2:
Patch 1/2: drm/radeon: fix bad DMA from INTERRUPT_CNTL2
- Split amdgpu changes into separate patch.
Patch 2/2 (new in this version): drm/amdgpu: fix bad DMA from INTERRUPT_CNTL2
Patch set v1:
Patch 1/1: drm/radeon drm/amdgpu: fix bad DMA from INTERRUPT_CNTL2
Sam Bobroff (2):
drm/radeon: fix bad DMA from INTERRUPT_CNTL2
drm/amdgpu: fix bad DMA from INTERRUPT_CNTL2
drivers/gpu/drm/amd/amdgpu/si_ih.c | 3 ++- drivers/gpu/drm/radeon/cik.c | 4 ++-- drivers/gpu/drm/radeon/r600.c | 4 ++-- drivers/gpu/drm/radeon/si.c | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-)
Signature · 6 lines
2.22.0.216.g00a2a96fc9 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 1/2 drm/radeon: fix bad DMA from INTERRUPT_CNTL2
The INTERRUPT_CNTL2 register expects a valid DMA address, but is currently set with a GPU MC address. This can cause problems on systems that detect the resulting DMA read from an invalid address (found on a Power8 guest).
Instead, use the DMA address of the dummy page because it will always be safe.
---
v2 - Split amdgpu changes into separate patch.
drivers/gpu/drm/radeon/cik.c | 4 ++-- drivers/gpu/drm/radeon/r600.c | 4 ++-- drivers/gpu/drm/radeon/si.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-)
drivers/gpu/drm/radeon/cik.c +2 -2
@@ -6969,8 +6969,8 @@ static int cik_irq_init(struct radeon_device *rdev) }/* setup interrupt control */ -/* XXX this should actually be a bus address, not an MC address. same on older asics */ -WREG32 (INTERRUPT_CNTL2 , rdev->ih.gpu_addr >>8 ); +/* set dummy read address to dummy page address */ +WREG32 (INTERRUPT_CNTL2 , rdev->dummy_page.addr >>8 ); interrupt_cntl =RREG32 (INTERRUPT_CNTL );/* IH_DUMMY_RD_OVERRIDE=0 - dummy read disabled with msi, enabled without msi * IH_DUMMY_RD_OVERRIDE=1 - dummy read controlled by IH_DUMMY_RD_EN
drivers/gpu/drm/radeon/r600.c +2 -2
@@ -3696,8 +3696,8 @@ int r600_irq_init(struct radeon_device *rdev) }/* setup interrupt control */ -/* set dummy read address to ring address */ -WREG32 (INTERRUPT_CNTL2 , rdev->ih.gpu_addr >>8 ); +/* set dummy read address to dummy page address */ +WREG32 (INTERRUPT_CNTL2 , rdev->dummy_page.addr >>8 ); interrupt_cntl =RREG32 (INTERRUPT_CNTL );/* IH_DUMMY_RD_OVERRIDE=0 - dummy read disabled with msi, enabled without msi * IH_DUMMY_RD_OVERRIDE=1 - dummy read controlled by IH_DUMMY_RD_EN
drivers/gpu/drm/radeon/si.c +2 -2
@@ -5997,8 +5997,8 @@ static int si_irq_init(struct radeon_device *rdev) }/* setup interrupt control */ -/* set dummy read address to ring address */ -WREG32 (INTERRUPT_CNTL2 , rdev->ih.gpu_addr >>8 ); +/* set dummy read address to dummy page address */ +WREG32 (INTERRUPT_CNTL2 , rdev->dummy_page.addr >>8 ); interrupt_cntl =RREG32 (INTERRUPT_CNTL );/* IH_DUMMY_RD_OVERRIDE=0 - dummy read disabled with msi, enabled without msi * IH_DUMMY_RD_OVERRIDE=1 - dummy read controlled by IH_DUMMY_RD_EN
Signature · 6 lines
2.22.0.216.g00a2a96fc9 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
PATCH v2 2/2 drm/amdgpu: fix bad DMA from INTERRUPT_CNTL2
In reply to Sam BobroffThe INTERRUPT_CNTL2 register expects a valid DMA address, but is currently set with a GPU MC address. This can cause problems on systems that detect the resulting DMA read from an invalid address (found on a Power8 guest).
Instead, use the DMA address of the dummy page because it will always be safe.
---
v2 * New in this version.
drivers/gpu/drm/amd/amdgpu/si_ih.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/si_ih.c +2 -1
@@ -64,7 +64,8 @@ static int si_ih_irq_init(struct amdgpu_device *adev)u32 interrupt_cntl, ih_cntl, ih_rb_cntl;si_ih_disable_interrupts (adev); -WREG32 (INTERRUPT_CNTL2 , adev->irq.ih.gpu_addr >>8 ); +/* set dummy read address to dummy page address */ +WREG32 (INTERRUPT_CNTL2 , adev->dummy_page_addr >>8 ); interrupt_cntl =RREG32 (INTERRUPT_CNTL ); interrupt_cntl &= ~IH_DUMMY_RD_OVERRIDE ; interrupt_cntl &= ~IH_REQ_NONSNOOP_EN ;
Signature · 6 lines
2.22.0.216.g00a2a96fc9 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Alex Deucher
AppliedQuoted 11 lines · Sam Bobroff
A couple of notes:
- Initial discussion:
https://lists.freedesktop.org/archives/dri-devel/2019-November/244090.html
- I have only tested the case that usesr600_irq_init(), but they are all very similar.Cheers,
Sam.Patch set changelog follows:
Applied the series. Thanks!
Alex
Quoted 13 lines
Patch set v2:
Patch 1/2: drm/radeon: fix bad DMA fromINTERRUPT_CNTL2
- Split amdgpu changes into separate patch.
Patch 2/2 (new in this version): drm/amdgpu: fix bad DMA fromINTERRUPT_CNTL2Patch set v1:
Patch 1/1: drm/radeon drm/amdgpu: fix bad DMA fromINTERRUPT_CNTL2Sam Bobroff (2):
drm/radeon: fix bad DMA fromINTERRUPT_CNTL2
drm/amdgpu: fix bad DMA fromINTERRUPT_CNTL2
Quoted 9 lines
drivers/gpu/drm/amd/amdgpu/si_ih.c | 3 ++- drivers/gpu/drm/radeon/cik.c | 4 ++-- drivers/gpu/drm/radeon/r600.c | 4 ++-- drivers/gpu/drm/radeon/si.c | 4 ++-- 4 files changed, 8 insertions(+), 7 deletions(-)--
2.22.0.216.g00a2a96fc9
_______________________________________________
dri-devel mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/dri-devel