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.1440.1677707856924368560 for ; Wed, 01 Mar 2023 13:57:37 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ZrIrKdzX; 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 1E42E614D3 for ; Wed, 1 Mar 2023 21:57:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7F97FC433EF for ; Wed, 1 Mar 2023 21:57:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1677707855; bh=yLf1/XRHx58qSZDYD/3GK93vWOU5BMmv3xTZ+yTTgTY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ZrIrKdzXyW8kfYLX5ovKqN+hMZKKzSs0QJ/Pzj50jUU8qbVBFuYpkcHl6zeSaIX5r 4oqbhFtSxQ5scWwS0A7AJWtMwN72FQvhP8WBj4S9aBwmFyRg64jsaZuXtVLIoTo81x hGDDf3INs/X5kYvBsBgMDRezP0KOkmQczEeseitOofl+AVRzVJ56QCQfJ7oM8WX4i/ FChxC5HOTAI9Bc27SQWO5Z5lrHKUv3iF6ddc8WwUZ1dWWXSrs3KhCdJmJuBPEGPYFt WOWAM/PSCCxKWWdIGfB1ErAjoxL2gjZm22GbIUOA5dXz9JpJSexqusE7oZQJDY9Fzw OVRDz3vGFA+cA== Received: by mail-lf1-f49.google.com with SMTP id i9so19600816lfc.6 for ; Wed, 01 Mar 2023 13:57:35 -0800 (PST) X-Gm-Message-State: AO0yUKVaHQM9tgEndROWXSNnr4+QtlE7x9VcJlDEK3GbClyS++gNaQ8b aFVvY5OgQ20miarQDMPo74i4utcEzqyD+bCA6VM= X-Google-Smtp-Source: AK7set/QTyy5+EYBaN/NpcH4OPumuEVZSGqnbpqO2f/BGdQIpwJ1zeDt/u5so1WqNq6MOiud7SDrMMUYXAQXehz5Kys= X-Received: by 2002:ac2:5188:0:b0:4d8:62e5:4f66 with SMTP id u8-20020ac25188000000b004d862e54f66mr2394475lfi.7.1677707853520; Wed, 01 Mar 2023 13:57:33 -0800 (PST) MIME-Version: 1.0 References: <20230209135936.789983-1-ardb@kernel.org> <5af401fe-d5f9-15ef-d021-b998395554e7@taylorbeebe.com> In-Reply-To: From: "Ard Biesheuvel" Date: Wed, 1 Mar 2023 22:57:22 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 00/11] ArmPkg: implement EFI memory attributes protocol To: Taylor Beebe Cc: devel@edk2.groups.io, Michael Kinney , Liming Gao , Jiewen Yao , Michael Kubacki , Sean Brogan , Rebecca Cran , Leif Lindholm , Sami Mujawar Content-Type: text/plain; charset="UTF-8" On Wed, 1 Mar 2023 at 21:43, Taylor Beebe wrote: > > > > On 2/11/2023 2:05 AM, Ard Biesheuvel wrote: > > On Sat, 11 Feb 2023 at 01:56, Taylor Beebe wrote: > >> > >> Hey Ard, > >> > >> Once the Memory Attribute Protocol is made available, Windows will have > >> some expectations about its functionality. Can you run this test app > >> created by me and Jiewen to ensure it meets the Windows requirements? > >> Part of the test needed an AARCH64 implementation which I just added - > >> let me know if it doesn't work. > >> > > > > Thanks, this is rather helpful. > > > > There appears to be an issue related to > > DEBUG_PROPERTY_DEBUG_CLEAR_MEMORY_ENABLED so I had to disable that to > > run these tests, as otherwise, the DXE core tries to clear freed pages > > before restoring the memory attributes. > > > > With that out of the way, the only test that fails is 'New > > EfiLoaderCode buffer attributes expected' because this firmware build > > maps loader code RWX, as existing boot stages for Linux are relying on > > this (including the kernel itself at this point) > > It makes sense that the NewEfiLoaderCode test fails, but I am surprised > the FreePagesWithProtectionAttributesTestCase passes. The test ensures > that a page with EFI_MEMORY_RP and/or EFI_MEMORY_RO has those attributes > cleared before attempting to free the page within the FreePage routine > and is related to the concern Marvin had. > > Did you make a change to the core or is there an execution path I'm not > seeing which allows that test to pass? No, I didn't make any additional changes to the core afair.