mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
drm/amdgpu: Updated naming of SRIOV critical region offsets/sizes with _V1 suffix
- This change prepares the later patches to intro _v2 suffix to SRIOV critical regions Signed-off-by: Ellen Pan <yunru.pan@amd.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
@@ -686,7 +686,7 @@ void amdgpu_virt_init_data_exchange(struct amdgpu_device *adev)
|
|||||||
/* got through this logic in early init stage to get necessary flags, e.g. rlcg_acc related*/
|
/* got through this logic in early init stage to get necessary flags, e.g. rlcg_acc related*/
|
||||||
adev->virt.fw_reserve.p_pf2vf =
|
adev->virt.fw_reserve.p_pf2vf =
|
||||||
(struct amd_sriov_msg_pf2vf_info_header *)
|
(struct amd_sriov_msg_pf2vf_info_header *)
|
||||||
(adev->bios + (AMD_SRIOV_MSG_PF2VF_OFFSET_KB << 10));
|
(adev->bios + (AMD_SRIOV_MSG_PF2VF_OFFSET_KB_V1 << 10));
|
||||||
|
|
||||||
amdgpu_virt_read_pf2vf_data(adev);
|
amdgpu_virt_read_pf2vf_data(adev);
|
||||||
}
|
}
|
||||||
@@ -703,21 +703,21 @@ void amdgpu_virt_exchange_data(struct amdgpu_device *adev)
|
|||||||
if (adev->mman.fw_vram_usage_va) {
|
if (adev->mman.fw_vram_usage_va) {
|
||||||
adev->virt.fw_reserve.p_pf2vf =
|
adev->virt.fw_reserve.p_pf2vf =
|
||||||
(struct amd_sriov_msg_pf2vf_info_header *)
|
(struct amd_sriov_msg_pf2vf_info_header *)
|
||||||
(adev->mman.fw_vram_usage_va + (AMD_SRIOV_MSG_PF2VF_OFFSET_KB << 10));
|
(adev->mman.fw_vram_usage_va + (AMD_SRIOV_MSG_PF2VF_OFFSET_KB_V1 << 10));
|
||||||
adev->virt.fw_reserve.p_vf2pf =
|
adev->virt.fw_reserve.p_vf2pf =
|
||||||
(struct amd_sriov_msg_vf2pf_info_header *)
|
(struct amd_sriov_msg_vf2pf_info_header *)
|
||||||
(adev->mman.fw_vram_usage_va + (AMD_SRIOV_MSG_VF2PF_OFFSET_KB << 10));
|
(adev->mman.fw_vram_usage_va + (AMD_SRIOV_MSG_VF2PF_OFFSET_KB_V1 << 10));
|
||||||
adev->virt.fw_reserve.ras_telemetry =
|
adev->virt.fw_reserve.ras_telemetry =
|
||||||
(adev->mman.fw_vram_usage_va + (AMD_SRIOV_MSG_RAS_TELEMETRY_OFFSET_KB << 10));
|
(adev->mman.fw_vram_usage_va + (AMD_SRIOV_MSG_RAS_TELEMETRY_OFFSET_KB_V1 << 10));
|
||||||
} else if (adev->mman.drv_vram_usage_va) {
|
} else if (adev->mman.drv_vram_usage_va) {
|
||||||
adev->virt.fw_reserve.p_pf2vf =
|
adev->virt.fw_reserve.p_pf2vf =
|
||||||
(struct amd_sriov_msg_pf2vf_info_header *)
|
(struct amd_sriov_msg_pf2vf_info_header *)
|
||||||
(adev->mman.drv_vram_usage_va + (AMD_SRIOV_MSG_PF2VF_OFFSET_KB << 10));
|
(adev->mman.drv_vram_usage_va + (AMD_SRIOV_MSG_PF2VF_OFFSET_KB_V1 << 10));
|
||||||
adev->virt.fw_reserve.p_vf2pf =
|
adev->virt.fw_reserve.p_vf2pf =
|
||||||
(struct amd_sriov_msg_vf2pf_info_header *)
|
(struct amd_sriov_msg_vf2pf_info_header *)
|
||||||
(adev->mman.drv_vram_usage_va + (AMD_SRIOV_MSG_VF2PF_OFFSET_KB << 10));
|
(adev->mman.drv_vram_usage_va + (AMD_SRIOV_MSG_VF2PF_OFFSET_KB_V1 << 10));
|
||||||
adev->virt.fw_reserve.ras_telemetry =
|
adev->virt.fw_reserve.ras_telemetry =
|
||||||
(adev->mman.drv_vram_usage_va + (AMD_SRIOV_MSG_RAS_TELEMETRY_OFFSET_KB << 10));
|
(adev->mman.drv_vram_usage_va + (AMD_SRIOV_MSG_RAS_TELEMETRY_OFFSET_KB_V1 << 10));
|
||||||
}
|
}
|
||||||
|
|
||||||
amdgpu_virt_read_pf2vf_data(adev);
|
amdgpu_virt_read_pf2vf_data(adev);
|
||||||
@@ -1304,7 +1304,7 @@ static int amdgpu_virt_cache_host_error_counts(struct amdgpu_device *adev,
|
|||||||
checksum = host_telemetry->header.checksum;
|
checksum = host_telemetry->header.checksum;
|
||||||
used_size = host_telemetry->header.used_size;
|
used_size = host_telemetry->header.used_size;
|
||||||
|
|
||||||
if (used_size > (AMD_SRIOV_RAS_TELEMETRY_SIZE_KB << 10))
|
if (used_size > (AMD_SRIOV_MSG_RAS_TELEMETRY_SIZE_KB_V1 << 10))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
tmp = kmemdup(&host_telemetry->body.error_count, used_size, GFP_KERNEL);
|
tmp = kmemdup(&host_telemetry->body.error_count, used_size, GFP_KERNEL);
|
||||||
@@ -1383,7 +1383,7 @@ amdgpu_virt_write_cpers_to_ring(struct amdgpu_device *adev,
|
|||||||
checksum = host_telemetry->header.checksum;
|
checksum = host_telemetry->header.checksum;
|
||||||
used_size = host_telemetry->header.used_size;
|
used_size = host_telemetry->header.used_size;
|
||||||
|
|
||||||
if (used_size > (AMD_SRIOV_RAS_TELEMETRY_SIZE_KB << 10))
|
if (used_size > (AMD_SRIOV_MSG_RAS_TELEMETRY_SIZE_KB_V1 << 10))
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
|
|
||||||
cper_dump = kmemdup(&host_telemetry->body.cper_dump, used_size, GFP_KERNEL);
|
cper_dump = kmemdup(&host_telemetry->body.cper_dump, used_size, GFP_KERNEL);
|
||||||
@@ -1515,7 +1515,7 @@ static int amdgpu_virt_cache_chk_criti_hit(struct amdgpu_device *adev,
|
|||||||
checksum = host_telemetry->header.checksum;
|
checksum = host_telemetry->header.checksum;
|
||||||
used_size = host_telemetry->header.used_size;
|
used_size = host_telemetry->header.used_size;
|
||||||
|
|
||||||
if (used_size > (AMD_SRIOV_RAS_TELEMETRY_SIZE_KB << 10))
|
if (used_size > (AMD_SRIOV_MSG_RAS_TELEMETRY_SIZE_KB_V1 << 10))
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
tmp = kmemdup(&host_telemetry->body.chk_criti, used_size, GFP_KERNEL);
|
tmp = kmemdup(&host_telemetry->body.chk_criti, used_size, GFP_KERNEL);
|
||||||
|
|||||||
@@ -23,26 +23,48 @@
|
|||||||
#ifndef AMDGV_SRIOV_MSG__H_
|
#ifndef AMDGV_SRIOV_MSG__H_
|
||||||
#define AMDGV_SRIOV_MSG__H_
|
#define AMDGV_SRIOV_MSG__H_
|
||||||
|
|
||||||
/* unit in kilobytes */
|
#define AMD_SRIOV_MSG_SIZE_KB 1
|
||||||
#define AMD_SRIOV_MSG_VBIOS_OFFSET 0
|
|
||||||
#define AMD_SRIOV_MSG_VBIOS_SIZE_KB 64
|
|
||||||
#define AMD_SRIOV_MSG_DATAEXCHANGE_OFFSET_KB AMD_SRIOV_MSG_VBIOS_SIZE_KB
|
|
||||||
#define AMD_SRIOV_MSG_DATAEXCHANGE_SIZE_KB 4
|
|
||||||
#define AMD_SRIOV_MSG_TMR_OFFSET_KB 2048
|
|
||||||
#define AMD_SRIOV_MSG_BAD_PAGE_SIZE_KB 2
|
|
||||||
#define AMD_SRIOV_RAS_TELEMETRY_SIZE_KB 64
|
|
||||||
/*
|
/*
|
||||||
* layout
|
* layout v1
|
||||||
* 0 64KB 65KB 66KB 68KB 132KB
|
* 0 64KB 65KB 66KB 68KB 132KB
|
||||||
* | VBIOS | PF2VF | VF2PF | Bad Page | RAS Telemetry Region | ...
|
* | VBIOS | PF2VF | VF2PF | Bad Page | RAS Telemetry Region | ...
|
||||||
* | 64KB | 1KB | 1KB | 2KB | 64KB | ...
|
* | 64KB | 1KB | 1KB | 2KB | 64KB | ...
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define AMD_SRIOV_MSG_SIZE_KB 1
|
/*
|
||||||
#define AMD_SRIOV_MSG_PF2VF_OFFSET_KB AMD_SRIOV_MSG_DATAEXCHANGE_OFFSET_KB
|
* layout v2 (offsets are dynamically allocated and the offsets below are examples)
|
||||||
#define AMD_SRIOV_MSG_VF2PF_OFFSET_KB (AMD_SRIOV_MSG_PF2VF_OFFSET_KB + AMD_SRIOV_MSG_SIZE_KB)
|
* 0 1KB 64KB 65KB 66KB 68KB 132KB
|
||||||
#define AMD_SRIOV_MSG_BAD_PAGE_OFFSET_KB (AMD_SRIOV_MSG_VF2PF_OFFSET_KB + AMD_SRIOV_MSG_SIZE_KB)
|
* | INITD_H | VBIOS | PF2VF | VF2PF | Bad Page | RAS Telemetry Region | ...
|
||||||
#define AMD_SRIOV_MSG_RAS_TELEMETRY_OFFSET_KB (AMD_SRIOV_MSG_BAD_PAGE_OFFSET_KB + AMD_SRIOV_MSG_BAD_PAGE_SIZE_KB)
|
* | 1KB | 64KB | 1KB | 1KB | 2KB | 64KB | ...
|
||||||
|
*
|
||||||
|
* Note: PF2VF + VF2PF + Bad Page = DataExchange region (allocated contiguously)
|
||||||
|
*/
|
||||||
|
|
||||||
|
/* v1 layout sizes */
|
||||||
|
#define AMD_SRIOV_MSG_VBIOS_SIZE_KB_V1 64
|
||||||
|
#define AMD_SRIOV_MSG_PF2VF_SIZE_KB_V1 1
|
||||||
|
#define AMD_SRIOV_MSG_VF2PF_SIZE_KB_V1 1
|
||||||
|
#define AMD_SRIOV_MSG_BAD_PAGE_SIZE_KB_V1 2
|
||||||
|
#define AMD_SRIOV_MSG_RAS_TELEMETRY_SIZE_KB_V1 64
|
||||||
|
#define AMD_SRIOV_MSG_DATAEXCHANGE_SIZE_KB_V1 \
|
||||||
|
(AMD_SRIOV_MSG_PF2VF_SIZE_KB_V1 + AMD_SRIOV_MSG_VF2PF_SIZE_KB_V1 + \
|
||||||
|
AMD_SRIOV_MSG_BAD_PAGE_SIZE_KB_V1)
|
||||||
|
|
||||||
|
/* v1 offsets */
|
||||||
|
#define AMD_SRIOV_MSG_VBIOS_OFFSET_V1 0
|
||||||
|
#define AMD_SRIOV_MSG_DATAEXCHANGE_OFFSET_KB_V1 AMD_SRIOV_MSG_VBIOS_SIZE_KB_V1
|
||||||
|
#define AMD_SRIOV_MSG_TMR_OFFSET_KB 2048
|
||||||
|
#define AMD_SRIOV_MSG_PF2VF_OFFSET_KB_V1 AMD_SRIOV_MSG_DATAEXCHANGE_OFFSET_KB_V1
|
||||||
|
#define AMD_SRIOV_MSG_VF2PF_OFFSET_KB_V1 \
|
||||||
|
(AMD_SRIOV_MSG_PF2VF_OFFSET_KB_V1 + AMD_SRIOV_MSG_SIZE_KB)
|
||||||
|
#define AMD_SRIOV_MSG_BAD_PAGE_OFFSET_KB_V1 \
|
||||||
|
(AMD_SRIOV_MSG_VF2PF_OFFSET_KB_V1 + AMD_SRIOV_MSG_SIZE_KB)
|
||||||
|
#define AMD_SRIOV_MSG_RAS_TELEMETRY_OFFSET_KB_V1 \
|
||||||
|
(AMD_SRIOV_MSG_BAD_PAGE_OFFSET_KB_V1 + AMD_SRIOV_MSG_BAD_PAGE_SIZE_KB_V1)
|
||||||
|
#define AMD_SRIOV_MSG_INIT_DATA_TOT_SIZE_KB_V1 \
|
||||||
|
(AMD_SRIOV_MSG_VBIOS_SIZE_KB_V1 + AMD_SRIOV_MSG_DATAEXCHANGE_SIZE_KB_V1 + \
|
||||||
|
AMD_SRIOV_MSG_RAS_TELEMETRY_SIZE_KB_V1)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* PF2VF history log:
|
* PF2VF history log:
|
||||||
|
|||||||
Reference in New Issue
Block a user