From nobody Tue Feb 10 00:39:32 2026 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) client-ip=66.175.222.12; envelope-from=bounce+27952+55521+1787277+3901457@groups.io; helo=web01.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55521+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1583413161; cv=none; d=zohomail.com; s=zohoarc; b=F9f+vkMaiwxyMA6idBhxB+1CyK5Wr67aS2pcskjWwtDJP/6WY8tnMPjPdt0Zx4sM9naXvUdlyI4Yi14noej2IRHPq8lDivmz19Xg6xJ+mXMCtN5j/tHcV2QhLQHqF3MI7k8Sm4OBO7AQ+HlAurSJ1vmPI1ZjzcR89dcb4OSkAt0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1583413161; h=Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:Message-ID:Reply-To:References:Sender:Subject:To; bh=slCV9bS1fUpNKBhu6wLlTGD2MGsvtEC59ONLgIwDc2E=; b=YvH26G+iygaOZRdhr/X1Hp4+G8vv7Eah710PMHiAT0t5B+jbhUxQ02Y7k7sgmeHQNRI3LWAu9O917KLwzMs0jc2k4Tb0bFJK0F9z72c/BsXYSjrs/2srm+aL4bjDyy4ymaFFIbM40X8FacfFzEqZPFDlGgrd46FMwmeIU+tcEUM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.12 as permitted sender) smtp.mailfrom=bounce+27952+55521+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) header.from= Received: from web01.groups.io (web01.groups.io [66.175.222.12]) by mx.zohomail.com with SMTPS id 1583413161141192.2212805726872; Thu, 5 Mar 2020 04:59:21 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id d433YY1788612xw6JLL7XBjh; Thu, 05 Mar 2020 04:59:20 -0800 X-Received: from mail-wm1-f68.google.com (mail-wm1-f68.google.com [209.85.128.68]) by mx.groups.io with SMTP id smtpd.web09.11908.1583413159967430933 for ; Thu, 05 Mar 2020 04:59:20 -0800 X-Received: by mail-wm1-f68.google.com with SMTP id a5so6205337wmb.0 for ; Thu, 05 Mar 2020 04:59:19 -0800 (PST) X-Gm-Message-State: IR8Tuh5XxbIZFJvLam5tFcOZx1787277AA= X-Google-Smtp-Source: ADFU+vvVbc9+REWlApIscg955oFNcRH8M0pAKN7bodosjbnldrdjF8Mq/2zz2nkZwHel9OTBK2lkgA== X-Received: by 2002:a1c:7ed0:: with SMTP id z199mr10075736wmc.52.1583413158167; Thu, 05 Mar 2020 04:59:18 -0800 (PST) X-Received: from e123331-lin.home ([2a01:cb1d:112:6f00:816e:ff0d:fb69:f613]) by smtp.gmail.com with ESMTPSA id v8sm43019476wrw.2.2020.03.05.04.59.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2020 04:59:17 -0800 (PST) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: leif@nuviainc.com, Ard Biesheuvel Subject: [edk2-devel] [PATCH 2/2] ArmPkg/ArmMmuLib ARM: drop memory type check for page tables Date: Thu, 5 Mar 2020 13:59:07 +0100 Message-Id: <20200305125907.13680-3-ard.biesheuvel@linaro.org> In-Reply-To: <20200305125907.13680-1-ard.biesheuvel@linaro.org> References: <20200305125907.13680-1-ard.biesheuvel@linaro.org> Precedence: Bulk List-Unsubscribe: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Reply-To: devel@edk2.groups.io,ard.biesheuvel@linaro.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1583413160; bh=xUCQytEhFgIgmyo5U8UqxluCX1A/lk9BbIGjIu0J2VA=; h=Cc:Date:From:Reply-To:Subject:To; b=YwyHVAEYFbzOqOF7q/4RWO3NNcXeav+Xw22lacIxrFirCmLQw3lXy8lY/Y56UQWAtsb xlsuLlC/jA/xT6hKvuVbplw+SP9Wmr6i0tIBJHKr6tqRxksX5P4JdowWj8+wJ+RY7xgYi PuuHaFV4j/0RKzkviDCqsUlIlvhFeyg0QNU= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We already expect normal memory to be mapped writeback cacheable if EDK2 itself is to make use of it, so doing an early sanity check on the memory type of the allocation that the page tables happened to land in isn't very useful. So let's drop it. Signed-off-by: Ard Biesheuvel --- ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c b/ArmPkg/Library/= ArmMmuLib/Arm/ArmMmuLibCore.c index a6f44dbd5f21..15e836e75e8e 100644 --- a/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c +++ b/ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c @@ -328,7 +328,6 @@ ArmConfigureMmu ( ) { VOID *TranslationTable; - ARM_MEMORY_REGION_ATTRIBUTES TranslationTableAttribute; UINT32 TTBRAttributes; =20 TranslationTable =3D AllocateAlignedPages ( @@ -353,28 +352,13 @@ ArmConfigureMmu ( InvalidateDataCacheRange (TranslationTable, TRANSLATION_TABLE_SECTION_SI= ZE); ZeroMem (TranslationTable, TRANSLATION_TABLE_SECTION_SIZE); =20 - // By default, mark the translation table as belonging to a uncached reg= ion - TranslationTableAttribute =3D ARM_MEMORY_REGION_ATTRIBUTE_UNCACHED_UNBUF= FERED; while (MemoryTable->Length !=3D 0) { - // Find the memory attribute for the Translation Table - if (((UINTN)TranslationTable >=3D MemoryTable->PhysicalBase) && ((UINT= N)TranslationTable <=3D MemoryTable->PhysicalBase - 1 + MemoryTable->Length= )) { - TranslationTableAttribute =3D MemoryTable->Attributes; - } - FillTranslationTable (TranslationTable, MemoryTable); MemoryTable++; } =20 - // Translate the Memory Attributes into Translation Table Register Attri= butes - if ((TranslationTableAttribute =3D=3D ARM_MEMORY_REGION_ATTRIBUTE_WRITE_= BACK) || - (TranslationTableAttribute =3D=3D ARM_MEMORY_REGION_ATTRIBUTE_NONSEC= URE_WRITE_BACK)) { - TTBRAttributes =3D ArmHasMpExtensions () ? TTBR_MP_WRITE_BACK_ALLOC : = TTBR_WRITE_BACK_ALLOC; - } else { - // Page tables must reside in memory mapped as write-back cacheable - ASSERT (0); - return RETURN_UNSUPPORTED; - } - + TTBRAttributes =3D ArmHasMpExtensions () ? TTBR_MP_WRITE_BACK_ALLOC + : TTBR_WRITE_BACK_ALLOC; if (TTBRAttributes & TTBR_SHAREABLE) { if (PreferNonshareableMemory ()) { TTBRAttributes ^=3D TTBR_SHAREABLE; --=20 2.17.1 -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#55521): https://edk2.groups.io/g/devel/message/55521 Mute This Topic: https://groups.io/mt/71748691/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-