> -----Original Message-----
> From: 'Gerd Hoffmann' [mailto:kra...@redhat.com]
> Sent: Wednesday, September 8, 2021 9:37 PM
> To: Chang, Abner (HPS SW/FW Technologist) <abner.ch...@hpe.com>
> Cc: Leif Lindholm <l...@nuviainc.com>; Yao, Jiewen <jiewen....@intel.com>;
> devel@edk2.groups.io; gaoliming <gaolim...@byosoft.com.cn>; 'Ard
> Biesheuvel' <ard.biesheu...@arm.com>; Kinney, Michael D
> <michael.d.kin...@intel.com>; Ni, Ray <ray...@intel.com>; Schaefer, Daniel
> <daniel.schae...@hpe.com>; 'Sunil V L' <suni...@ventanamicro.com>; 'Ard
> Biesheuvel' <ardb+tianoc...@kernel.org>
> Subject: Re: [edk2-devel] [RFC] RISC-V QEMU virtual package
> 
>   Hi,
> 
> > > Are you expecting to need different functionality from the ArmVirtPkg
> > > one? If not, you could move that one to
> > >   OvmfPkg/Library/QemuFwCfgCommonLib
> > > or something.
> 
> > The interfaces provided by ARM QemuFwLib seems works fine with RISC-V
> > OVMF, however the build fail with the recent change of adding "#if
> > defined(MDE_CPU_AARCH64)".
> 
> How does that fail to build?
That is the cast from pointer to integer on (UINT32)&Access). The build error 
could be fixed by adding (UINTN) before casting to UINT32 though.
> 
> The #ifdef looks like a performance optimization, doing 64bit mmio
> access on 64bit platforms to reduce the number of traps.  Even without
> fixing that up for RISCV64 so it gets the same treatment everything
> should work fine, just a little slower than it could.
> 
> > I prefer to have RISC-V instance because I
> > am not sure if any fw_cfg interface changes would be made on RISC-V
> > QEMU.
> 
> The fw_cfg interface should not diverge.  ia32/x64 works a bit different
> because there is a separate io address space on that architecture and
> fw_cfg uses that for historical reasons.  All platforms using the mmio
> variant of the fw_cfg interface should work alike though.
Hmm, ok. 
We can have the common one for both ARM and RISC-V if there is no potential 
issues in the future as you mentioned. We can also add #defined 
(MDE_CPU_RISCV64) to avoid the build error as ARM and RISC-V share the same 
code.
One more question, there is already a QemuFwCfgLib library for ia32/x64. The 
naming of QemuFwCfgCommonLib under Library seems confusing. How about we  put 
this library under /FDT and also name it as QemuFwCfgLib? Because ARM/RISC-V 
fw_cfg also depends on FDT.

Abner


> 
> take care,
>   Gerd



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#80368): https://edk2.groups.io/g/devel/message/80368
Mute This Topic: https://groups.io/mt/85405739/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to