From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 9811474003D for ; Wed, 4 Dec 2024 15:39:54 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=Cx40wsrgLV8NBxp8AKnPzViOvCz95W+5rfNodluU3Ys=; c=relaxed/simple; d=groups.io; h=DKIM-Filter:Message-ID:Date:MIME-Version:User-Agent:Subject:To:References:From:In-Reply-To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240830; t=1733326794; v=1; x=1733585993; b=BnmhBvtDkL2Okps+yGn/3YeNmMOHkJg/dDnhHtsfh+inF4mBPjMJwQY4Cr8m+YYmPmlxNn9O J3BuB/h7Yb/ewJsJn2Eh3LDus+VFR3yfp6vdfiLA9s+eeC11z+HqYCTnhw/USPC0BEiaKoWp6+k OEWFoH9Nf0YFkbufJAsaHz4oM+YaU90mE3ubHIzaGpzZeWt1snhu2xsqGvgBiQBkSaqbSjhO0T2 p5xd/oBjmwjIfGJSwKFqmV5arkpqFH3HiUheNc/J1vBQCDz3RcW0Vedh5vtjE4A9dpkachdhhQz 4Nk8/p3tvooJiVPOeG4WlnlLMjdINxB4Pq2Y2sC1ZjNng== X-Received: by 127.0.0.2 with SMTP id 5cGxYY7687511x3BfIufuE2d; Wed, 04 Dec 2024 07:39:53 -0800 X-Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mx.groups.io with SMTP id smtpd.web10.17746.1733326792442884258 for ; Wed, 04 Dec 2024 07:39:52 -0800 X-Received: from [10.137.194.171] (unknown [131.107.1.235]) by linux.microsoft.com (Postfix) with ESMTPSA id C7EC720BCAF0; Wed, 4 Dec 2024 07:39:51 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com C7EC720BCAF0 Message-ID: <1c4d0af6-106c-4db0-80e2-b2dc66d82500@linux.microsoft.com> Date: Wed, 4 Dec 2024 07:39:51 -0800 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [edk2-devel] [edk2-discuss] Attempted runtime pool allocation returns non-runtime pool To: devel@edk2.groups.io, leif.lindholm@oss.qualcomm.com, discuss@edk2.groups.io, adwags@gmail.com References: From: "Oliver Smith-Denny via groups.io" In-Reply-To: Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Wed, 04 Dec 2024 07:39:52 -0800 Resent-From: osde@linux.microsoft.com Reply-To: devel@edk2.groups.io,osde@linux.microsoft.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: YyfOJ6qyL5G7YzzQMcyjzJmrx7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240830 header.b=BnmhBvtD; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io Hi Adam, > On Wed, 4 Dec 2024 at 04:21, Adam Wagner via groups.io > wrote: >> >> Hello, >> >> I have a DXE runtime driver that is attempting to allocate runtime pool >> (via AllocateRuntimeZeroPool). I'm getting back a non-NULL pointer, but = it >> isn't in the runtime memory map so ConvertPointer fails later. It looks >> like the returned address is in a memory region of "conventional" type >> which if I understand correctly is where free memory lives? >> >> I think I may be hitting the "Attempt to find free pages in the default >> allocation bin" case here... >> https://github.com/tianocore/edk2/blob/master/MdeModulePkg/Core/Dxe/Mem/= Page.c#L1281 >> This piece is fine if it doesn't hit the normal memory bin, it will still get the type converted in the call to CoreConvertPages. I agree with Leif that AllocateRuntimeZeroPool should not be returning the memory if anything failed; what I would recommend is adding some prints or using a debugger to tell if the memory is getting the correct type on that allocate call and then checking if it is getting freed later by some entity. Oliver -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#120871): https://edk2.groups.io/g/devel/message/120871 Mute This Topic: https://groups.io/mt/109918571/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-