Skip to contentSkip to conversation

drm/amdgpu: fix 64bit shift for KV/KB

PATCH In review Christian König 4 participants 5 messages Jan 24, 2017 3 messages not in the archive

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/amdgpu: fix 64bit shift for KV/KB

From: Christian König <[email protected]>

Fixes "access stolen VRAM directly on KV/KB" otherwise that won't work as expected with more than 4GB RAM.

---
 drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +1 -1
index ccce04d..8d05e0c 100644
@@ -378,7 +378,7 @@ static int gmc_v7_0_mc_init(struct amdgpu_device *adev)
 
 #ifdef CONFIG_X86_64
 	if (adev->flags & AMD_IS_APU) {
-		adev->mc.aper_base = RREG32(mmMC_VM_FB_OFFSET) << 22ULL;
+		adev->mc.aper_base = ((u64)RREG32(mmMC_VM_FB_OFFSET)) << 22;
 		adev->mc.aper_size = adev->mc.real_vram_size;
 	}
 #endif
Signature · 6 lines
2.5.0

_______________________________________________
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): 1485266973-1664-1-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org

#2 lore raw

PATCH 2/2 drm/amdgpu: fix 64bit shift for CZ

From: Christian König <[email protected]>

Fixes "access stolen VRAM directly on CZ", otherwise that won't work as expected with more than 4GB RAM.

---
 drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +1 -1
index a564e89..7669b32 100644
@@ -470,7 +470,7 @@ static int gmc_v8_0_mc_init(struct amdgpu_device *adev)
 
 #ifdef CONFIG_X86_64
 	if (adev->flags & AMD_IS_APU) {
-		adev->mc.aper_base = RREG32(mmMC_VM_FB_OFFSET) << 22ULL;
+		adev->mc.aper_base = ((u64)RREG32(mmMC_VM_FB_OFFSET)) << 22;
 		adev->mc.aper_size = adev->mc.real_vram_size;
 	}
 #endif
Signature · 6 lines
2.5.0

_______________________________________________
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): 1485266973-1664-2-git-send-email-deathsimple-ANTagKRnAhcb1SvskN2V4Q@public.gmane.org

#4 lore raw

Re: [PATCH 2/2] drm/amdgpu: fix 64bit shift for CZ

Works on my CZ system:

________________________________
From: amd-gfx <amd-gfx-bounces-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org> on behalf of Christian König <[email protected]>
Sent: Tuesday, January 24, 2017 09:09
To: [email protected]
Subject: [PATCH 2/2] drm/amdgpu: fix 64bit shift for CZ

From: Christian König <[email protected]>

Fixes "access stolen VRAM directly on CZ", otherwise that won't work as expected with more than 4GB RAM.

---
 drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gmc_v8_0.c +1 -1
index a564e89..7669b32 100644
@@ -470,7 +470,7 @@ static int gmc_v8_0_mc_init(struct amdgpu_device *adev)
 
 #ifdef CONFIG_X86_64
         if (adev->flags & AMD_IS_APU) {
-               adev->mc.aper_base = RREG32(mmMC_VM_FB_OFFSET) << 22ULL;
+               adev->mc.aper_base = ((u64)RREG32(mmMC_VM_FB_OFFSET)) << 22;
                 adev->mc.aper_size = adev->mc.real_vram_size;
         }
 #endif

--
2.5.0

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx
amd-gfx Info Page - lists.freedesktop.org<https://lists.freedesktop.org/mailman/listinfo/amd-gfx>
lists.freedesktop.org
To see the collection of prior postings to the list, visit the amd-gfx Archives. Using amd-gfx: To post a message to all the list members, send email ...

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

Reviewed-by Alex Deucher
#5 lore raw
In reply to a message not in the archive
Quoted 7 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Christian König
Sent: Tuesday, January 24, 2017 9:10 AM
To: [email protected]
Subject: [PATCH 1/2] drm/amdgpu: fix 64bit shift for KV/KB

Quoted 6 lines

From: Christian König <[email protected]>

Fixes "access stolen VRAM directly on KV/KB" otherwise that won't work as expected with more than 4GB RAM.

Series is:

Quoted 24 lines
---
 drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +1 -1
index ccce04d..8d05e0c 100644
@@ -378,7 +378,7 @@ static int gmc_v7_0_mc_init(struct amdgpu_device
 *adev)
 
 #ifdef CONFIG_X86_64
 	if (adev->flags & AMD_IS_APU) {
-		adev->mc.aper_base = RREG32(mmMC_VM_FB_OFFSET) <<
 22ULL;
+		adev->mc.aper_base =
 ((u64)RREG32(mmMC_VM_FB_OFFSET)) << 22;
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +0 -1
 		adev->mc.aper_size = adev->mc.real_vram_size;
 	}
 #endif
--

2.5.0

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): BN6PR12MB16529661EF1DA7D24876B445F7750-/b2+HYfkarQqUD6E6FAiowdYzm3356FpvxpqHgZTriW3zl9H0oFU5g@public.gmane.org

Reviewed-by
#7 lore raw

Series reviewed by me as well:

Quoted 40 lines · Alexander
Quoted 7 lines

-----Original Message-----
From: amd-gfx [mailto:[email protected]] On Behalf Of Christian König
Sent: Tuesday, January 24, 2017 9:10 AM
To: [email protected]
Subject: [PATCH 1/2] drm/amdgpu: fix 64bit shift for KV/KB

Quoted 6 lines

From: Christian König <[email protected]>

Fixes "access stolen VRAM directly on KV/KB" otherwise that won't work as expected with more than 4GB RAM.

Series is:

Quoted 24 lines
---
 drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +1 -1
index ccce04d..8d05e0c 100644
@@ -378,7 +378,7 @@ static int gmc_v7_0_mc_init(struct amdgpu_device
 *adev)
 
 #ifdef CONFIG_X86_64
 	if (adev->flags & AMD_IS_APU) {
-		adev->mc.aper_base = RREG32(mmMC_VM_FB_OFFSET) <<
 22ULL;
+		adev->mc.aper_base =
 ((u64)RREG32(mmMC_VM_FB_OFFSET)) << 22;
drivers/gpu/drm/amd/amdgpu/gmc_v7_0.c +0 -1
 		adev->mc.aper_size = adev->mc.real_vram_size;
 	}
 #endif
--

2.5.0

Quoted 8 lines
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

_______________________________________________
amd-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/amd-gfx