From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by mx.groups.io with SMTP id smtpd.web12.4621.1623222617984096617 for ; Wed, 09 Jun 2021 00:10:18 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ptEhrUkL; spf=pass (domain: kernel.org, ip: 198.145.29.99, mailfrom: ardb@kernel.org) Received: by mail.kernel.org (Postfix) with ESMTPSA id 4A4526135D for ; Wed, 9 Jun 2021 07:10:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1623222617; bh=AkxSJY2XiErb4C5GRLEUsypDOfxvajf8L9ZFvC9gEg8=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ptEhrUkL8MgmVgrcMRDpx7cq2TstQQvJlnq2Fy20jjYG7IpCDOoVUapcwlgOABgEw pQbECCWtWDvMeWi3auPbmVbVfRDDeMOEYZmum0M1WKXGZd426+Psle9MuZiBEtl+Cq HI1m58V64MHT28XNygiV/KtfiCZn7L7clyzTEDY4XD+0iR9EaqVdqBiD1YUaPAcKY3 DC5Lvj0LMzh5W4JzPQ9UVHkarajNLGlA2oU35QUh6Q6F8mb65Bck1nDt4vV55m3xCR cKhXgJo6AlqbARmOq8HByVpYEpcQds2ejCKrv002BU84/AD/U3qLKGkUAtp46PvrlQ e55yadqWixi1g== Received: by mail-ot1-f41.google.com with SMTP id q5-20020a9d66450000b02903f18d65089fso6771895otm.11 for ; Wed, 09 Jun 2021 00:10:17 -0700 (PDT) X-Gm-Message-State: AOAM532LbmWEcDuanZLRN9mbnJWe/B41pR1cgcrKsdHudZIWePtpt1pp fVuLH28xlxJ4byVGl+zeihNxp7IReUS2fWhH9yI= X-Google-Smtp-Source: ABdhPJzXEIwEk/GTwlpMBXCKDa3iOp/cket/OLCwODPX43UyR+tFd1J+pUBBbxdc3sUtW4hJm+59N0fIwtA4Pa47phs= X-Received: by 2002:a9d:4c83:: with SMTP id m3mr14274187otf.77.1623222616684; Wed, 09 Jun 2021 00:10:16 -0700 (PDT) MIME-Version: 1.0 References: <20210608142112.87183-1-huangming@linux.alibaba.com> In-Reply-To: <20210608142112.87183-1-huangming@linux.alibaba.com> From: "Ard Biesheuvel" Date: Wed, 9 Jun 2021 09:10:05 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [Patch] StandaloneMmPkg: Fixed communicating from TF-A failed issue To: Ming Huang Cc: edk2-devel-groups-io , Ard Biesheuvel , Sami Mujawar , Jiewen Yao , Supreeth Venkatesh , guoheyi@linux.alibaba.com Content-Type: text/plain; charset="UTF-8" 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? Is it possible to set PcdMmBufferBase to the correct value? > 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 >