From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web08.38079.1639557906416462757 for ; Wed, 15 Dec 2021 00:45:06 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=U8LRVlRb; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 861346184A for ; Wed, 15 Dec 2021 08:45:05 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EDA85C34609 for ; Wed, 15 Dec 2021 08:45:04 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1639557905; bh=yDOdmhdZJ1OjS0CdIptuMCWBMpDh+Z2Zl03pfUUzpnE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=U8LRVlRbatsmQxJXNMZVZTXJGn1G3T259grDCgHxtIksJTJKaMBEnMxXLjX6fmkWL hzCedwsuIq1yxS3bMBb9nP9tV4vAFOyLARZ9lFIT/TAZaqZitKoXSj3halQNuiGHdj blURhcDMaM14bipPcXhg9rUVg3vuRDxoJaEjz0WvyifrAgHjRJmuWDrVVVjssISQ+l DVX5424x/sy2JqE8NAfvSwkEUcyEVXoE2iFaT1mO5memgR9YGb1KJUrkC2LiYF70DD 7c150X0eTg3c7qsZfbFdUPFA8YbUPLuDaEU3J2jSxpLW9Rq3psUOmrdI82S5MjFmBX Afu4wYSCdQF+w== Received: by mail-wr1-f52.google.com with SMTP id k9so19040915wrd.2 for ; Wed, 15 Dec 2021 00:45:04 -0800 (PST) X-Gm-Message-State: AOAM533QgaGU/TitS3UuzBNZMLhbyAEv5zzl7KDqZBBf4iV2P0SDu1Dx xxDl7YIwuYkfFmaBC1Xy7soNcFszXA1/2+XOczk= X-Google-Smtp-Source: ABdhPJxBdHxjCnWLx/CA9qasYnfPbFUmL6Pu0tsJSGbTpStlVXAUoQrTyM0nmqoINAyKEUZM0eHtxAJ1Lm/q/XvPbtc= X-Received: by 2002:a5d:4443:: with SMTP id x3mr3318238wrr.189.1639557903144; Wed, 15 Dec 2021 00:45:03 -0800 (PST) MIME-Version: 1.0 References: <20211015090623.52511-1-huangming@linux.alibaba.com> <20211015090623.52511-2-huangming@linux.alibaba.com> In-Reply-To: <20211015090623.52511-2-huangming@linux.alibaba.com> From: "Ard Biesheuvel" Date: Wed, 15 Dec 2021 09:44:51 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH edk2 v1 1/3] StandaloneMmPkg: Fix issue about SpPcpuSharedBufSize field To: Ming Huang , Masahisa Kojima , Masami Hiramatsu Cc: edk2-devel-groups-io , Sami Mujawar , Ard Biesheuvel , Jiewen Yao , Supreeth Venkatesh , ming.huang-@outlook.com Content-Type: text/plain; charset="UTF-8" (+ Masahisa, Masami) On Fri, 15 Oct 2021 at 11:07, Ming Huang wrote: > > TF-A: TrustedFirmware-A > SPM: Secure Partition Manager(MM) > > In TF-A, the name of this field is sp_shared_buf_size. This field is > the size of range for transmit data from TF-A to standaloneMM when > SPM enable. > > SpPcpuSharedBufSize is pass from TF-A while StandaloneMM initialize. > So, SpPcpuSharedBufSize should be rename to SpSharedBufSize and this field > should no multiply by PayloadBootInfo->NumCpus; > > Signed-off-by: Ming Huang Could someone please check how this change of interpretation affects standalone MM running on SynQuacer? > --- > StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h | 2 +- > StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c | 2 +- > StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c | 2 +- > 3 files changed, 3 insertions(+), 3 deletions(-) > > diff --git a/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h b/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h > index c44f7066c6..f1683ecb61 100644 > --- a/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h > +++ b/StandaloneMmPkg/Include/Library/Arm/StandaloneMmCoreEntryPoint.h > @@ -41,7 +41,7 @@ typedef struct { > UINT64 SpPcpuStackSize; > UINT64 SpHeapSize; > UINT64 SpNsCommBufSize; > - UINT64 SpPcpuSharedBufSize; > + UINT64 SpSharedBufSize; > UINT32 NumSpMemRegions; > UINT32 NumCpus; > EFI_SECURE_PARTITION_CPU_INFO *CpuInfo; > diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c > index 85f8194687..93773c9fe8 100644 > --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c > +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/CreateHobList.c > @@ -173,7 +173,7 @@ CreateHobListFromBootInfo ( > // Base and size of buffer shared with privileged Secure world software > MmramRanges[1].PhysicalStart = PayloadBootInfo->SpSharedBufBase; > MmramRanges[1].CpuStart = PayloadBootInfo->SpSharedBufBase; > - MmramRanges[1].PhysicalSize = PayloadBootInfo->SpPcpuSharedBufSize * PayloadBootInfo->NumCpus; > + MmramRanges[1].PhysicalSize = PayloadBootInfo->SpSharedBufSize; > MmramRanges[1].RegionState = EFI_CACHEABLE | EFI_ALLOCATED; > > // Base and size of buffer used for synchronous communication with Normal > diff --git a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c > index 49cf51a789..5db7019dda 100644 > --- a/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c > +++ b/StandaloneMmPkg/Library/StandaloneMmCoreEntryPoint/Arm/StandaloneMmCoreEntryPoint.c > @@ -87,7 +87,7 @@ GetAndPrintBootinformation ( > DEBUG ((DEBUG_INFO, "SpPcpuStackSize - 0x%x\n", PayloadBootInfo->SpPcpuStackSize)); > DEBUG ((DEBUG_INFO, "SpHeapSize - 0x%x\n", PayloadBootInfo->SpHeapSize)); > DEBUG ((DEBUG_INFO, "SpNsCommBufSize - 0x%x\n", PayloadBootInfo->SpNsCommBufSize)); > - DEBUG ((DEBUG_INFO, "SpPcpuSharedBufSize - 0x%x\n", PayloadBootInfo->SpPcpuSharedBufSize)); > + DEBUG ((DEBUG_INFO, "SpSharedBufSize - 0x%x\n", PayloadBootInfo->SpSharedBufSize)); > > DEBUG ((DEBUG_INFO, "NumCpus - 0x%x\n", PayloadBootInfo->NumCpus)); > DEBUG ((DEBUG_INFO, "CpuInfo - 0x%p\n", PayloadBootInfo->CpuInfo)); > -- > 2.17.1 >