Since the PAGE_SIZE is 8KB on sparc64, the size of
structure amdsriov_ras_telemetry will exceed 64KB,
so use absolute value to fix the buffer size.
Fixes the issue:
drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:522:2: error: static
assertion failed due to requirement 'sizeof(struct
amdsriov_ras_telemetry) <= 64 << 10': amdsriov_ras_telemetry must be 64 KB
| sizeof(struct amdsriov_ras_telemetry) <=
AMD_SRIOV_MSG_RAS_TELEMETRY_SIZE_KB_V1 << 10,
drivers/gpu/drm/amd/amdgpu/amdgv_sriovmsg.h:522:40: note:
expression evaluates to '115616 <= 65536'
| sizeof(struct amdsriov_ras_telemetry) <=
AMD_SRIOV_MSG_RAS_TELEMETRY_SIZE_KB_V1 << 10,
Fixes: cb48a6b2b61d ("drm/amd/ras: use dedicated memory as vf ras command buffer")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202602261700.rVOLIw4l-lkp@intel.com/
Signed-off-by: YiPeng Chai <YiPeng.Chai@amd.com>
Reviewed-by: Tao Zhou <tao.zhou1@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
struct amd_sriov_ras_chk_criti chk_criti;
};
-#define AMD_SRIOV_UNIRAS_CMD_MAX_SIZE (PAGE_SIZE * 13)
+#define AMD_SRIOV_UNIRAS_BLOCKS_BUF_SIZE 4096
+#define AMD_SRIOV_UNIRAS_CMD_MAX_SIZE (4096 * 13)
struct amd_sriov_uniras_shared_mem {
- uint8_t blocks_ecc_buf[PAGE_SIZE];
+ uint8_t blocks_ecc_buf[AMD_SRIOV_UNIRAS_BLOCKS_BUF_SIZE];
uint8_t cmd_buf[AMD_SRIOV_UNIRAS_CMD_MAX_SIZE];
};
ras_telemetry_offset);
if (cmd == RAS_CMD__GET_ALL_BLOCK_ECC_STATUS) {
- if (mem_size > PAGE_SIZE)
+ if (mem_size > AMD_SRIOV_UNIRAS_BLOCKS_BUF_SIZE)
return -ENOMEM;
shared_mem->cpu_addr = ras_telemetry_cpu->uniras_shared_mem.blocks_ecc_buf;
memset(blks_ecc, 0, sizeof(*blks_ecc));
if (amdgpu_virt_ras_get_cmd_shared_mem(ras_mgr->ras_core,
RAS_CMD__GET_ALL_BLOCK_ECC_STATUS,
- PAGE_SIZE, &blks_ecc->shared_mem))
+ AMD_SRIOV_UNIRAS_BLOCKS_BUF_SIZE, &blks_ecc->shared_mem))
return -ENOMEM;
return 0;