> +/** > + Initialize a buffer pool for page table use only. > + > + To reduce the potential split operation on page table, the pages reserved > for > + page table should be allocated in the times of PAGE_TABLE_POOL_UNIT_PAGES > and > + at the boundary of PAGE_TABLE_POOL_ALIGNMENT. So the page pool is always > + initialized with number of pages greater than or equal to the given > + PoolPages.
Hmm, doesn't have tianocore a lib for such allocation pools? > + // > + // Link all pools into a list for easier track later. > + // Seems to be never used. > +/** > + Disable Write Protect on pages marked as read-only. > +**/ > +STATIC > +VOID > +DisableReadOnlyPageWriteProtect ( Why this is needed? > +typedef union { > + struct { > + UINT64 Present:1; // 0 = Not present in memory, > + // 1 = Present in memory > + UINT64 ReadWrite:1; // 0 = Read-Only, 1= Read/Write > + UINT64 UserSupervisor:1; // 0 = Supervisor, 1=User > + UINT64 WriteThrough:1; // 0 = Write-Back caching, > + // 1 = Write-Through caching > + UINT64 CacheDisabled:1; // 0 = Cached, 1=Non-Cached > + UINT64 Accessed:1; // 0 = Not accessed, > + // 1 = Accessed (set by CPU) > + UINT64 Reserved:1; // Reserved > + UINT64 MustBeZero:2; // Must Be Zero > + UINT64 Available:3; // Available for use by system software > + UINT64 PageTableBaseAddress:40; // Page Table Base Address > + UINT64 AvabilableHigh:11; // Available for use by system software > + UINT64 Nx:1; // No Execute bit > + } Bits; > + UINT64 Uint64; > +} PAGE_MAP_AND_DIRECTORY_POINTER; No need to add that, there is OvmfPkg/Include/IndustryStandard/PageTable.h take care, Gerd -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#81826): https://edk2.groups.io/g/devel/message/81826 Mute This Topic: https://groups.io/mt/86085766/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-