From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-x235.google.com (mail-io0-x235.google.com [IPv6:2607:f8b0:4001:c06::235]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 0996B8033F for ; Wed, 15 Mar 2017 12:37:07 -0700 (PDT) Received: by mail-io0-x235.google.com with SMTP id b140so27717160iof.1 for ; Wed, 15 Mar 2017 12:37:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=OgbuPuFNe8SU/kIJ5jzyTNmC2IBJCymeO+0mYotVLws=; b=TMwgSoO6ix95XMkqsfAia4CDB4tFnXg0oN78t5RJ8kHZlka/6QA5QGQ+TiKAMKibjw 6QrxMyF6dsS5lQmwa2R554iUekj8zSRw9q41mwF9p38mvS+31HB4lqeUy9E0eUhaHmql 0a6ktnHOXKWBRrRYeRLTSnE5ph+Cw6gbCimeA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=OgbuPuFNe8SU/kIJ5jzyTNmC2IBJCymeO+0mYotVLws=; b=QLvicOchOgEeeAUz5+Gv91XmJGSwpxQpt5bQeWp006B7CZSg/X1jWx/VMQY/TU7gY0 O0cgvX2QglCu3eomDdN/UTnQ/RVwzF2zPqwTothUltqyRcTfBcw8tOpL6taMONpD5hCu e2N7zhQsjZyueDDfK4YVyGbUpu5j6r5XE5h1F17qjgmzHFxkt5mg71O1beiQPow/mXck DxVZoO/lfFAIddelWodgNMml2lycEh2l+B5ZyFhZAeHY/u6WWMqFQyGlOBq9x/sMSIgv KkQuIyun5YoSRK3dsu7AUZoubIyTquVI6MkQMEuORj2AI4r/vznINFwcWL5dAvcmAC4+ ++sA== X-Gm-Message-State: AFeK/H0tLo2zKDPgDSY7ZkBZ0ouMzFCpUXq3ZqY7+gl9CFc1d4/xilLg78Rq0BlYwn1Y3dS7WGiMQim0Ajq2FuaK X-Received: by 10.107.168.21 with SMTP id r21mr6299546ioe.45.1489606626173; Wed, 15 Mar 2017 12:37:06 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.10.27 with HTTP; Wed, 15 Mar 2017 12:37:05 -0700 (PDT) In-Reply-To: References: <1489521495-2961-1-git-send-email-ard.biesheuvel@linaro.org> <20170314202028.GX16034@bivouac.eciton.net> From: Ard Biesheuvel Date: Wed, 15 Mar 2017 19:37:05 +0000 Message-ID: To: Ryan Harkin Cc: Leif Lindholm , "edk2-devel@lists.01.org" Subject: Re: [PATCH] ArmPkg/UncachedMemoryAllocationLib: set XP bit via CPU arch protocol X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 15 Mar 2017 19:37:07 -0000 Content-Type: text/plain; charset=UTF-8 On 15 March 2017 at 10:12, Ard Biesheuvel wrote: > On 15 March 2017 at 09:59, Ryan Harkin wrote: >> Hi Ard, >> >> Thanks for the quick turnaround as always. >> >> On 14 March 2017 at 20:20, Leif Lindholm wrote: >>> On Tue, Mar 14, 2017 at 07:58:15PM +0000, Ard Biesheuvel wrote: >>>> Commit e7b24ec9785d ("ArmPkg/UncachedMemoryAllocationLib: map uncached >>>> allocations non-executable") adds code that manipulates the GCD memory >>>> space attributes of a newly allocated uncached region without checking >>>> whether this region expose these attributes in its capabilities mask. >>>> >>>> Given that the intent is to remove executable permissions from the region, >>>> this is a fairly pointless exercise to begin with, regardless of whether >>>> it is correct or not. The reason is that RO/XP memory attributes in the >>>> GCD memory space map or the UEFI memory map are completely disconnected >>>> from the actual mapping permissions used in the page tables. >>>> >>>> So instead, invoke the CPU arch protocol directly, and add the non-exec >>>> attributes in the page tables directly. >>>> >>>> Contributed-under: TianoCore Contribution Agreement 1.0 >>>> Signed-off-by: Ard Biesheuvel >> >> Tested-by: Ryan Harkin >> >> FVPs and TC2 worked before this change, Juno was hanging on boot as >> per an earlier email thread. >> >> I tested this change on FVP Foundation & AEMv8, TC2 and Juno R0/1/2 >> and they all work fine after it's applied to the current HEAD of EDK2 >> (commit 8057622). >> Pushed now.