From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2607:f8b0:4864:20::d29; helo=mail-io1-xd29.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io1-xd29.google.com (mail-io1-xd29.google.com [IPv6:2607:f8b0:4864:20::d29]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 2838D2194D3B3 for ; Wed, 2 Jan 2019 09:15:21 -0800 (PST) Received: by mail-io1-xd29.google.com with SMTP id s22so25025838ioc.8 for ; Wed, 02 Jan 2019 09:15:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=r2CaeZ3MpS26mU0FGswWuQumCmswq38tLn8yFYDZjLg=; b=grv87KfB/x/rdIwjHVOJz7JmmjXY57+nHWWVtNTDd3tmj1m9WLRxfZ8s4+g4X8JFjC ZniQJNiYnRjGSg1c8AWdTndnLjKQfHZYHVD6jZQVCHYMlxLTlgYTfiEYbuYqbYAugSYU Z+VUuqwafCCqSxgSSRJGy9km3EL7KnvDrdZ5Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=r2CaeZ3MpS26mU0FGswWuQumCmswq38tLn8yFYDZjLg=; b=I6H7iD/JpKOC6c/5Y0xZwmCDnVAbaG1cnW+esNZDf8CBT46tBZJQLI96KoxdGqBt5x 19TQPtuHVOZIYOOjR+H219rO9K/1IQcGg3kBK2jfeY3f0Y+U9C3aXCx0aAk/gIQfZqGm MkVKev0l6XHpi+1lsfLsPHPiXcuUujCXowRP2TVMAx4LWf221KVasFPQ0CXw6TDt3c5X 3qQd7AIp8CIMXcaVUNArLuhZfdS6Qf8bmXuMGD6nxbXZrUPCu46i8zOZlevgnCtlLgUC kNIzgMRSxaj/boYUi5DwvsJvYr7LZEaR5P4OhoJ5+7En3/9bmHOTBnvSRjd86cko37iW ikVA== X-Gm-Message-State: AJcUukeNrlDqIHzEScrkSQZZgbudgCmFGuiPIV9RFbYDzpA4Jna1tCHm +PI5uxP303y5Ay/gbo+HQQ60IivUrrmxQezhB5RPnA== X-Google-Smtp-Source: ALg8bN7LgO0gqM1x6XfvOegf3NcqYtI/gzKanWDvZZErrYUgjK5J5Efvi6ijc8n7HSxeWuOECsq/sKRKTDmadHSF05I= X-Received: by 2002:a6b:5d01:: with SMTP id r1mr29751661iob.170.1546449320825; Wed, 02 Jan 2019 09:15:20 -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: <4A89E2EF3DFEDB4C8BFDE51014F606A14E38F557@SHSMSX104.ccr.corp.intel.com> From: Ard Biesheuvel Date: Wed, 2 Jan 2019 18:15:09 +0100 Message-ID: To: "Gao, Liming" Cc: Jagadeesh Ujja , "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: Wed, 02 Jan 2019 17:15:22 -0000 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Thu, 20 Dec 2018 at 15:23, Gao, Liming wrote: > > Jagadeesh: > MdeModulePkg Variable service/Fault tolerant/Nor Flash driver depends o= n StandaloneMmServicesTableLib library class header file. This header file = is added into MdePkg. It has two interfaces. One is global gMmst, another i= s function InMm(). So, there is no dependency issue here. > And, MdePkg adds one StandaloneMmServicesTableLib library INF with empty = implementation, this library is just for build. It sets gMmst=3DNULL, and a= lways return FASLE in InMm(). This library can be used in MdeModulePkg.dsc = to make Variable driver pass build. There is also no dependency issue here.= Last, Platform DSC file will refer to the real StandaloneMmServicesTableLi= b 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.