@@ -154,7 +154,8 @@ Tpm2GetInterfaceVersion (
154154 Status = ArmFfaLibMsgSendDirectReq2 (FfaTpm2PartitionId , & gTpm2ServiceFfaGuid , & FfaDirectReq2Args );
155155 while (Status == EFI_INTERRUPT_PENDING ) {
156156 // We are assuming vCPU0 of the TPM SP since it is UP.
157- Status = ArmFfaLibRun (FfaTpm2PartitionId , 0x00 , & FfaDirectReq2Args );
157+ // MU_CHANGE: Use the source partition ID of the FFA header for the ffa_run call.
158+ Status = ArmFfaLibRun (GET_SOURCE_PARTITION_ID (FfaDirectReq2Args .Header .x1 ), 0x00 , & FfaDirectReq2Args );
158159 }
159160
160161 if (EFI_ERROR (Status )) {
@@ -203,7 +204,8 @@ Tpm2GetFeatureInfo (
203204 Status = ArmFfaLibMsgSendDirectReq2 (FfaTpm2PartitionId , & gTpm2ServiceFfaGuid , & FfaDirectReq2Args );
204205 while (Status == EFI_INTERRUPT_PENDING ) {
205206 // We are assuming vCPU0 of the TPM SP since it is UP.
206- Status = ArmFfaLibRun (FfaTpm2PartitionId , 0x00 , & FfaDirectReq2Args );
207+ // MU_CHANGE: Use the source partition ID of the FFA header for the ffa_run call.
208+ Status = ArmFfaLibRun (GET_SOURCE_PARTITION_ID (FfaDirectReq2Args .Header .x1 ), 0x00 , & FfaDirectReq2Args );
207209 }
208210
209211 if (EFI_ERROR (Status )) {
@@ -243,7 +245,8 @@ Tpm2ServiceStart (
243245 Status = ArmFfaLibMsgSendDirectReq2 (FfaTpm2PartitionId , & gTpm2ServiceFfaGuid , & FfaDirectReq2Args );
244246 while (Status == EFI_INTERRUPT_PENDING ) {
245247 // We are assuming vCPU0 of the TPM SP since it is UP.
246- Status = ArmFfaLibRun (FfaTpm2PartitionId , 0x00 , & FfaDirectReq2Args );
248+ // MU_CHANGE: Use the source partition ID of the FFA header for the ffa_run call.
249+ Status = ArmFfaLibRun (GET_SOURCE_PARTITION_ID (FfaDirectReq2Args .Header .x1 ), 0x00 , & FfaDirectReq2Args );
247250 }
248251
249252 if (EFI_ERROR (Status )) {
@@ -284,7 +287,8 @@ Tpm2RegisterNotification (
284287 Status = ArmFfaLibMsgSendDirectReq2 (FfaTpm2PartitionId , & gTpm2ServiceFfaGuid , & FfaDirectReq2Args );
285288 while (Status == EFI_INTERRUPT_PENDING ) {
286289 // We are assuming vCPU0 of the TPM SP since it is UP.
287- Status = ArmFfaLibRun (FfaTpm2PartitionId , 0x00 , & FfaDirectReq2Args );
290+ // MU_CHANGE: Use the source partition ID of the FFA header for the ffa_run call.
291+ Status = ArmFfaLibRun (GET_SOURCE_PARTITION_ID (FfaDirectReq2Args .Header .x1 ), 0x00 , & FfaDirectReq2Args );
288292 }
289293
290294 if (EFI_ERROR (Status )) {
@@ -317,7 +321,8 @@ Tpm2UnregisterNotification (
317321 Status = ArmFfaLibMsgSendDirectReq2 (FfaTpm2PartitionId , & gTpm2ServiceFfaGuid , & FfaDirectReq2Args );
318322 while (Status == EFI_INTERRUPT_PENDING ) {
319323 // We are assuming vCPU0 of the TPM SP since it is UP.
320- Status = ArmFfaLibRun (FfaTpm2PartitionId , 0x00 , & FfaDirectReq2Args );
324+ // MU_CHANGE: Use the source partition ID of the FFA header for the ffa_run call.
325+ Status = ArmFfaLibRun (GET_SOURCE_PARTITION_ID (FfaDirectReq2Args .Header .x1 ), 0x00 , & FfaDirectReq2Args );
321326 }
322327
323328 if (EFI_ERROR (Status )) {
@@ -350,7 +355,8 @@ Tpm2FinishNotified (
350355 Status = ArmFfaLibMsgSendDirectReq2 (FfaTpm2PartitionId , & gTpm2ServiceFfaGuid , & FfaDirectReq2Args );
351356 while (Status == EFI_INTERRUPT_PENDING ) {
352357 // We are assuming vCPU0 of the TPM SP since it is UP.
353- Status = ArmFfaLibRun (FfaTpm2PartitionId , 0x00 , & FfaDirectReq2Args );
358+ // MU_CHANGE: Use the source partition ID of the FFA header for the ffa_run call.
359+ Status = ArmFfaLibRun (GET_SOURCE_PARTITION_ID (FfaDirectReq2Args .Header .x1 ), 0x00 , & FfaDirectReq2Args );
354360 }
355361
356362 if (EFI_ERROR (Status )) {
0 commit comments