From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=217.140.101.70; helo=foss.arm.com; envelope-from=jagadeesh.ujja@arm.com; receiver=edk2-devel@lists.01.org Received: from foss.arm.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by ml01.01.org (Postfix) with ESMTP id A73C3211ADA21 for ; Wed, 2 Jan 2019 23:43:57 -0800 (PST) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 8A04115AB for ; Wed, 2 Jan 2019 23:43:57 -0800 (PST) Received: from mail-it1-f177.google.com (usa-sjc-mx-foss1.foss.arm.com [217.140.101.70]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6E9D03F909 for ; Wed, 2 Jan 2019 23:43:57 -0800 (PST) Received: by mail-it1-f177.google.com with SMTP id z7so44215162iti.0 for ; Wed, 02 Jan 2019 23:43:57 -0800 (PST) X-Gm-Message-State: AA+aEWYjhJrKQtyfemIyTg5wOltWL8JnoOtQPS3o84/5oYC3kxDvK3km RGGQCHSksXLTTKaWD0dgrg40a1jTSpOBIMAbmiM= X-Google-Smtp-Source: ALg8bN7IeeZWr5i6Nq0ZymwWqio31DxVQLe+mYadaZfWXGnMYVO0KHYfhabMHXcdDQacNkesFB8Io9d9MQr+Sv/OYUk= X-Received: by 2002:a24:f8c2:: with SMTP id a185mr24792538ith.145.1546501436535; Wed, 02 Jan 2019 23:43:56 -0800 (PST) MIME-Version: 1.0 References: <1544789607-11316-1-git-send-email-jagadeesh.ujja@arm.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14E38D3C3@SHSMSX104.ccr.corp.intel.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14E38DE09@SHSMSX104.ccr.corp.intel.com> <4A89E2EF3DFEDB4C8BFDE51014F606A14E38F557@SHSMSX104.ccr.corp.intel.com> In-Reply-To: From: Jagadeesh Ujja Date: Thu, 3 Jan 2019 13:13:45 +0530 X-Gmail-Original-Message-ID: Message-ID: To: Ard Biesheuvel Cc: "Gao, Liming" , "edk2-devel@lists.01.org" , "Zhang, Chao B" Subject: Re: [PATCH 00/13] Extend secure variable service to be usable from Standalone MM 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 07:43:58 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable hi Ard On Wed, Jan 2, 2019 at 10:45 PM Ard Biesheuvel wrote: > > On Thu, 20 Dec 2018 at 15:23, Gao, Liming wrote: > > > > Jagadeesh: > > MdeModulePkg Variable service/Fault tolerant/Nor Flash driver depends= on StandaloneMmServicesTableLib library class header file. This header fil= e is added into MdePkg. It has two interfaces. One is global gMmst, another= is function InMm(). So, there is no dependency issue here. > > And, MdePkg adds one StandaloneMmServicesTableLib library INF with empt= y implementation, this library is just for build. It sets gMmst=3DNULL, and= always return FASLE in InMm(). This library can be used in MdeModulePkg.ds= c to make Variable driver pass build. There is also no dependency issue her= e. Last, Platform DSC file will refer to the real StandaloneMmServicesTable= Lib library INF from StandaloneMmPkg. > > > > I think we should avoid the need for InMm() altogether for standalone > MM. It will always return TRUE for standalone MM modules, and it will > always return FALSE for other modules, so the distinction should be > made at build time. > > This means that we need to refactor the SMM 'server' modules and/or > libraries so that any code they cannot share (like boot services > invocations) are only included in the classic SMM versions. > > I have pushed my own prototype code here: > https://github.com/ardbiesheuvel/edk2/commits/standalone-mm > > There is some overlap with Jagadeesh's work. I will work with him > directly to resolve this before posting any new revisions. > InMm()=E2=80=9D and =E2=80=9CPcdStandaloneMmVariableEnabled=E2=80=9D are d= efined to reuse the existing code as much as possible. Initially I have done separate copy of the file to avoid =E2=80=9Cif..else= =E2=80=9D but had a comment about =E2=80=9Cduplicating code primarily due to the maintenance overhead=E2=80=9D So we are using =E2=80=9CInMm()=E2=80=9D and =E2=80=9CPcdStandaloneMmVariab= leEnabled=E2=80=9D PCD flag and trying to use the same code as much as possible. The patchset =E2=80=9CExtend secure variable service to be usable from Standalone MM=E2=80=9D as POC was submitted as RFC patches on =E2=80=9COcto= ber 31, 2018=E2=80=9D. Subsequent comments are fixed and we had 7 version of the patch set under review. Thanks Jagadeesh ____________________________________________ > edk2-devel mailing list > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel