From patchwork Thu Mar 17 13:55:00 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 64002 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp482766lbc; Thu, 17 Mar 2016 06:55:07 -0700 (PDT) X-Received: by 10.66.254.168 with SMTP id aj8mr15258407pad.18.1458222907306; Thu, 17 Mar 2016 06:55:07 -0700 (PDT) Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id d27si9823340pfj.14.2016.03.17.06.55.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Mar 2016 06:55:07 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) client-ip=2001:19d0:306:5::1; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of edk2-devel-bounces@lists.01.org designates 2001:19d0:306:5::1 as permitted sender) smtp.mailfrom=edk2-devel-bounces@lists.01.org; dkim=neutral (body hash did not verify) header.i=@linaro.org Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id AD4A61A1E3C; Thu, 17 Mar 2016 06:55:26 -0700 (PDT) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received: from mail-wm0-x22d.google.com (mail-wm0-x22d.google.com [IPv6:2a00:1450:400c:c09::22d]) (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 CC4A61A1E39 for ; Thu, 17 Mar 2016 06:55:25 -0700 (PDT) Received: by mail-wm0-x22d.google.com with SMTP id l68so27339559wml.0 for ; Thu, 17 Mar 2016 06:55:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=pHUIiw0OkjKri1/XrJh3513oxSxSPwDCdiB+WOq4pbQ=; b=S6wqc4UMGHI7ak6FoSNxJzQkd7O7/sneZr1NzG5z5mD0wZL4H7wxsabeLcVCtdKJ1D 2tuB/lVfpGcqM8zakl9OYEEVO7Hp4x14mskcgJN4fn/QZMBtVNN+e7uiI4U59PXOrb5f FF+c4oMMF3lm7V6XBdlqBRLTYzeNK7tGXepXY= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=pHUIiw0OkjKri1/XrJh3513oxSxSPwDCdiB+WOq4pbQ=; b=VNMStR7YYDacbAmuQ4NkvETcNDC1P8OMeKJePi7gQucRTzhW1EHM0tBLtuFQnTR9O0 jCrgr0umqJgCk4oiGps8vmcfJC3mhidEr2VK3YI2JdJMqOpoQ3nmzgwQF1MnsCS4cM2g sWi4qNYyzSU5Va1Drac9UEb4g5Ab5VNuW/uoZ1Xo8ETSkAbsOMrhkWNJz6pH2KtegE4m rTDDTz6EFS+6mvNuO8zput5I7BGVUaI148MPUi86eXtWfMBtQ/2MRw1TrgXBmtbdlPUU /V8LX+DdjO6w/yiAXxuCjGG25MTqXzGsfcXXukHpKyez/to/IB35MkYaaiO++0a3i9XD n8CA== X-Gm-Message-State: AD7BkJIpLcspf+ZU62YlqY+00S+5EJlsHW+KaZn22g+NpFwY5VAbgNohZf0wtk+L8cp3DPF/ X-Received: by 10.194.123.102 with SMTP id lz6mr11270035wjb.2.1458222904490; Thu, 17 Mar 2016 06:55:04 -0700 (PDT) Received: from localhost.localdomain ([195.55.142.58]) by smtp.gmail.com with ESMTPSA id i2sm7822614wje.22.2016.03.17.06.55.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Thu, 17 Mar 2016 06:55:03 -0700 (PDT) From: Ard Biesheuvel To: edk2-devel@lists.01.org, leif.lindholm@linaro.org Date: Thu, 17 Mar 2016 14:55:00 +0100 Message-Id: <1458222900-7890-1-git-send-email-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.5.0 Subject: [edk2] [PATCH] ArmPkg/AArch64Mmu: use correct AP[] bits in ArmClearMemoryRegionReadOnly X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Ard Biesheuvel MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" The function ArmClearMemoryRegionReadOnly() was supposed to undo the effect of ArmSetMemoryRegionReadOnly(), but instead, it sets the permissions to EL0-no access, EL1-read-only. Since the EL0 bit should be 1 to align with EL2/3 (where the bit is SBO), use TT_AP_RW_RW instead, which makes the entry read-write for EL0 when executing at EL1, and read-write for all other levels. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel --- ArmPkg/Library/ArmLib/AArch64/AArch64Mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.5.0 _______________________________________________ edk2-devel mailing list edk2-devel@lists.01.org https://lists.01.org/mailman/listinfo/edk2-devel Reviewed-by: Leif Lindholm diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Mmu.c b/ArmPkg/Library/ArmLib/AArch64/AArch64Mmu.c index f967a6478840..b7d23c6f3286 100644 --- a/ArmPkg/Library/ArmLib/AArch64/AArch64Mmu.c +++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Mmu.c @@ -558,7 +558,7 @@ ArmClearMemoryRegionReadOnly ( return SetMemoryRegionAttribute ( BaseAddress, Length, - TT_AP_NO_RO, + TT_AP_RW_RW, ~(TT_ADDRESS_MASK_BLOCK_ENTRY | TT_AP_MASK)); }