From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pl1-f177.google.com (mail-pl1-f177.google.com [209.85.214.177]) by mx.groups.io with SMTP id smtpd.web11.35034.1677703431400148685 for ; Wed, 01 Mar 2023 12:43:51 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@taylorbeebe.com header.s=google header.b=ETWlS7lR; spf=pass (domain: taylorbeebe.com, ip: 209.85.214.177, mailfrom: t@taylorbeebe.com) Received: by mail-pl1-f177.google.com with SMTP id n6so13961368plf.5 for ; Wed, 01 Mar 2023 12:43:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=taylorbeebe.com; s=google; t=1677703431; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=QfDd+JihLA7rCWq+POobYgXWBDVGixow+PEROcYqzwc=; b=ETWlS7lRlr98QOJu1iwGp39JIFJ8g3+ePq2ZKp6y/XfSb5dlM3m+MZQAPpy2nMZWJc YbBMayWH5kIp6rAfteWNRkjFTMAIVwxO2cLlBgW3KIrppUnAmXRF0OTXI477r1O014ni KTv6mHlFzAfG+BdJVLdEms1G8dgFb6vR8RAe7QAFwwbUBmCtkZsuLuWA9RW9RuMZcQxR dZ5dKIxJpzkRccFWcid+TfdPhharsiaeRG+4MLX3GYftOze/EC4Vz4j1xToj+NkOwlH4 ixe8CThQhWaM8H5GSoNINiG4s8LkHMLaDogK850cne2YVUdb8/F/+FxG6cfWw7fXaeXB JKGw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1677703431; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QfDd+JihLA7rCWq+POobYgXWBDVGixow+PEROcYqzwc=; b=nFb5alA//8TyQWfjJXgTqRQqD+ugerLU3f7qZk11IuanK+x8RS/j7EYEhEX8JiOvpN IG0fFKwmLgD68ANso/dc8YlpPVzdBnDBJOFfO5herCzns7jGJyc0lXCcPWj+vPdBjvbC wQJFGp1nAyo6ODmRw+ZZ8FZbvsMJitqFrHsfMkejXeLzzKvToeUfFY6M9SkXcplulo3i i1Rz6lCdaCsZ2bwNjcMj5ryUNMBp1Kwa/54Rew/mFAMtFAOTK3qcB4bgTR0DSk4WBfM4 0CWSBHGG6kFOt9ddRs75d9ncDL8ouITHV3NHKRHi8tEX146MYULDfuv2aCF/3VrlK8Sy 2S6Q== X-Gm-Message-State: AO0yUKVM/J8kO39VniVp4Lc5D4sW5lJED72UMm+b+aH6Do0oLYg7PtWR bq6wybEC1zqzopepjQ1sEt765g== X-Google-Smtp-Source: AK7set+6Bmi5CupO5KvYN2+OWz5qf1X/ZGzcx5wq/b7HibHQ3FqgT11D4z/KBQThhsAY5iU/YTzs+g== X-Received: by 2002:a05:6a20:a022:b0:cd:9db3:a7c1 with SMTP id p34-20020a056a20a02200b000cd9db3a7c1mr8160573pzj.44.1677703430607; Wed, 01 Mar 2023 12:43:50 -0800 (PST) Return-Path: Received: from [192.168.50.162] ([50.46.230.135]) by smtp.gmail.com with ESMTPSA id r135-20020a632b8d000000b005033e653a17sm6256446pgr.85.2023.03.01.12.43.49 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 01 Mar 2023 12:43:50 -0800 (PST) Message-ID: Date: Wed, 1 Mar 2023 12:43:49 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.8.0 Subject: Re: [PATCH v4 00/11] ArmPkg: implement EFI memory attributes protocol To: Ard Biesheuvel Cc: devel@edk2.groups.io, Michael Kinney , Liming Gao , Jiewen Yao , Michael Kubacki , Sean Brogan , Rebecca Cran , Leif Lindholm , Sami Mujawar References: <20230209135936.789983-1-ardb@kernel.org> <5af401fe-d5f9-15ef-d021-b998395554e7@taylorbeebe.com> From: "Taylor Beebe" In-Reply-To: Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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?