Hi, Memory profile feature is not provided to read SMRAM area. It is provided to collect the memory usage of different memory types for drivers.
Thanks, Star -----Original Message----- From: edk2-devel [mailto:[email protected]] On Behalf Of Juergen Rall Sent: Tuesday, May 31, 2016 9:51 PM To: [email protected] Subject: [edk2] UEFI Reading SMRAM Area Hi, I want to readout the SMRAM of an existing UEFI-Bios. Therefore I wrote a UEFI application inherited by the EDK2 sample MemoryProfileInfo: EFI_STATUS GetSmramProfileData(VOID) { EFI_STATUS Status; UINTN CommSize; UINT8* pCommBuffer; EFI_SMM_COMMUNICATE_HEADER* pCommHeader; SMRAM_PROFILE_PARAMETER_GET_PROFILE_INFO* pCommGetProfileInfo; SMRAM_PROFILE_PARAMETER_GET_PROFILE_DATA* pCommGetProfileData; EFI_SMM_COMMUNICATION_PROTOCOL* pSmmCommunicationProt; UINT64 ProfileSize; PHYSICAL_ADDRESS ProfileBuffer; //Get SMM communication protocol Status = gBS->LocateProtocol( &gEfiSmmCommunicationProtocolGuid, NULL, (VOID**)&pSmmCommunicationProt); Print(L"LocateProtocol Status: %lx\n", Status); if (EFI_SUCCESS == Status) { //Get buffer CommSize = sizeof (EFI_GUID) + sizeof (UINTN) + sizeof (SMRAM_PROFILE_PARAMETER_GET_PROFILE_DATA); pCommBuffer = AllocateZeroPool(500); if (pCommBuffer) { Print(L"AllocateZeroPool CommSize: %lx\n", CommSize); // Get Size pCommHeader = (EFI_SMM_COMMUNICATE_HEADER*)&pCommBuffer[0]; CopyMem (&pCommHeader->HeaderGuid, &gEdkiiMemoryProfileGuid, sizeof (gEdkiiMemoryProfileGuid)); pCommHeader->MessageLength = sizeof(SMRAM_PROFILE_PARAMETER_GET_PROFILE_INFO); pCommGetProfileInfo = (SMRAM_PROFILE_PARAMETER_GET_PROFILE_INFO *) &pCommBuffer[OFFSET_OF (EFI_SMM_COMMUNICATE_HEADER, Data)]; pCommGetProfileInfo->Header.Command = SMRAM_PROFILE_COMMAND_GET_PROFILE_INFO; pCommGetProfileInfo->Header.DataLength = sizeof (*pCommGetProfileInfo); pCommGetProfileInfo->Header.ReturnStatus = (UINT64)-1; pCommGetProfileInfo->ProfileSize = 0; CommSize = sizeof (EFI_GUID) + sizeof (UINTN) + pCommHeader->MessageLength; Status = pSmmCommunicationProt->Communicate( pSmmCommunicationProt, pCommBuffer, &CommSize); Print(L"pSmmCommunicationProt->Communicate Status:%lx\n", Status); When I call pSmmCommunicationProt->communicate, I get the error 0x000000e, which I suppose is due to the fact, that I use gEdkiiMemoryProfileGuid, which isn't existent in the current UEFI Bios (2.40). Now what should I do instead ? _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel _______________________________________________ edk2-devel mailing list [email protected] https://lists.01.org/mailman/listinfo/edk2-devel

