From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f65.google.com (mail-wr1-f65.google.com [209.85.221.65]) by mx.groups.io with SMTP id smtpd.web09.943.1583425789616376306 for ; Thu, 05 Mar 2020 08:29:49 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=hAPJ1tOf; spf=pass (domain: nuviainc.com, ip: 209.85.221.65, mailfrom: leif@nuviainc.com) Received: by mail-wr1-f65.google.com with SMTP id r7so7816241wro.2 for ; Thu, 05 Mar 2020 08:29:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=hSDI2Xx+UI0RkgxT7N8z2VSLJM7ykZy9Qs6YDJBXOXo=; b=hAPJ1tOfkFFwMWL+0iLJ+uUS6V/3smZAfEVnGkWDS6OeCKjkbwl28NY7spwzTR0s6/ 60Aog+a1b6b9VbGUag9l489dYJy+wn41rJxM/ImEX174kF7NlD/vuG7TJq7fdUnJUDfV wGVP381N22C+qfGc1mwfHChzJBah7sT9ReRioge3yJuVzYGpkCU3TxEsDCqfN+bMOugi AwERfQNdh65AAob4KY1FvWdbtIqGJm8mkAKa51Kye4BYmq2xbCc5uGjf3o12AIIOhFq2 TRxlxtHQL+kvt6uXYZlclitmeTWv7LrK7mDPWlyIs5MtjkZHBnQhMLyLYz1abT6Z5opL tJ0Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=hSDI2Xx+UI0RkgxT7N8z2VSLJM7ykZy9Qs6YDJBXOXo=; b=owOg/Oa/MUiYffmOW3KbiNS/ztHE6lIDk0537iTMpiHKNBwJftuEGX6Gg60RooNcgi seQ184XvR0OhbFjpcQDyQpFTbCzqWfFnAcKqpO/32oWDLMp9NCCIM8NTXKs98QB5jNMI Xdyp4w7V6LDa2OMQdACSQmjVC0/Qv+eYm5hTI6Mvxv/X17vCCujPOO10UYm2MP2NshqW QnnfWUR48C9evD+LfQP+LyRkUp3IT8zpymBISHrsmCKVeerR5DATSXZqwFkMmcIRuxwH 54vur2FIYel1z9f+LMIEHksa5pmKbTWTHYgTJmAZV5TUsfa93mCNbLX5GDtHA9+/NfAd lnDA== X-Gm-Message-State: ANhLgQ3a73TeMbjQCtkZLpepIfQngpvaSq8s3NvlnwlGGFvIsxMnUcR8 jvoecGoQlabFmPm0Or7+VJjVnw== X-Google-Smtp-Source: ADFU+vsHHO605xCqEfxGJvOQvsgFQSHUmTK1fyUishleVzKl7LuqWGRYJ9PrxTAkNNesk7kOpuSKnw== X-Received: by 2002:a5d:6082:: with SMTP id w2mr11039265wrt.300.1583425788195; Thu, 05 Mar 2020 08:29:48 -0800 (PST) Return-Path: Received: from bivouac.eciton.net (bivouac.eciton.net. [2a00:1098:0:86:1000:23:0:2]) by smtp.gmail.com with ESMTPSA id x17sm5017091wrt.31.2020.03.05.08.29.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Mar 2020 08:29:47 -0800 (PST) Date: Thu, 5 Mar 2020 16:29:46 +0000 From: "Leif Lindholm" To: Ard Biesheuvel Cc: devel@edk2.groups.io Subject: Re: [PATCH v2 0/9] ArmPkg: eradicate and deprecate by set/way cache ops Message-ID: <20200305162946.GA23627@bivouac.eciton.net> References: <20200304181246.23513-1-ard.biesheuvel@linaro.org> MIME-Version: 1.0 In-Reply-To: <20200304181246.23513-1-ard.biesheuvel@linaro.org> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Mar 04, 2020 at 19:12:37 +0100, Ard Biesheuvel wrote: > 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 Apart from the minor nit pointed out (which you can fix before committing) - for the series: Reviewed-by: Leif Lindholm Thanks! > 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 >