From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-it0-x230.google.com (mail-it0-x230.google.com [IPv6:2607:f8b0:4001:c0b::230]) (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 21C38803D5 for ; Wed, 15 Mar 2017 03:13:00 -0700 (PDT) Received: by mail-it0-x230.google.com with SMTP id w124so15181095itb.0 for ; Wed, 15 Mar 2017 03:13:00 -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=dITHCbujhqwWxKqb7J0S8ZyBE7AWuD9wcfEWH/bARqI=; b=PHbCJFLnAgypGmmZebwxVzuCtqon/p8/t4U63jPxJlC0+E7nkDFhfFhAyuxcnih7K4 Ho8ewpl4x5MmV89Ctr15pvNWfpKXVWVDUi1Acwxr9mjxQeFgrcEzIOdqQqHq8vFT/dXV DlNxzEfmZBa8Xnsh4H75mTRaOfYU2krvuhjlQ= 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=dITHCbujhqwWxKqb7J0S8ZyBE7AWuD9wcfEWH/bARqI=; b=rHx68lNsHD4JceziaPdwIVs9tnvMogoNTZiVetBEe32Qhfp52bivaxwbMDYxsc98Bd IGnfMNITtefRL1SiAKAtcSbmvW61w4mejgmMdVsOmLHLN2l/Uu2nDSdml2C7oY/NLNyl Pgi28m1gjL2YfSa+xNUUlQ+rYLG2a7+ZRmJdMhNaM5oFFt7GZP7DAOI7e4CwTi5s21Bl 63A3ZwW4hAyCrqRpRTzxrzqOsI3aupGjXd0w0u+68e7P6XMzCEeOmKZWj8rYusj3yXYs LKcVDkj56AhMXwkMpylPjjixh3jagn0k5ZhuSpj0g29g4JQZoN3F51N7+DC2iGWZN4Ow m36w== X-Gm-Message-State: AFeK/H1iyb8SW1Lk91K8yRV5nXeNY1yDTvbpw5EIfm3+wTvG0TB/b7R6Og0Vqf58/n2pI6htrl3RQ+FQx0QQyq2S X-Received: by 10.36.77.10 with SMTP id l10mr4061238itb.59.1489572779346; Wed, 15 Mar 2017 03:12:59 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.10.27 with HTTP; Wed, 15 Mar 2017 03:12:58 -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 10:12:58 +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.21 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 10:13:00 -0000 Content-Type: text/plain; charset=UTF-8 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). > Thanks!