public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Oliver Smith-Denny" <osde@linux.microsoft.com>
To: devel@edk2.groups.io, rebecca@os.amperecomputing.com
Cc: Leif Lindholm <quic_llindhol@quicinc.com>,
	Ard Biesheuvel <ardb+tianocore@kernel.org>,
	Jian J Wang <jian.j.wang@intel.com>,
	Liming Gao <gaoliming@byosoft.com.cn>,
	Dandan Bi <dandan.bi@intel.com>
Subject: Re: [edk2-devel] AArch64 with HeapGuard: page allocations wrongly aligned
Date: Thu, 18 Jan 2024 10:38:26 -0800	[thread overview]
Message-ID: <6e76cf82-314a-47cb-9d26-36abf1d3f65a@linux.microsoft.com> (raw)
In-Reply-To: <24affef7-eb96-4a82-b9d4-b616eb90024d@os.amperecomputing.com>

On 1/18/2024 9:42 AM, Rebecca Cran via groups.io wrote:
> On 1/18/2024 9:48 AM, Oliver Smith-Denny via groups.io wrote:
> 
>> Are you including this commit: 
>> https://github.com/tianocore/edk2/commit/00b51e0d78a547dd78119ec44fcc74a01b6f79c8?
>>
>> Can you share some more details on where this is failing? I.e. what
>> assert is getting tripped? Presumably without HeapGuard enabled, you
>> aren't seeing the failure?
>>
>> Are you hitting this case:
>> https://github.com/tianocore/edk2/blob/59f024c76ee57c2bec84794536302fc770cd6ec2/MdeModulePkg/Core/Dxe/Mem/Page.c#L1570-L1573?
>>
>> Does this repro on ArmVirtPkg?
> 
> Yes, I have that commit in my tree.
> 
> I'm hitting this assert in FreePages: 
> https://github.com/tianocore/edk2/blob/59f024c76ee57c2bec84794536302fc770cd6ec2/MdeModulePkg/Library/DxeCoreMemoryAllocationLib/MemoryAllocationLib.c#L190
> 
> It's called by SmbiosCreate64BitTable: 
> https://github.com/tianocore/edk2/blob/59f024c76ee57c2bec84794536302fc770cd6ec2/MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.c#L1342
> 
> And yes, that's the case I'm hitting.
> 
> I'm having trouble getting ArmVirtPkg to run. Would it be useful testing 
> using SbsaQemu instead?
> 

Yeah, if you can get it running there, that would be a good data point.
I assume you mean the Project Mu QemuSbsaPkg? If so that is great, but
you will need to update the RUNTIME_PAGE_ALLOCATION_GRANULARITY back to
0x10000. It was set to 0x1000 for a historical issue that we are
working on reconciling with what edk2 has.

If you can get an open source repro, I'm happy to take a look at the
failure.

To clarify, if you turn off pool guard, does the assert go away?

I am suspicious that we are checking for the alignment before we
adjust the memory for the guard. I'm wondering if we actually
should do AdjustMemoryF (recalling function from memory) before
we check the alignment.

Thanks,
Oliver


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#114003): https://edk2.groups.io/g/devel/message/114003
Mute This Topic: https://groups.io/mt/103810212/7686176
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io]
-=-=-=-=-=-=-=-=-=-=-=-



  reply	other threads:[~2024-01-18 18:38 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-18 15:27 [edk2-devel] AArch64 with HeapGuard: page allocations wrongly aligned Rebecca Cran via groups.io
2024-01-18 16:48 ` Oliver Smith-Denny
2024-01-18 17:42   ` Rebecca Cran via groups.io
2024-01-18 18:38     ` Oliver Smith-Denny [this message]
2024-01-18 18:45       ` Rebecca Cran via groups.io
2024-01-18 19:04         ` Oliver Smith-Denny
2024-01-18 19:26           ` Rebecca Cran via groups.io
     [not found]     ` <17AB84FD31479E00.28523@groups.io>
2024-01-18 19:26       ` Oliver Smith-Denny
2024-01-19 16:34         ` Rebecca Cran via groups.io
2024-01-19 20:03           ` Oliver Smith-Denny
2024-01-22 22:06             ` Rebecca Cran via groups.io
2024-01-23  1:53               ` Oliver Smith-Denny
2024-01-23  2:14                 ` Rebecca Cran via groups.io
2024-01-24 18:29                   ` Oliver Smith-Denny
     [not found]               ` <17ACD713D9397BBF.18300@groups.io>
2024-02-03  0:59                 ` Oliver Smith-Denny
2024-02-05 17:22                   ` Rebecca Cran via groups.io
2024-02-05 17:51                     ` Oliver Smith-Denny
2024-02-05 17:58                       ` Rebecca Cran via groups.io
2024-02-05 20:36                         ` Oliver Smith-Denny
     [not found]                         ` <17B111E492D567BB.26550@groups.io>
2024-02-06  4:20                           ` Oliver Smith-Denny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6e76cf82-314a-47cb-9d26-36abf1d3f65a@linux.microsoft.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox