Skip to contentSkip to conversation

drm/amdgpu: Do not init ta microcode from guest side

PATCH In review Hawking Zhang 2 participants 5 messages Aug 12, 2024

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

PATCH 1/1 drm/amdgpu: Do not init ta microcode from guest side

TA should not be loaded from guest side.

---
 drivers/gpu/drm/amd/amdgpu/psp_v13_0.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/psp_v13_0.c +5 -3
index 85ec9e35690a..749d8143b1e7 100644
@@ -132,9 +132,11 @@ static int psp_v13_0_init_microcode(struct psp_context *psp)
 		    (adev->emu_flags & AMDGPU_EMU_dGPU_SIDEWINDER))
 			break;
 		/* It's not necessary to load ras ta on Guest side */
-		err = psp_init_ta_microcode(psp, ucode_prefix);
-		if (err)
-			return err;
+		if (!amdgpu_sriov_vf(adev)) {
+			err = psp_init_ta_microcode(psp, ucode_prefix);
+			if (err)
+				return err;
+		}
 		break;
 	default:
 		BUG();
Signature · 1 line
2.17.1
#1 lore raw
Quoted 1 line · Hawking Zhang

TA should not be loaded from guest side.

Does this apply to XGMI TA?

Thanks,
Lijo

Quoted 26 lines
---
 drivers/gpu/drm/amd/amdgpu/psp_v13_0.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/psp_v13_0.c +5 -3
index 85ec9e35690a..749d8143b1e7 100644
@@ -132,9 +132,11 @@ static int psp_v13_0_init_microcode(struct psp_context *psp)
 		    (adev->emu_flags & AMDGPU_EMU_dGPU_SIDEWINDER))
 			break;
 		/* It's not necessary to load ras ta on Guest side */
-		err = psp_init_ta_microcode(psp, ucode_prefix);
-		if (err)
-			return err;
+		if (!amdgpu_sriov_vf(adev)) {
+			err = psp_init_ta_microcode(psp, ucode_prefix);
+			if (err)
+				return err;
+		}
 		break;
 	default:
 		BUG();
#2 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

Yes, this applies to all types of Tas

Regards,
Hawking

-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Monday, August 12, 2024 12:52
To: Zhang, Hawking <[email protected]>; [email protected]; Zhou1, Tao <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: Do not init ta microcode from guest side

Quoted 1 line · Hawking Zhang

TA should not be loaded from guest side.

Does this apply to XGMI TA?

Thanks,
Lijo

Quoted 26 lines
---
 drivers/gpu/drm/amd/amdgpu/psp_v13_0.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/psp_v13_0.c +5 -3
index 85ec9e35690a..749d8143b1e7 100644
@@ -132,9 +132,11 @@ static int psp_v13_0_init_microcode(struct psp_context *psp)
                  (adev->emu_flags & AMDGPU_EMU_dGPU_SIDEWINDER))
                      break;
              /* It's not necessary to load ras ta on Guest side */
-             err = psp_init_ta_microcode(psp, ucode_prefix);
-             if (err)
-                     return err;
+             if (!amdgpu_sriov_vf(adev)) {
+                     err = psp_init_ta_microcode(psp, ucode_prefix);
+                     if (err)
+                             return err;
+             }
              break;
      default:
              BUG();
#3 lore raw
Quoted 4 lines · Hawking

[AMD Official Use Only - AMD Internal Distribution Only]

Yes, this applies to all types of Tas

Presently, we have this -
https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c#L925

which makes use of XGMI TA commands in VF mode.

Thanks,
Lijo

Quoted 45 lines

Regards,
Hawking

-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Monday, August 12, 2024 12:52
To: Zhang, Hawking <[email protected]>; [email protected]; Zhou1, Tao <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: Do not init ta microcode from guest side

Quoted 1 line · Hawking Zhang

TA should not be loaded from guest side.

Does this apply to XGMI TA?

Thanks,
Lijo

Quoted 26 lines
---
 drivers/gpu/drm/amd/amdgpu/psp_v13_0.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/psp_v13_0.c +5 -3
index 85ec9e35690a..749d8143b1e7 100644
@@ -132,9 +132,11 @@ static int psp_v13_0_init_microcode(struct psp_context *psp)
                  (adev->emu_flags & AMDGPU_EMU_dGPU_SIDEWINDER))
                      break;
              /* It's not necessary to load ras ta on Guest side */
-             err = psp_init_ta_microcode(psp, ucode_prefix);
-             if (err)
-                     return err;
+             if (!amdgpu_sriov_vf(adev)) {
+                     err = psp_init_ta_microcode(psp, ucode_prefix);
+                     if (err)
+                             return err;
+             }
              break;
      default:
              BUG();
#4 lore raw

[AMD Official Use Only - AMD Internal Distribution Only]

Okay, part of xgmi ta call is blocked in guest, the other part is not. Then just keep the ta init micro as is. will leave psp call to deal with the delta between pf and vf.

Thanks for the catching.

Regards,
Hawking

-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Monday, August 12, 2024 13:16
To: Zhang, Hawking <[email protected]>; [email protected]; Zhou1, Tao <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: Do not init ta microcode from guest side

Quoted 4 lines · Hawking

[AMD Official Use Only - AMD Internal Distribution Only]

Yes, this applies to all types of Tas

Presently, we have this -
https://github.com/torvalds/linux/blob/master/drivers/gpu/drm/amd/amdgpu/amdgpu_xgmi.c#L925

which makes use of XGMI TA commands in VF mode.

Thanks,
Lijo

Quoted 45 lines

Regards,
Hawking

-----Original Message-----
From: Lazar, Lijo <[email protected]>
Sent: Monday, August 12, 2024 12:52
To: Zhang, Hawking <[email protected]>; [email protected]; Zhou1, Tao <[email protected]>
Subject: Re: [PATCH] drm/amdgpu: Do not init ta microcode from guest side

Quoted 1 line · Hawking Zhang

TA should not be loaded from guest side.

Does this apply to XGMI TA?

Thanks,
Lijo

Quoted 26 lines
---
 drivers/gpu/drm/amd/amdgpu/psp_v13_0.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
drivers/gpu/drm/amd/amdgpu/psp_v13_0.c +5 -3
index 85ec9e35690a..749d8143b1e7 100644
@@ -132,9 +132,11 @@ static int psp_v13_0_init_microcode(struct psp_context *psp)
                  (adev->emu_flags & AMDGPU_EMU_dGPU_SIDEWINDER))
                      break;
              /* It's not necessary to load ras ta on Guest side */
-             err = psp_init_ta_microcode(psp, ucode_prefix);
-             if (err)
-                     return err;
+             if (!amdgpu_sriov_vf(adev)) {
+                     err = psp_init_ta_microcode(psp, ucode_prefix);
+                     if (err)
+                             return err;
+             }
              break;
      default:
              BUG();