Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions StandaloneMmPkg/Drivers/StandaloneMmIplPei/MmFoundationHob.c
Original file line number Diff line number Diff line change
Expand Up @@ -1024,11 +1024,14 @@ CreateMmFoundationHobList (
UsedSize += HobLength;

//
// MU_CHANGE: only check on this variable when S3 needs it.
// Build ACPI variable HOB
//
HobLength = GetRemainingHobSize (*FoundationHobSize, UsedSize);
MmIplCopyGuidHob (FoundationHobList + UsedSize, &HobLength, &gEfiAcpiVariableGuid, FALSE);
UsedSize += HobLength;
if (PcdGetBool (PcdAcpiS3Enable)) {
HobLength = GetRemainingHobSize (*FoundationHobSize, UsedSize);
MmIplCopyGuidHob (FoundationHobList + UsedSize, &HobLength, &gEfiAcpiVariableGuid, FALSE);
UsedSize += HobLength;
}

if (FeaturePcdGet (PcdCpuSmmProfileEnable)) {
//
Expand Down
10 changes: 8 additions & 2 deletions StandaloneMmPkg/Drivers/StandaloneMmIplPei/StandaloneMmIplPei.c
Original file line number Diff line number Diff line change
Expand Up @@ -914,7 +914,8 @@ MmIplDispatchMmDrivers (
//
Size = sizeof (CommunicateHeader);
Status = Communicate (NULL, &CommunicateHeader, &Size);
ASSERT_EFI_ERROR (Status);
// MU_CHANGE: Do not double assert on dispatch request as it will be handled by the caller.
// ASSERT_EFI_ERROR (Status);
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure what to do with this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is PRed as is. Will see if others have different opinions.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For clarity, can you provide a simple comparison of design for this point?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The issue behind this is that the supervised Standalone MM hosts this handler in supervisor channel. Thus to invoke this handler, we need to indicate the given MM communicate call is targeting supervisor handler pool (we have that wrapped in separate PPI and protocol).

The call here will issue an MMI with user mode data populated and will end up with EFI_NOT_FOUND error because there is not handler for driver dispatching in the user space.

The removal of the asserts here is basically telling this IPL to ignore the error, and it will be handled later through a supv specific module.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I haven't followed the full code path, but would one of these options work?

  • Make separate INF with the function that starts the call stack different for a "communicate" and "non-communicate" version of StandaloneMmIplPei.
  • Setup a unique/appropriate status code return type that can bubble back up in this case and only assert if an error code and not that return type.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh, i see :) then we will bury that in the ring3 broker layer. That is fine with me. Let me try that in a bit. Thanks~!

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I ended up doing the second option, given the ring 3 broker is not dispatched yet. And the change will likely look like this: kuqin12/mu_feature_mm_supv@348e63e

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think that's a little more preferable anyway to reduce platform integration overhead by avoiding two IPL INFs to pick from.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, this change is updated.


return Status;
}
Expand Down Expand Up @@ -1028,7 +1029,12 @@ StandaloneMmIplPeiEntry (
// Dispatch StandaloneMm drivers in MM
//
Status = MmIplDispatchMmDrivers ();
ASSERT_EFI_ERROR (Status);
// MU_CHANGE: Do not assert on dispatch request returned with not_ready as we may need to do it through other channels.
if (Status == EFI_NOT_READY) {
DEBUG ((DEBUG_WARN, "%a Failed with not ready, may need further intention\n", __func__));
} else {
ASSERT_EFI_ERROR (Status);
}

return EFI_SUCCESS;
}