From 677eadb402c392379acfcb5061ad733539f12f67 Mon Sep 17 00:00:00 2001 From: Gu Zitao Date: Tue, 22 Feb 2022 22:25:17 +0800 Subject: [PATCH] sw64: radeon: correct low-level mmio memset direct calls Sunway inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SPZD CVE: NA ------------------------------- Driver codes of the direct calls, via the SIMD-optimized memset and memcpy functions, may raise dfault under sw64 architecture, so work around 'memset' references to '_memset_c_io' calls. Signed-off-by: Gu Zitao #openEuler_contributor Signed-off-by: Laibin Qiu Reviewed-by: Hanjun Guo Signed-off-by: Zheng Zengkai --- drivers/gpu/drm/radeon/radeon_vce.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/radeon/radeon_vce.c b/drivers/gpu/drm/radeon/radeon_vce.c index 9f59e2b8935b..68cc5a347d3b 100644 --- a/drivers/gpu/drm/radeon/radeon_vce.c +++ b/drivers/gpu/drm/radeon/radeon_vce.c @@ -239,7 +239,11 @@ int radeon_vce_resume(struct radeon_device *rdev) return r; } +#ifdef __sw_64__ + _memset_c_io(cpu_addr, 0, radeon_bo_size(rdev->vce.vcpu_bo)); +#else memset(cpu_addr, 0, radeon_bo_size(rdev->vce.vcpu_bo)); +#endif if (rdev->family < CHIP_BONAIRE) r = vce_v1_0_load_fw(rdev, cpu_addr); else { -- GitLab