From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-45.freemail.mail.aliyun.com (out30-45.freemail.mail.aliyun.com [115.124.30.45]) by mx.groups.io with SMTP id smtpd.web09.4158.1623287675774165252 for ; Wed, 09 Jun 2021 18:14:36 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: linux.alibaba.com, ip: 115.124.30.45, mailfrom: huangming@linux.alibaba.com) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R881e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04426;MF=huangming@linux.alibaba.com;NM=1;PH=DS;RN=7;SR=0;TI=SMTPD_---0Ubuz35X_1623287663; Received: from MingdeMacBook-Pro.local(mailfrom:huangming@linux.alibaba.com fp:SMTPD_---0Ubuz35X_1623287663) by smtp.aliyun-inc.com(127.0.0.1); Thu, 10 Jun 2021 09:14:23 +0800 Subject: Re: [Patch] StandaloneMmPkg: Fixed communicating from TF-A failed issue To: Ard Biesheuvel Cc: edk2-devel-groups-io , Ard Biesheuvel , Sami Mujawar , Jiewen Yao , Supreeth Venkatesh , guoheyi@linux.alibaba.com References: <20210608142112.87183-1-huangming@linux.alibaba.com> From: "Ming Huang" Message-ID: <7536fafd-fa8e-9940-beec-a1cd357ecb03@linux.alibaba.com> Date: Thu, 10 Jun 2021 09:14:22 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit On 6/9/21 3:10 PM, Ard Biesheuvel wrote: > On Tue, 8 Jun 2021 at 16:21, Ming Huang wrote: >> >> TF-A: TrustedFirmware-a >> SPM: Secure Partition Manager(MM) >> >> For AArch64, when SPM enable in TF-A, TF-A may communicate to MM >> with buffer address (PLAT_SPM_BUF_BASE). The address is different >> from PcdMmBufferBase which use in edk2. > > Then why do we have PcdMmBufferBase? ArmPkg use this Pcd for the base address of non-secure communication buffer. > > Is it possible to set PcdMmBufferBase to the correct value? The secure communication may interrupt the non-secure communication. if we use the same address (PcdMmBufferBase and PLAT_SPM_BUF_BASE), the date in communication buffer may be corrupted. Best Regards, Ming > >> Checking address will let TF-A communicate failed to MM. So remove >> below checking code: >> if (NsCommBufferAddr < mNsCommBuffer.PhysicalStart) { >> return EFI_ACCESS_DENIED; >> } >> >> Signed-off-by: Ming Huang >> --- >> StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c | 4 ---- >> 1 file changed, 4 deletions(-) >> >> diff --git a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c >> index 63fbe26642..fe98d3181d 100644 >> --- a/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c >> +++ b/StandaloneMmPkg/Drivers/StandaloneMmCpu/AArch64/EventHandle.c >> @@ -103,10 +103,6 @@ PiMmStandaloneArmTfCpuDriverEntry ( >> return EFI_INVALID_PARAMETER; >> } >> >> - if (NsCommBufferAddr < mNsCommBuffer.PhysicalStart) { >> - return EFI_ACCESS_DENIED; >> - } >> - >> if ((NsCommBufferAddr + sizeof (EFI_MM_COMMUNICATE_HEADER)) >= >> (mNsCommBuffer.PhysicalStart + mNsCommBuffer.PhysicalSize)) { >> return EFI_INVALID_PARAMETER; >> -- >> 2.17.1 >>