On 1/22/2024 6:53 PM, Oliver Smith-Denny wrote:

I was able to repro your bug (by just turning on page guards on
ArmVirtQemu, allocating runtime mem and freeing it). I think you
are the first person to free runtime mem on ARM64 with page guards
enabled (and to care when it failed :).

The heap guard code is not written with ARM64 in mind (nor is much of
the codebase, of course). Specifically in this case the heap guard code
only wishes to preserve 4 KB alignment, it knows nothing of ARM64's
runtime page granularity required.

Let me take a look at this, I'm working on a solution here, but I want
to test this out further. I'll try to send a patch later this week or
next.

Thanks! I wonder if the same problem occurs on LoongArch64, which also defines the runtime page allocation granularity to be 0x10000?


MdePkg/Include/X64/ProcessorBind.h
261:#define RUNTIME_PAGE_ALLOCATION_GRANULARITY  (0x1000)

MdePkg/Include/LoongArch64/ProcessorBind.h
89:#define RUNTIME_PAGE_ALLOCATION_GRANULARITY  (0x10000)

MdePkg/Include/RiscV64/ProcessorBind.h
120:#define RUNTIME_PAGE_ALLOCATION_GRANULARITY  (0x1000)

MdePkg/Include/Ia32/ProcessorBind.h
262:#define RUNTIME_PAGE_ALLOCATION_GRANULARITY  (0x1000)

MdePkg/Include/AArch64/ProcessorBind.h
164:#define RUNTIME_PAGE_ALLOCATION_GRANULARITY  (0x10000)

MdePkg/Include/Arm/ProcessorBind.h
170:#define RUNTIME_PAGE_ALLOCATION_GRANULARITY  (0x1000)

MdePkg/Include/Ebc/ProcessorBind.h
125:#define RUNTIME_PAGE_ALLOCATION_GRANULARITY  (0x1000)

--
Rebecca Cran


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


Reply via email to