From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web10.743.1670452747967995704 for ; Wed, 07 Dec 2022 14:39:08 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=UmGhNT3c; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 1691E61CC6 for ; Wed, 7 Dec 2022 22:39:07 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 385BCC43152 for ; Wed, 7 Dec 2022 22:39:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1670452745; bh=z3mxX/Z+/JdeVYxYNRiPWv9TIuPvzrcl+v2+kAbbBoE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=UmGhNT3ca5VKvWmB1N2t7r01tQRA/oc/MLpI9USaovi2Sjkb+E/ShtVW224qOdFh6 cOhA8gLs/ol21VKaf9h0VWArqlavTgJAQ7+23p5ZK0/JLPhn6kzW8aWrDTEAnu/L3a DeO+u6j4Wop62NLBZNdkc8FC2NnF7lY7xmAZVX8aTIiejywpdEVDDTjyUp53pE7HyE V5uOBU695lXqBMHZf0kcYCbgvmt8cXH5W7uyaiTCRJw3on/zzpZhyurIG7xwQ437ay ns8+b0IEnd5YVh8a52VhVoOXoAnoGE5gzgfEN2uMT3Ez1n1mFw0zTbsr6DxgApbfVQ omc4Bts/juDmw== Received: by mail-lj1-f170.google.com with SMTP id z4so22534096ljq.6 for ; Wed, 07 Dec 2022 14:39:05 -0800 (PST) X-Gm-Message-State: ANoB5pk+vfbpIff7dB1IRGxSe3JuP+oFkJveVWafIX51ApBaW0FeqzzP 8Fnhk3Xm8JxzXKIX0xn8LMpkdzrhdpOf0ClS2Z4= X-Google-Smtp-Source: AA0mqf6gwuAjrhclugM6myYK7QsaDff15fOtZcUcCW+6u5iLKg7ysDHcuiGIIR5vxmo0mqJ4gryDzk8U/YrVzDzpCuk= X-Received: by 2002:a05:651c:b14:b0:277:7eef:1d97 with SMTP id b20-20020a05651c0b1400b002777eef1d97mr24651195ljr.516.1670452743179; Wed, 07 Dec 2022 14:39:03 -0800 (PST) MIME-Version: 1.0 References: <20221207180044.2863126-1-ardb@kernel.org> In-Reply-To: From: "Ard Biesheuvel" Date: Wed, 7 Dec 2022 23:38:51 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [PATCH] MdeModulePkg/DxeCore: Use correct type for alignment mask To: "Kinney, Michael D" Cc: "devel@edk2.groups.io" , "Bi, Dandan" , "Gao, Liming" , "Wang, Jian J" Content-Type: text/plain; charset="UTF-8" On Wed, 7 Dec 2022 at 19:54, Kinney, Michael D wrote: > > Hi Ard, > > Thank you. This is a really good find. How did you find it? > The 32-bit version of ArmVirtQemu got inadvertently broken by a change that seemed unrelated, but resulted in the primary memory resource descriptor hob to end exactly at 4 GB if the memory exceeds that limit, with very confusing results (ASSERT()s on invalid magic numbers in the MEMORY_MAP linked list) > I am guessing this case may not have been noticed on IA32/X64 because > those archs tend to have FLASH device mapped just below 4GB and as a > result there is no system memory in the range just below 4GB. This > means the case where a page allocation with an end descriptor at > 4GB is not observed on IA32/X64. > Indeed. And it was not observed on ARM either, because we used to place the PEI permanent memory (I think?) at the top of addressable RAM, resulting in the region to be occupied by the time DXE core runs. On 64-bit ARM, i changed that policy recently to use 128 MiB of system memory that is described by initial page tables stored in flash, but this move resulted in this weird behavior on 32-bit (which doesn't have the initial page tables)