Hi,

> > > +  ## This dynamic PCD indicates whether CPU MMU is enabled.
> > > +  #  TRUE  - CPU MMU is enabled.
> > > +  #  FASLE - CPU MMU have not enabled.
> > > +  gUefiCpuPkgTokenSpaceGuid.PcdCpuMmuIsEnabled|FALSE|BOOLEAN|0x60000023
> > Why create a PCD for this?  Can't you simply read the control register
> > to figure whenever paging is enabled or not?

> This is a good question. When I designed the API of
> SetMemoryRegionAttributes, it only contained 4 parameters, namely Start,
> Size, Attribut and Mask(refer to ARM version), and the MmuInitLib needs call
> this API to configure or initialize the MMU. SetMemoryRegionAttributes will
> call a private function called UpdateRegionMapping, it needs to know if the
> MMU is started to do different logic(such as wether should be invalidated
> TLB when filling the tables for the first time, etc), therefore, there
> create a new PCD to let it know this. BTW, ARM and RISC-V have the same
> logic.

Yes, UpdateRegionMapping needs to know this, no doubt.  But do we need a
PCD for this?  Looks like a pointless indirection to me.

Arm has a ArmMmuEnabled() functions which goes read the control
registers directly.

take care,
  Gerd



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


Reply via email to