From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oi1-f193.google.com (mail-oi1-f193.google.com [209.85.167.193]) by mx.groups.io with SMTP id smtpd.web12.15672.1583345574354704891 for ; Wed, 04 Mar 2020 10:12:54 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@linaro.org header.s=google header.b=cplFQH2E; spf=pass (domain: linaro.org, ip: 209.85.167.193, mailfrom: ard.biesheuvel@linaro.org) Received: by mail-oi1-f193.google.com with SMTP id v19so3013092oic.12 for ; Wed, 04 Mar 2020 10:12:54 -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=4Hd0qP7Kiupkc+7qqQi6NaYKjU+PNWy+gHNIrDH0XWo=; b=cplFQH2EV03ZA0jYs0q9Pz9Fp3G1IsDFFJpkPMw7PhN7D6Qu8vfhH4Lsw6yeMv1CBR fy0t5tBZxSmaAoGsDJGNIXiNqHasJiwN20PCUD9uW1e5XGOzb1Vg0TzBlUvcWA31DvEM hqNBU6I7d8LKzbSGUtKOzUd4FSK+b3zX8E96oeoSQF2W84UEP5Dyer48R7/zvakwwirh jjXBN91eULG8p5QEQNWC7VYGYDmKZY6d/zb3CW19GLeMpeIfq8gCntpyOSndw8jXHbIi gjHY/yRkxYOdo26SWmkZ+aLHD2YYir5gYWuMxYveAivhvEATGx0qlZimcotlIXjpTjwX 2pZg== 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=4Hd0qP7Kiupkc+7qqQi6NaYKjU+PNWy+gHNIrDH0XWo=; b=or4q4b1ZSHtP1An0dqrYYx6Uxy0SEDOCe2fpAS2GgfKdejk09Z30rR0Xk79ItvErrg rZNeGMMyrTpmgQZRCKu27UnyBTEa5TYQIDXnglgPEDug4iMhpaAlvEBNLf+/iPyLC5lf z1SsrgoGJwHycIt98iSPfXENoLVxvJpE92exdu2KxNssju0UHoufU3JEvnXLGqMpvJfp PyrKqfk9V/Rfvmw3pW6gFPu1iBO4kXKSCHIeLHrXi0TTh5BQzqYElYxcL1V1Naer9Owx /hm2P1V8uLwSJn1tXCgcZEZIiw+7/eGRRdoFuze294Z590r17qaRQb8wkaOmR4yxhf3H LLZQ== X-Gm-Message-State: ANhLgQ11E5yW2YLe0P0SYMTZ7PzXg17h97kQWWJYsY0cwFCT9dp9mxgV 1zZPwPc07xWWmObp6Z+UNHH0JgRwfNXDVA== X-Google-Smtp-Source: ADFU+vvEhHl7aJFIVwn/pAquopYgV6ARlJnFwt6lo0cggg5QEswJnzByOM94kOfIHCwCnd4fzw3/zg== X-Received: by 2002:a54:4585:: with SMTP id z5mr1357428oib.149.1583345573198; Wed, 04 Mar 2020 10:12:53 -0800 (PST) Return-Path: Received: from cam-smtp0.cambridge.arm.com ([2a01:cb1d:112:6f00:816e:ff0d:fb69:f613]) by smtp.gmail.com with ESMTPSA id p65sm9083971oif.47.2020.03.04.10.12.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 04 Mar 2020 10:12:52 -0800 (PST) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: leif@nuviainc.com, Ard Biesheuvel Subject: [PATCH v2 0/9] ArmPkg: eradicate and deprecate by set/way cache ops Date: Wed, 4 Mar 2020 19:12:37 +0100 Message-Id: <20200304181246.23513-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.17.1 This is a combination of v1 'ArmPkg: eradicate and deprecate by set/way cache ops' and v1 'ArmPkg/ArmLib: ASSERT() on misuse of set/way ops' As it turns out, there were still some instances of set/way ops left in the core code, in ArmMmuLib to be precise. This series fixes ArmMmuLib to perform the appropriate cache invalidation when populating page tables with the MMU and caches off, allowing us to get rid of the cache clean/disable/enable sequences which are incorrect and pointless at the same time. I have incorporated some ArmLib changes that I posted separately before, with the end result being that all uses pf set/way ops are gone from the EDK2 core code, and the routines themselves will now ASSERT() when used for anything other than managing the caches while the MMU is still off. (Note that BeagleBoard in edk2-platforms still relies on this) Changes since v1[s]: - don't deprecate the set/way ops but make the usable before MMU is enabled only - use a more elaborate sequence for invalidating the page table entries on 32-bit ARM, to ensure we are compliant with the nooks and crannies of version 7 of the architecture. - incorporate patch #1, which was still pending on the list, and is related (its PrePeiCore sibling was already reviewed and merged) Ard Biesheuvel (9): ArmPlatformPkg/PrePi: replace set/way cache ops with by-VA ones ArmPkg/ArmMmuLib ARM: remove dummy constructor ArmPkg/ArmMmuLib ARM: split ArmMmuLibCore.c into core and update code ArmPkg/ArmMmuLib ARM: cache-invalidate initial page table entries ArmPkg/ArmMmuLib AARCH64: cache-invalidate initial page table entries ArmPkg/ArmLib: move set/way helper functions into private header ArmPkg/ArmLib: clean up library includes ArmPkg/ArmLib: remove bogus protocol declaration ArmPkg/ArmLib: ASSERT on set/way cache ops being used with MMU on ArmPkg/Include/Library/ArmLib.h | 18 - ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c | 16 +- ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h | 18 + ArmPkg/Library/ArmLib/AArch64/ArmLibSupport.S | 9 +- ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c | 17 +- ArmPkg/Library/ArmLib/Arm/ArmV7Lib.h | 18 + ArmPkg/Library/ArmLib/ArmBaseLib.inf | 6 +- ArmPkg/Library/ArmLib/ArmLib.c | 2 - .../Library/ArmMmuLib/AArch64/ArmMmuLibCore.c | 9 - .../Library/ArmMmuLib/Arm/ArmMmuLibConvert.c | 32 ++ ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibCore.c | 498 ++---------------- .../Library/ArmMmuLib/Arm/ArmMmuLibUpdate.c | 435 +++++++++++++++ ArmPkg/Library/ArmMmuLib/ArmMmuBaseLib.inf | 4 + ArmPlatformPkg/PrePi/PeiMPCore.inf | 1 + ArmPlatformPkg/PrePi/PeiUniCore.inf | 1 + ArmPlatformPkg/PrePi/PrePi.c | 8 +- 16 files changed, 591 insertions(+), 501 deletions(-) create mode 100644 ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibConvert.c create mode 100644 ArmPkg/Library/ArmMmuLib/Arm/ArmMmuLibUpdate.c -- 2.17.1