From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=209.132.183.28; helo=mx1.redhat.com; envelope-from=lersek@redhat.com; receiver=edk2-devel@lists.01.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 9C246211A2077 for ; Thu, 3 Jan 2019 08:14:37 -0800 (PST) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id ED2098050B; Thu, 3 Jan 2019 16:14:35 +0000 (UTC) Received: from lacos-laptop-7.usersys.redhat.com (ovpn-124-87.rdu2.redhat.com [10.10.124.87]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3C6E85D9C5; Thu, 3 Jan 2019 16:14:33 +0000 (UTC) To: Ard Biesheuvel , Jagadeesh Ujja , "Gao, Liming" , "Kinney, Michael D" Cc: "edk2-devel@lists.01.org" , "Zhang, Chao B" , Leif Lindholm , Achin Gupta , Supreeth Venkatesh , Jian J Wang References: <1546434828-24405-1-git-send-email-jagadeesh.ujja@arm.com> <1546434828-24405-5-git-send-email-jagadeesh.ujja@arm.com> From: Laszlo Ersek Message-ID: <8a6e1c80-5b6e-e337-06af-5992bc38a844@redhat.com> Date: Thu, 3 Jan 2019 17:14:31 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Thu, 03 Jan 2019 16:14:36 +0000 (UTC) Subject: Re: [PATCH v2 04/11] MdePkg/Include: Add StandaloneMmServicesTableLib library X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 03 Jan 2019 16:14:37 -0000 Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit On 01/03/19 12:03, Ard Biesheuvel wrote: > On Wed, 2 Jan 2019 at 14:14, Jagadeesh Ujja wrote: >> >> Some of the existing DXE drivers can be refactored to execute within >> the Standalone MM execution environment as well. Allow such drivers to >> get access to the Standalone MM services tables. >> >> Add a mechanism to determine the execution mode is required. >> i.e, in MM or non-MM >> >> Contributed-under: TianoCore Contribution Agreement 1.1 >> Signed-off-by: Jagadeesh Ujja >> --- >> MdePkg/Include/Library/StandaloneMmServicesTableLib.h | 43 ++++++++++++++++++++ >> MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.c | 39 ++++++++++++++++++ >> MdePkg/Library/StandaloneMmServicesTableLib/StandaloneMmServicesTableLib.inf | 36 ++++++++++++++++ >> MdePkg/MdePkg.dec | 4 ++ >> 4 files changed, 122 insertions(+) >> > > OK, so since the PI spec only refers to MM mode now, this library > class should be > > MmServicesTableLib|Include/Library/MmServicesTableLib.h > > with an implementation in MdeModulePkg that exposes the deprecated SMM > system table as the MM system table. > > In StandaloneMmPkg, we can add an implementation that exposes the > standalone MM system table. > > (They are binary compatible, so it is just a matter of casting one > pointer to the other) > > With this in place, we can go ahead and update FaultTolerantWrite and > Variable SMM driver to switch from SmmServicesTableLib to > MmServicesTableLib. This will require existing x86 platforms to define > a new library class resolution for MmServicesTableLib, referring to > the implementation in MdeModulePkg. This is unfortunate, but it is an > unavoidable consequence of the PI spec changes. It shouldn't be too intrusive or hard to review, I expect. > > Remaining question is what to do with InSmm() ... I'm lacking the context on this; on the other hand, I can refer back to at least one earlier discussion -- there had been multiple -- of the discrepancy between the PI spec and the edk2 code. See: - bullet (9) in , - and . Not sure how that can be applied to Arm. Thanks Laszlo