From patchwork Fri Jan 4 18:04:31 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 154789 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp893271ljp; Fri, 4 Jan 2019 10:22:11 -0800 (PST) X-Google-Smtp-Source: ALg8bN6mdmwosD+3zqH8nHir5MMKHK/6D+39407/XLkLLImyCa3X2ZnvVGwCscvxYGMVFBovPtZV X-Received: by 2002:a17:902:24d:: with SMTP id 71mr50359303plc.225.1546626130960; Fri, 04 Jan 2019 10:22:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546626130; cv=none; d=google.com; s=arc-20160816; b=J+7t6lyCX1AXZv5R4IfFwF5/N7UwPG6jeWzhkYwgcoqssJuEm8lrIZdMLwxSmHpYNX gcK9G7PLDWrAVHZoOamGHPCwChRhXnwbqvhl07qWr4SoggvMHJY2r7m8ovZShWUGQ/+6 kHifNBrlBrw52A8diOpjZuKPA83xrmyUC3kb2+tR7ZWIhmxhVHJoVEP+R718hp/9JEOV LcwNZZTCgtXv5MMpoX+Ia0Vq/YF5rDaHBP7eJIXsY69W9GlJ47BrIcEkqVT4nsw/xUtI wPWKA4JinxLvRwY+FN/IfBLjwcxWROHWVqUWp2+e9D9UMe6GehK0pZN9+G+yLT0Vl3yy XtBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:message-id:date:to:from:dkim-signature :delivered-to; bh=lsZgV1V3nXxHaAvti/j3MGikoPgUN9bJV7H4x/q4NH4=; b=QQdVsylDGfB7Qpt4dqGMZ0gSR1lhvpt/ACYpMwgMZQUa6ywdDvWGet2bnmmtFPwyq6 YuBwICVNhNzo0zfQFBQK3+2V+KCoHvrG058ReC39jhk7cMT1YvSfqTQrXxakODcW4W92 TIOirxOJqApIo0rQCUDvZNmTj5X5gGTrb30PuaiBOJmDe1N6NOMYamH13hT6Rl/k2Mb7 lyMcx8ZrnIUE3P4XkpN8VBOzFtbjimCcvD8Vbn6wYAqydSSIeP6tvdHM40q4AKlaXBoV dRa+zrvD34J8trYk0DeYqShDwT17YsKwjMCiIqb54L1jRYblqJdfOg3ogAWTjFcE0jeZ Iw6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="D9TRq/XA"; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from ml01.01.org (ml01.01.org. [2001:19d0:306:5::1]) by mx.google.com with ESMTPS id k12si350132pgg.382.2019.01.04.10.22.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 10:22:10 -0800 (PST) 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; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b="D9TRq/XA"; 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; 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 A0DA0211AEA64; Fri, 4 Jan 2019 10:22:08 -0800 (PST) X-Original-To: edk2-devel@lists.01.org Delivered-To: edk2-devel@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=2a00:1450:4864:20::543; helo=mail-ed1-x543.google.com; envelope-from=ard.biesheuvel@linaro.org; receiver=edk2-devel@lists.01.org Received: from mail-ed1-x543.google.com (mail-ed1-x543.google.com [IPv6:2a00:1450:4864:20::543]) (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 02CCF211AEA4B for ; Fri, 4 Jan 2019 10:05:03 -0800 (PST) Received: by mail-ed1-x543.google.com with SMTP id f9so32485808eds.10 for ; Fri, 04 Jan 2019 10:05:03 -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; bh=2PZh6TDEspZL2y1eli6CiAKGUOrFbdn8KwnQnFwcJH4=; b=D9TRq/XAFr8FJUQHHY3IDs/vXBpeQwisrHatXzFqkkX5OL/Q/ReXPtasZAhTa3TVoM mg1M+rhLc48Z4AHL2KzEotU7alBVZjYu13VQQbg1iALvNiNfqVqZUpCmAZ2HCvDlUUpQ ZNUVF13v6LKHeASWIE5CrgqyJcW3iaVoWbLmk= 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; bh=2PZh6TDEspZL2y1eli6CiAKGUOrFbdn8KwnQnFwcJH4=; b=KfxHBMdtBkgIDkFhyXplcFb5s6jfr9NuY0TQQ2nQmtHZ+VwxOeDueTOcjyGxWIwwNa lUYYk21mFlIK03onljpuP1PYjAPkHrLwV6aqGwaiJo0mBNEWCLrZJjo7zyuXNAIF3tq3 01GovG2IYOoKCuaCw9DRsUzlg61aoFMQaEm4V/3+0WDzkqtn/A/WtYfzCNuYjQH8ErRO Js5d8sOMDg2D83pTaPEjx8JofXFF0oL2spzcONO9LapBtnHChTjf4jjvpT0CzlQ9Fzbf p9npbi6Vn09P5hf+99Pu5wnr+AGNDZWUaAq9bxpzs7aCJ1Qd5DlC++MA3QVG9p4aZC5d f4jw== X-Gm-Message-State: AA+aEWbQSBc0Jbpc0EwbYKguerncEMPRNNkNRa5hveU130n8oF2qQlja IYNOJBXBvpSS7SYHJaCSNzHU7S+XUbh8Gg== X-Received: by 2002:a17:906:a984:: with SMTP id jr4-v6mr38880526ejb.90.1546625101570; Fri, 04 Jan 2019 10:05:01 -0800 (PST) Received: from dogfood.home ([2a01:cb1d:112:6f00:183a:9013:d5a3:37a8]) by smtp.gmail.com with ESMTPSA id t26sm26038977eda.22.2019.01.04.10.05.00 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Jan 2019 10:05:00 -0800 (PST) From: Ard Biesheuvel To: edk2-devel@lists.01.org Date: Fri, 4 Jan 2019 19:04:31 +0100 Message-Id: <20190104180432.24480-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 Subject: [edk2] [PATCH 1/2] ArmPkg/ArmMmuLib ARM: add missing support for non-shareable cached mappings X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: edk2-devel-bounces@lists.01.org Sender: "edk2-devel" We introduced support for non-shareable cached mappings to the AArch64 version of ArmMmuLib a while ago, but the ARM version was left behind, so fix it. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Ard Biesheuvel --- ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) -- 2.17.1 _______________________________________________ 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/ArmMmuLib/Arm/ArmMmuLibCore.c b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c index 889b22867dc7..b237321a8d8b 100644 --- a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c +++ b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c @@ -135,6 +135,11 @@ PopulateLevel2PageTable ( case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_BACK: PageAttributes = TT_DESCRIPTOR_PAGE_WRITE_BACK; break; + case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_NONSHAREABLE: + case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_BACK_NONSHAREABLE: + PageAttributes = TT_DESCRIPTOR_PAGE_WRITE_BACK; + PageAttributes &= ~TT_DESCRIPTOR_PAGE_S_SHARED; + break; case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_THROUGH: case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_THROUGH: PageAttributes = TT_DESCRIPTOR_PAGE_WRITE_THROUGH; @@ -239,6 +244,10 @@ FillTranslationTable ( case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK: Attributes = TT_DESCRIPTOR_SECTION_WRITE_BACK(0); break; + case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_BACK_NONSHAREABLE: + Attributes = TT_DESCRIPTOR_SECTION_WRITE_BACK(0); + Attributes &= ~TT_DESCRIPTOR_SECTION_S_SHARED; + break; case ARM_MEMORY_REGION_ATTRIBUTE_WRITE_THROUGH: Attributes = TT_DESCRIPTOR_SECTION_WRITE_THROUGH(0); break; @@ -251,6 +260,10 @@ FillTranslationTable ( case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_BACK: Attributes = TT_DESCRIPTOR_SECTION_WRITE_BACK(1); break; + case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_BACK_NONSHAREABLE: + Attributes = TT_DESCRIPTOR_SECTION_WRITE_BACK(1); + Attributes &= ~TT_DESCRIPTOR_SECTION_S_SHARED; + break; case ARM_MEMORY_REGION_ATTRIBUTE_NONSECURE_WRITE_THROUGH: Attributes = TT_DESCRIPTOR_SECTION_WRITE_THROUGH(1); break;