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::d41; helo=mail-io1-xd41.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-io1-xd41.google.com (mail-io1-xd41.google.com [IPv6:2607:f8b0:4864:20::d41]) (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 17CAD211DCD88 for ; Fri, 15 Mar 2019 01:12:53 -0700 (PDT) Received: by mail-io1-xd41.google.com with SMTP id v4so6464119ioj.5 for ; Fri, 15 Mar 2019 01:12:52 -0700 (PDT) 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; bh=ZRax/UhOBXKS9sKV+3xcANhlBY9ctF4smArnfSLIzNY=; b=oIns6VSRDN5z0/v89dktTdioaIYrbLqNdezJBYeW3/Xm4+nPDqjsuOG72qmuYv1+uD U4auaEpSg47pSqoUmGOT/t3uNLChLm9ygkLi0OaP44aoQ9uMHa9Vz8gfCrCk5az3lcQo 60X80UYzludP8aO7+vz0K7L5RHYqluyBo+i3Z3UNX3X9IXH9bk6UsIunJI7/gtYc56YR vl1F35Mvcs5aePLKdjjgiFWuIMm5YS8EmW5CzY0q2G64qXyDP7kQsZ66yVkWniUSM8dS GoZZyYx3v+hyVmvoEAsLU2P3FOKWhGYI9uHGQE3jadwqa5M4lSTyuKytZUJFVrHKACIm LXpg== 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; bh=ZRax/UhOBXKS9sKV+3xcANhlBY9ctF4smArnfSLIzNY=; b=KP3XQxRFiDWOSBnq5giyGrGWfTA7jg+mujezNYYyZuM/XOhDSFcNvU08yEBAau2i+t Ktxki4e3njZdobzxA/t4gAo2lGiThCO5NWgW4e5F1z6p6DiiKpQa7ozR1fjwybWHJHK5 KVDMLJDHB7jlIZggVA97BX+yDhA5cd64Q6rIzwyDoHde4Yq9DOUQdQe7kal5popdVDX8 Vz+p25sUh18EJlo4BGAZez0eWl2wYE4LIjvwcgzqpB+7pAxWbbAsQSzkxggrrDWuP6Gl AJiWGmeKJPlKvqFI990dJfT5B1LeHlP+kSzVstutNR9P+pgZns7JVCck+wES3w/KAGzU nQWg== X-Gm-Message-State: APjAAAWKHH6hoA3QBvVKRDpC3ujqy83zcZmDZUyVwYna1pgXrGv/DLhM wevrP+wGTwcSRfRh4RXfGS8Ac51WUUyaPZXgpe4GHQ== X-Google-Smtp-Source: APXvYqybkmIkhexQal0mD7SJF+N3Jv+21KIe8Kgktc9gOrifb+yBzum0j5sIQW0OP6j0nbN/QjEbfe3kn94TO7+h3E0= X-Received: by 2002:a5e:8418:: with SMTP id h24mr1357806ioj.170.1552637572020; Fri, 15 Mar 2019 01:12:52 -0700 (PDT) MIME-Version: 1.0 References: <20190311153608.3251-1-ard.biesheuvel@linaro.org> In-Reply-To: From: Ard Biesheuvel Date: Fri, 15 Mar 2019 09:12:39 +0100 Message-ID: To: "Wu, Hao A" Cc: "edk2-devel@lists.01.org" , "Wang, Jian J" , "Zeng, Star" , "Kinney, Michael D" , "Gao, Liming" , Achin Gupta , "Yao, Jiewen" , Supreeth Venkatesh , Jagadeesh Ujja Subject: Re: [PATCH 0/4] MdeModulePkg, StandaloneMmPkg: work around VA vs PA ambiguity 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: Fri, 15 Mar 2019 08:12:53 -0000 Content-Type: text/plain; charset="UTF-8" On Fri, 15 Mar 2019 at 03:17, Wu, Hao A wrote: > > > -----Original Message----- > > From: Ard Biesheuvel [mailto:ard.biesheuvel@linaro.org] > > Sent: Monday, March 11, 2019 11:36 PM > > To: edk2-devel@lists.01.org > > Cc: Ard Biesheuvel; Wang, Jian J; Wu, Hao A; Zeng, Star; Kinney, Michael D; > > Gao, Liming; Achin Gupta; Yao, Jiewen; Supreeth Venkatesh; Jagadeesh Ujja > > Subject: [PATCH 0/4] MdeModulePkg, StandaloneMmPkg: work around VA > > vs PA ambiguity > > > > This series proposes one possible approach to work around the issue that the > > traditional MM and standalone MM implement versions of the communicate > > protocol > > that are fundamentally incompatible from the point of view of the caller. > > > > In traditional MM, the MM communicate protocol takes a physical pointer for > > the buffer, so that the SMM execution context can access the memory > > directly > > without having to translate it according to the translation regime of the > > caller. > > > > In standalone MM, the buffer that is shared with the MM context is > > preallocated, > > and so it is up to the implementation of the MM communicate protocol to > > copy the > > data from the caller allocated buffer into the preallocated shared buffer. In > > order to be able to do so, the DXE driver needs to copy the contents, and for > > this it needs to know the virtual address not the physical address. > > > > So this means we have two incompatible versions of the same protocol, and > > given > > that we have even re-used the EFI_SMM_COMMUNICATE_PROTOCOL GUID > > for the new > > EFI_MM_COMMUNICATE_PROTOCOL, we cannot distinguish > > programmatically between a > > MM context that takes physical addresses vs one that takes virtual ones. > > > > Since this is known at build time, one way to deal with this is to have two > > different implementations of a library that defines an abstract > > MmCommunicate() > > function, allowing the correct implementation to be selected at integration > > time. > > Hello Ard, > > It seems to me that for platforms that include the VariableSmmRuntimeDxe > driver, they need to add the 'MmCommunicateLib' dependency. > > Please grant us some time to evaluate this proposal and its impact. We > will inform you as soon as there is a result. Thanks. > Thank you Hao. Note that we intend to discuss the issue addressed by this series in the PIWG call, but the next one is at least two weeks away. So there is no urgency to reviewing this patch for inclusion, but any feedback you can give is appreciated.