mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/herbert/cryptodev-2.6.git
synced 2026-04-18 11:33:36 -04:00
drm/amdgpu: VF Query RAS Caps from Host if supported
If VF RAS Capability support is enabled, guest is able to retrieve the real RAS support from the host. Signed-off-by: Victor Skvortsov <victor.skvortsov@amd.com> Reviewed-by: Zhigang Luo <zhigang.luo@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
This commit is contained in:
committed by
Alex Deucher
parent
9928509dfc
commit
907fec2dfd
@@ -523,6 +523,7 @@ static int amdgpu_virt_read_pf2vf_data(struct amdgpu_device *adev)
|
||||
|
||||
adev->unique_id =
|
||||
((struct amd_sriov_msg_pf2vf_info *)pf2vf_info)->uuid;
|
||||
adev->virt.ras_en_caps.all = ((struct amd_sriov_msg_pf2vf_info *)pf2vf_info)->ras_en_caps.all;
|
||||
break;
|
||||
default:
|
||||
dev_err(adev->dev, "invalid pf2vf version: 0x%x\n", pf2vf_info->version);
|
||||
@@ -1144,3 +1145,55 @@ bool amdgpu_sriov_xnack_support(struct amdgpu_device *adev)
|
||||
|
||||
return xnack_mode;
|
||||
}
|
||||
|
||||
bool amdgpu_virt_get_ras_capability(struct amdgpu_device *adev)
|
||||
{
|
||||
struct amdgpu_ras *con = amdgpu_ras_get_context(adev);
|
||||
|
||||
if (!amdgpu_sriov_ras_caps_en(adev))
|
||||
return false;
|
||||
|
||||
if (adev->virt.ras_en_caps.bits.block_umc)
|
||||
adev->ras_hw_enabled |= BIT(AMDGPU_RAS_BLOCK__UMC);
|
||||
if (adev->virt.ras_en_caps.bits.block_sdma)
|
||||
adev->ras_hw_enabled |= BIT(AMDGPU_RAS_BLOCK__SDMA);
|
||||
if (adev->virt.ras_en_caps.bits.block_gfx)
|
||||
adev->ras_hw_enabled |= BIT(AMDGPU_RAS_BLOCK__GFX);
|
||||
if (adev->virt.ras_en_caps.bits.block_mmhub)
|
||||
adev->ras_hw_enabled |= BIT(AMDGPU_RAS_BLOCK__MMHUB);
|
||||
if (adev->virt.ras_en_caps.bits.block_athub)
|
||||
adev->ras_hw_enabled |= BIT(AMDGPU_RAS_BLOCK__ATHUB);
|
||||
if (adev->virt.ras_en_caps.bits.block_pcie_bif)
|
||||
adev->ras_hw_enabled |= BIT(AMDGPU_RAS_BLOCK__PCIE_BIF);
|
||||
if (adev->virt.ras_en_caps.bits.block_hdp)
|
||||
adev->ras_hw_enabled |= BIT(AMDGPU_RAS_BLOCK__HDP);
|
||||
if (adev->virt.ras_en_caps.bits.block_xgmi_wafl)
|
||||
adev->ras_hw_enabled |= BIT(AMDGPU_RAS_BLOCK__XGMI_WAFL);
|
||||
if (adev->virt.ras_en_caps.bits.block_df)
|
||||
adev->ras_hw_enabled |= BIT(AMDGPU_RAS_BLOCK__DF);
|
||||
if (adev->virt.ras_en_caps.bits.block_smn)
|
||||
adev->ras_hw_enabled |= BIT(AMDGPU_RAS_BLOCK__SMN);
|
||||
if (adev->virt.ras_en_caps.bits.block_sem)
|
||||
adev->ras_hw_enabled |= BIT(AMDGPU_RAS_BLOCK__SEM);
|
||||
if (adev->virt.ras_en_caps.bits.block_mp0)
|
||||
adev->ras_hw_enabled |= BIT(AMDGPU_RAS_BLOCK__MP0);
|
||||
if (adev->virt.ras_en_caps.bits.block_mp1)
|
||||
adev->ras_hw_enabled |= BIT(AMDGPU_RAS_BLOCK__MP1);
|
||||
if (adev->virt.ras_en_caps.bits.block_fuse)
|
||||
adev->ras_hw_enabled |= BIT(AMDGPU_RAS_BLOCK__FUSE);
|
||||
if (adev->virt.ras_en_caps.bits.block_mca)
|
||||
adev->ras_hw_enabled |= BIT(AMDGPU_RAS_BLOCK__MCA);
|
||||
if (adev->virt.ras_en_caps.bits.block_vcn)
|
||||
adev->ras_hw_enabled |= BIT(AMDGPU_RAS_BLOCK__VCN);
|
||||
if (adev->virt.ras_en_caps.bits.block_jpeg)
|
||||
adev->ras_hw_enabled |= BIT(AMDGPU_RAS_BLOCK__JPEG);
|
||||
if (adev->virt.ras_en_caps.bits.block_ih)
|
||||
adev->ras_hw_enabled |= BIT(AMDGPU_RAS_BLOCK__IH);
|
||||
if (adev->virt.ras_en_caps.bits.block_mpio)
|
||||
adev->ras_hw_enabled |= BIT(AMDGPU_RAS_BLOCK__MPIO);
|
||||
|
||||
if (adev->virt.ras_en_caps.bits.poison_propogation_mode)
|
||||
con->poison_supported = true; /* Poison is handled by host */
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user