From nobody Wed Oct 16 01:59:56 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+105092+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+105092+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=kernel.org ARC-Seal: i=1; a=rsa-sha256; t=1684574411; cv=none; d=zohomail.com; s=zohoarc; b=jlJBYsGEWxMtEQVQxFB4DENTbRp1Jxt48D0tOKzVcHqiY5XCdIui7+bCGlicehy2Rx1f8zHVth+pyWBz8aEW8Uk3Xfys4MK4vbkYb7sFAi+H+Mo1tAMJ8PeWWHQXVHZPGPzZxMJKCiRuTkcJ8n2zFZzaG3/lB4Z1zhnh5l11Gz0= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1684574411; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=HWSfM0oxL9cmgfEmFV5S/k0GKAoDNF9US91oDPmqrpk=; b=O6iVTwrjRyE43gyrLMOz9MlVBbEGdJwOXvWHqXgsWGHRzXBtKttum3+0P6e2Lf2WsOVzy/BpNT5/3i2J1MXj89ZHG7x5YpaW9/0Z7aDTg/4Wp27N0xxzvbh22B1/j6oCf+P40i8pDzFXF1UybBcT/cKZo/wJbyx07UW4e5ThQZo= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+105092+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1684574411165147.63356209562278; Sat, 20 May 2023 02:20:11 -0700 (PDT) Return-Path: X-Received: by 127.0.0.2 with SMTP id iSPzYY1788612x6zLSHX7iYo; Sat, 20 May 2023 02:20:10 -0700 X-Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web10.7458.1684574410057064107 for ; Sat, 20 May 2023 02:20:10 -0700 X-Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 6856D60F95; Sat, 20 May 2023 09:20:09 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 66D0FC433D2; Sat, 20 May 2023 09:20:07 +0000 (UTC) From: "Ard Biesheuvel" To: devel@edk2.groups.io Cc: Ard Biesheuvel , Liming Gao , Leif Lindholm , Michael D Kinney , Oliver Steffen Subject: [edk2-devel] [PATCH edk2-stable202305] ArmPkg/ArmMmuLib: Add missing ISB after page table update Date: Sat, 20 May 2023 11:19:58 +0200 Message-Id: <20230520091958.310712-1-ardb@kernel.org> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: List-Subscribe: List-Help: 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,ardb@kernel.org X-Gm-Message-State: YXQ8bCgrleadcx9AflIIiKDRx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1684574410; bh=aoiE3q6jDVdlf0oyQuSxVyNceclcgMNSZZImiE5eaiM=; h=Cc:Date:From:Reply-To:Subject:To; b=CfftGjEVlRG2WusAM1qC0YSE2EzKO0aQMWVPAJbXtUlZocKdeZTnt4KEtgVWJzzjP4y utcYoWhwXpW9GzKQ8Wsn6ml+ukcOrkySYWULodmNqp6UyftXx9Zv1fsYXm1vkvW1r5B58 2CaYFSlPrlAwReuftNGOL0dR1VaWu1LwUWM= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1684574412168100001 Content-Type: text/plain; charset="utf-8" The helper that updates live page table entries writes a zero entry, invalidates the covered address range from the TLBs, and finally writes the actual entry. This ensures that no TLB conflicts can occur. Writing the final entry needs to complete before any translations can be performed, as otherwise, the zero entry, which describes an invalid translation, may be observed by the page table walker, resulting in a translation fault. For this reason, the final write is followed by a DSB barrier instruction. However, this barrier will not stall the pipeline, and instruction fetches may still hit this invalid translation, as has been observed and reported by Oliver. To ensure that the new translation is fully active before returning from this helper, we have to insert an ISB barrier as well. Cc: Liming Gao Cc: Leif Lindholm Cc: Michael D Kinney Reported-by: Oliver Steffen Tested-by: Oliver Steffen Signed-off-by: Ard Biesheuvel Acked-by: Michael D Kinney Reviewed-by: Leif Lindholm --- ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S | 1 + 1 file changed, 1 insertion(+) diff --git a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S b/Arm= Pkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S index 887439bc042f0f16..1f0d8057926933d7 100644 --- a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S +++ b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S @@ -65,6 +65,7 @@ // write updated entry str x1, [x0] dsb nshst + isb =20 .L2_\@: .endm --=20 2.39.2 -=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 (#105092): https://edk2.groups.io/g/devel/message/105092 Mute This Topic: https://groups.io/mt/99027974/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-