From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id E47E3AC0D99 for ; Thu, 25 Apr 2024 08:06:24 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=nSixfdvyhh7P/AFSTWTqjOI+Ne19uu1sV7tu8zdtx4M=; c=relaxed/simple; d=groups.io; h=Message-ID:Date:MIME-Version:User-Agent:Subject:To:Cc:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20240206; t=1714032383; v=1; b=eBvc8ixXSCPs0G9rIp1HcxdW00owDdAJWqDJJ1q7uEUSO6KWaT5Mp6zi+aSP+Vlsl4PZ5MxL O9AWiNxY9F6RYyTpkhSaqRFus/KXX/j8sGvc8GSgcrCwbGnPrvdRONdgzyD+XnGQ3va8I2VX3ic ZBdvEMF4UH+PX9AneL0km8EayPNL0juC7mZlMcH6heNdLaB075bYr/5lUa1YANVJGmbVAV/Z/9a BgHNaS6iXr6CNaqVB5sapJvfEWV0mkHF+sXZ7wWYzYBGfWfvDoYj3YNdIYlCwh3lkgM6JN2/sv9 GxRvCua1meSuC4c7JOkVZjoof/DNvazuKlaVHVRp4Hjkg== X-Received: by 127.0.0.2 with SMTP id zdXLYY7687511xukcXWIK0lq; Thu, 25 Apr 2024 01:06:23 -0700 X-Received: from mail.loongson.cn (mail.loongson.cn [114.242.206.163]) by mx.groups.io with SMTP id smtpd.web10.11816.1714032380873528328 for ; Thu, 25 Apr 2024 01:06:22 -0700 X-Received: from loongson.cn (unknown [10.40.24.149]) by gateway (Coremail) with SMTP id _____8BxmPD4DipmBbUCAA--.13140S3; Thu, 25 Apr 2024 16:06:16 +0800 (CST) X-Received: from [10.40.24.149] (unknown [10.40.24.149]) by localhost.localdomain (Coremail) with SMTP id AQAAf8AxgFX1DipmmuIEAA--.832S3; Thu, 25 Apr 2024 16:06:13 +0800 (CST) Message-ID: Date: Thu, 25 Apr 2024 16:06:13 +0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [PATCH v2 3/7] OvmfPkg: Add the QemuFwCfgMmioLib PEI stage version To: devel@edk2.groups.io, kraxel@redhat.com Cc: Ard Biesheuvel , Jiewen Yao , Xianglai Li References: <20240425041728.1385891-1-lichao@loongson.cn> <20240425041821.1386403-1-lichao@loongson.cn> <3panc52jjcnvf7cml7wllbqirsr2bjnvn34ulonxp5jkz7hj5h@2y6deto2c5fp> From: "Chao Li" In-Reply-To: <3panc52jjcnvf7cml7wllbqirsr2bjnvn34ulonxp5jkz7hj5h@2y6deto2c5fp> X-CM-TRANSID: AQAAf8AxgFX1DipmmuIEAA--.832S3 X-CM-SenderInfo: xolfxt3r6o00pqjv00gofq/1tbiAQASCGYpxJMEXwABsZ X-Coremail-Antispam: 1Uk129KBjDUn29KB7ZKAUJUUUUU529EdanIXcx71UUUUU7KY7 ZEXasCq-sGcSsGvfJ3UbIjqfuFe4nvWSU5nxnvy29KBjDU0xBIdaVrnUUvcSsGvfC2Kfnx nUUI43ZEXa7xR_UUUUUUUUU== Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Thu, 25 Apr 2024 01:06:22 -0700 Resent-From: lichao@loongson.cn Reply-To: devel@edk2.groups.io,lichao@loongson.cn List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: jWbMKxmzlUh3gNCh9o3cGzOlx7686176AA= Content-Type: multipart/alternative; boundary="------------oPC3ZUuFqMwkieLWGkwZrIgQ" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=eBvc8ixX; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io --------------oPC3ZUuFqMwkieLWGkwZrIgQ Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable Hi Gerd, Thanks, Chao On 2024/4/25 15:53, Gerd Hoffmann wrote: > Hi, > >> +UINTN mFwCfgSelectorAddress; >> +UINTN mFwCfgDataAddress; >> +UINTN mFwCfgDmaAddress; > Hmm, global variables for PEI? I think the point of storing these in > the HOB is to avoid the need for global variables? Also does that work > when running PEI in-place from flash? I think it would be useful if some platforms(not LoongArch) could use=20 the global variables in PEI, because the global variables are faster. > >> +RETURN_STATUS >> +EFIAPI >> +QemuFwCfgInitialize ( >> + VOID >> + ) >> +{ >> + VOID *DeviceTreeBase; >> + INT32 Node; >> + INT32 Prev; >> + CONST CHAR8 *Type; >> + INT32 Len; >> + CONST UINT64 *Reg; >> + UINT64 FwCfgSelectorAddress; >> + UINT64 FwCfgSelectorSize; >> + UINT64 FwCfgDataAddress; >> + UINT64 FwCfgDataSize; >> + UINT64 FwCfgDmaAddress; >> + UINT64 FwCfgDmaSize; > First thing this function should do is check whenever the HOB already > exists. Should that be the case there is no need to parse the device > tree. This is a constructor in PEI, that has to parse the device tree and then=20 build the HOBs. > > take care, > Gerd > > > >=20 > -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118278): https://edk2.groups.io/g/devel/message/118278 Mute This Topic: https://groups.io/mt/105724970/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --------------oPC3ZUuFqMwkieLWGkwZrIgQ Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable

Hi Gerd,


=
Thanks,
Chao
On 2024/4/25 15:53, Gerd Hoffmann wrote:
  Hi,

+UINTN  mFwCfgSelectorAddres=
s;
+UINTN  mFwCfgDataAddress;
+UINTN  mFwCfgDmaAddress;
Hmm, global variables for PEI?  I think the point of storing these in
the HOB is to avoid the need for global variables?  Also does that work
when running PEI in-place from flash?
I think it would be useful if some platforms(not LoongArch) could use the global variables in PEI, because the global variables are faster.

+RETURN_STATUS
+EFIAPI
+QemuFwCfgInitialize (
+  VOID
+  )
+{
+  VOID          *DeviceTreeBase;
+  INT32         Node;
+  INT32         Prev;
+  CONST CHAR8   *Type;
+  INT32         Len;
+  CONST UINT64  *Reg;
+  UINT64        FwCfgSelectorAddress;
+  UINT64        FwCfgSelectorSize;
+  UINT64        FwCfgDataAddress;
+  UINT64        FwCfgDataSize;
+  UINT64        FwCfgDmaAddress;
+  UINT64        FwCfgDmaSize;
First thing this function should do is check whenever the HOB already
exists.  Should that be the case there is no need to parse the device
tree.
This is a constructor in PEI, that has to parse the device tree and then build the HOBs.

take care,
  Gerd





_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#118278) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--------------oPC3ZUuFqMwkieLWGkwZrIgQ--