From patchwork Wed Feb 15 17:11:55 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 94029 Delivered-To: patch@linaro.org Received: by 10.182.3.34 with SMTP id 2csp2079817obz; Wed, 15 Feb 2017 09:12:19 -0800 (PST) X-Received: by 10.99.45.133 with SMTP id t127mr40251129pgt.224.1487178739419; Wed, 15 Feb 2017 09:12:19 -0800 (PST) Return-Path: Received: from ml01.01.org (ml01.01.org. [198.145.21.10]) by mx.google.com with ESMTPS id v124si4277635pfb.230.2017.02.15.09.12.19 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Feb 2017 09:12:19 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) client-ip=198.145.21.10; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 198.145.21.10 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id E777B82099; Wed, 15 Feb 2017 09:12:16 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x232.google.com (mail-wm0-x232.google.com [IPv6:2a00:1450:400c:c09::232]) (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 603B982098 for ; Wed, 15 Feb 2017 09:12:14 -0800 (PST) Received: by mail-wm0-x232.google.com with SMTP id r141so45887471wmg.1 for ; Wed, 15 Feb 2017 09:12:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=/6G7fvFSTF0PF+7NmXcLXKQcm+tAQmeeDvuefLvTFYw=; b=gMvvA32B9fm00gmZVEpmOrvoh/B5yNnv2UcNlTg5nucABJkj1uObxp0z5O5/OCTPee AP25iQaadto9H9hS4E6mtUm2ZSIQjepDXVASRo6Ki9LthuJ8L5cDOyUTB6B0JvwOGdvx 2bso324rpKAZwVmkrwxg+0sR8mB6Xc6/JC+4s= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=/6G7fvFSTF0PF+7NmXcLXKQcm+tAQmeeDvuefLvTFYw=; b=XgxJwv6I/sGhrXymg3em4Ls5uvOzK8I1Lze5f7ijpe+dKknkKoHLS6ay3lxQY4gA8h fjyRbhkAPrgxkgRRhSKzW1VIfWouN1zap8jhNdlb6BahDx/k/Oi2pXOR4VfkNt/3zPKE ARov8QOs+5L5D4WPvEFSHutYr4dvOmybmS7Y71kr6oPtOTUYUHz4DemW94LWptkU1A4Z xSALlpq1NoJ8GPmq2mU4koVVt8QpOw0BtTCuKUSnG9ltMTr+JjUgBF1Hwbopz64jbxLk /myTQwgjX4g0/o/ikuDsQ4kJD9fHd1/IyfmrQ+4v0cYNKudgbYvvE6hkrrUzXxKGuVAl 1EVw== X-Gm-Message-State: AMke39nYTNl6VpAbzyoxbRC9vIrnL9RhucE4NmvciX0B9Lda4uAF1IyMQ8ps2MDrLeEIS5v+ X-Received: by 10.28.210.65 with SMTP id j62mr8952875wmg.9.1487178732949; Wed, 15 Feb 2017 09:12:12 -0800 (PST) Received: from localhost.localdomain ([196.80.229.213]) by smtp.gmail.com with ESMTPSA id n13sm5606276wrn.40.2017.02.15.09.12.11 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 15 Feb 2017 09:12:12 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org Date: Wed, 15 Feb 2017 17:11:55 +0000 Message-Id: <1487178716-24569-4-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1487178716-24569-1-git-send-email-ard.biesheuvel@linaro.org> References: <1487178716-24569-1-git-send-email-ard.biesheuvel@linaro.org> Subject: [edk2] [PATCH v2 3/4] ArmPkg/CpuDxe: ARM: ignore page table updates that only change permissions 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: , Cc: jiewen.yao@intel.com, Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" Currently, we have not implemented support on 32-bit ARM for managing permission bits in the page tables. Since the new DXE page protection for PE/COFF images may invoke EFI_CPU_ARCH_PROTOCOL.SetMemoryAttributes() with only permission attributes set, let's simply ignore those for now. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel Reviewed-by: Leif Lindholm --- ArmPkg/Drivers/CpuDxe/Arm/Mmu.c | 7 +++++++ 1 file changed, 7 insertions(+) -- 2.7.4 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel diff --git a/ArmPkg/Drivers/CpuDxe/Arm/Mmu.c b/ArmPkg/Drivers/CpuDxe/Arm/Mmu.c index b6ba975b353a..89e429925ba9 100644 --- a/ArmPkg/Drivers/CpuDxe/Arm/Mmu.c +++ b/ArmPkg/Drivers/CpuDxe/Arm/Mmu.c @@ -680,6 +680,13 @@ SetMemoryAttributes ( { EFI_STATUS Status; + // + // Ignore invocations that only modify permission bits + // + if ((Attributes & EFI_MEMORY_CACHETYPE_MASK) == 0) { + return EFI_SUCCESS; + } + if(((BaseAddress & 0xFFFFF) == 0) && ((Length & 0xFFFFF) == 0)) { // Is the base and length a multiple of 1 MB? DEBUG ((EFI_D_PAGE, "SetMemoryAttributes(): MMU section 0x%x length 0x%x to %lx\n", (UINTN)BaseAddress, (UINTN)Length, Attributes));