From nobody Mon May 6 22:10:48 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+69197+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+69197+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1608301002; cv=none; d=zohomail.com; s=zohoarc; b=H5EllFILHHReRYquAxewJuJZ8WSOvjzikGDSBD+ePKdH8oP4JwMdV5d5I6ic8J1BrGmoqIl2Ba752R6l8i0BPC2dgP2UusREelNXQD0O7qigDRvYAx5l6J8g+F5CJk6EdkCgpi8IWUlpLSEa4fw3G/KoiV6zrNURjUHtw2FHTnE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608301002; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=K8VxZJW9KthsD/M4FbYBS8xWkAdQp7L/dazQNLvuwvE=; b=EucMEBRQjAj8/66PGjPKf1wK+zypZ6m9J50cppu4+tGGikx98gw7DntKi5HdCrZK/BdzwiSSipam9ThKzHSJ8IajhwU1sHTEve8oPyrfqjHHqE5KgukkpSlvlEQoMUmHn9QG+CHT9VJCsWvjV1J7A3gNjcEsb8PwQE60DDn65DY= 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+69197+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 160830100274781.87766563028083; Fri, 18 Dec 2020 06:16:42 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 0GymYY1788612xVCA8928gyl; Fri, 18 Dec 2020 06:16:41 -0800 X-Received: from mail-wr1-f52.google.com (mail-wr1-f52.google.com [209.85.221.52]) by mx.groups.io with SMTP id smtpd.web11.10539.1608300981232356330 for ; Fri, 18 Dec 2020 06:16:21 -0800 X-Received: by mail-wr1-f52.google.com with SMTP id 91so2335062wrj.7 for ; Fri, 18 Dec 2020 06:16:21 -0800 (PST) X-Gm-Message-State: a85upKNG7uT2BxAG6km9M9U5x1787277AA= X-Google-Smtp-Source: ABdhPJym+4cZCQTw81pAWmwUmrLykEy9Nhnfcxyc4wU6RCS16XscGk92Dq6adhc9QLR+5o75SGQJtQ== X-Received: by 2002:a5d:5049:: with SMTP id h9mr4954342wrt.404.1608300979527; Fri, 18 Dec 2020 06:16:19 -0800 (PST) X-Received: from vanye.hemma.eciton.net (cpc1-cmbg19-2-0-cust915.5-4.cable.virginm.net. [82.27.183.148]) by smtp.gmail.com with ESMTPSA id b12sm18558569wmj.2.2020.12.18.06.16.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Dec 2020 06:16:18 -0800 (PST) From: "Leif Lindholm" To: devel@edk2.groups.io Cc: Ard Biesheuvel Subject: [edk2-devel] [PATCH 1/9] ArmPkg/ArmLib: add ArmHasGicSystemRegisters () helper function Date: Fri, 18 Dec 2020 14:16:09 +0000 Message-Id: <20201218141617.26947-2-leif@nuviainc.com> In-Reply-To: <20201218141617.26947-1-leif@nuviainc.com> References: <20201218141617.26947-1-leif@nuviainc.com> MIME-Version: 1.0 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,leif@nuviainc.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1608301001; bh=+5lSPCVdM73x1OBbfierOrGjxF507vu09r9MdRJ2OIM=; h=Cc:Date:From:Reply-To:Subject:To; b=Gt8NCVhl5qoeOFNgXBbjvuROnbFThtWEdlZ9Getcs/gMG3iP/Pz6TaMH3Q/GK17SS+W j0QpitYIFLrw0ByMab6EqY+AnBSWK9I8iv7phO02Ankn2NyjzdBN8vOdi6pJH4AZBQc48 vC50dr+jdrzpsFt1fndxFCnZp1/+nks58b0= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Create a helper function to eliminate direct feature register reading, which gets messy in code shared between ARM/AArch64. Returns BOOLEAN True if the CPU implements the GIC System Register Interface (any version), otherwise returns BOOL False. Cc: Ard Biesheuvel Signed-off-by: Leif Lindholm Reviewed-by: Ard Biesheuvel --- ArmPkg/Include/Library/ArmLib.h | 18 ++++++++++++++++++ ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c | 16 ++++++++++++++++ ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c | 16 ++++++++++++++++ 3 files changed, 50 insertions(+) diff --git a/ArmPkg/Include/Library/ArmLib.h b/ArmPkg/Include/Library/ArmLi= b.h index 5a27b7c2fc27..8a364f2ca96f 100644 --- a/ArmPkg/Include/Library/ArmLib.h +++ b/ArmPkg/Include/Library/ArmLib.h @@ -2,6 +2,7 @@ =20 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
Copyright (c) 2011 - 2016, ARM Ltd. All rights reserved.
+ Copyright (c) 2020, NUVIA Inc. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -715,4 +716,21 @@ ArmGetPhysicalAddressBits ( VOID ); =20 + +/// +/// ID Register Helper functions +/// + +/** + Check whether the CPU supports the GIC system register interface (any ve= rsion) + + @return Whether GIC System Register Interface is supported + +**/ +BOOLEAN +EFIAPI +ArmHasGicSystemRegisters ( + VOID + ); + #endif // __ARM_LIB__ diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c b/ArmPkg/Library/Ar= mLib/AArch64/AArch64Lib.c index 3fbd591192e2..5b10eb33c97d 100644 --- a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c +++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c @@ -2,6 +2,7 @@ =20 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
Portions copyright (c) 2011 - 2014, ARM Ltd. All rights reserved.
+ Copyright (c) 2020, NUVIA Inc. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -71,3 +72,18 @@ ArmCleanDataCache ( ArmDataSynchronizationBarrier (); AArch64DataCacheOperation (ArmCleanDataCacheEntryBySetWay); } + +/** + Check whether the CPU supports the GIC system register interface (any ve= rsion) + + @return Whether GIC System Register Interface is supported + +**/ +BOOLEAN +EFIAPI +ArmHasGicSystemRegisters ( + VOID + ) +{ + return ((ArmReadIdPfr0 () & AARCH64_PFR0_GIC) !=3D 0); +} diff --git a/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c b/ArmPkg/Library/ArmLib/A= rm/ArmV7Lib.c index 2c4a23e1a1b2..3faada3a6539 100644 --- a/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c +++ b/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c @@ -2,6 +2,7 @@ =20 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
Copyright (c) 2011 - 2014, ARM Limited. All rights reserved. + Copyright (c) 2020, NUVIA Inc. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -71,3 +72,18 @@ ArmCleanDataCache ( ArmDataSynchronizationBarrier (); ArmV7DataCacheOperation (ArmCleanDataCacheEntryBySetWay); } + +/** + Check whether the CPU supports the GIC system register interface (any ve= rsion) + + @return Whether GIC System Register Interface is supported + +**/ +BOOLEAN +EFIAPI +ArmHasGicSystemRegisters ( + VOID + ) +{ + return ((ArmReadIdPfr1 () & ARM_PFR1_GIC) !=3D 0); +} --=20 2.20.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 (#69197): https://edk2.groups.io/g/devel/message/69197 Mute This Topic: https://groups.io/mt/79061631/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- From nobody Mon May 6 22:10:48 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+69198+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+69198+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1608301005; cv=none; d=zohomail.com; s=zohoarc; b=heSDMhfkWKDvwa0AX3G33N7nrc05V/x/JfAjDeTLlzlZQXPnHrmyNkPv7OugV+fWbmnJ36CbNlZXGFE3aj/GtTBCkSNRXj/psf1C5PjkQsg27acOJbWcuBeIa/+RSEwmp5biifyhe8vp+kGNm/OfTF2Db9GRih9/iZ9910a0TOs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608301005; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=CcIkKMXHPmK9Wv3xqJjuKI1d48yPxfuADi2MEMzHWNY=; b=StRfLExgh1FmYLHClHkAhM2moFu07+aTTzTnGc46Yrul8gCuV1HKPexy5bzWrbY6A/5Zh14CRmA5DSPPcQKTWQtQS1q3GMOql0LJrbnd6kcr0fQ5R+gg3yzCcFJ8i0BbV9S8wTJs58HGMsqFmcqeB+GrUAnedlvlhbGm95MN1Gs= 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+69198+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1608301004998265.8163022418661; Fri, 18 Dec 2020 06:16:44 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id ftdtYY1788612x1AAMEvVpBf; Fri, 18 Dec 2020 06:16:44 -0800 X-Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com [209.85.221.54]) by mx.groups.io with SMTP id smtpd.web10.10674.1608300982210845034 for ; Fri, 18 Dec 2020 06:16:22 -0800 X-Received: by mail-wr1-f54.google.com with SMTP id 91so2335114wrj.7 for ; Fri, 18 Dec 2020 06:16:21 -0800 (PST) X-Gm-Message-State: Xdp8PlI7uKTocHzWdUBL6yA2x1787277AA= X-Google-Smtp-Source: ABdhPJzKD98HAE9KsFFfd8JkDqPbAaEpgNL/+Jrt143iMJDIn2mFCD0MKwU9wYp8+ZBS4o1yzfuK8w== X-Received: by 2002:adf:828b:: with SMTP id 11mr4697917wrc.180.1608300980341; Fri, 18 Dec 2020 06:16:20 -0800 (PST) X-Received: from vanye.hemma.eciton.net (cpc1-cmbg19-2-0-cust915.5-4.cable.virginm.net. [82.27.183.148]) by smtp.gmail.com with ESMTPSA id b12sm18558569wmj.2.2020.12.18.06.16.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Dec 2020 06:16:19 -0800 (PST) From: "Leif Lindholm" To: devel@edk2.groups.io Cc: Ard Biesheuvel Subject: [edk2-devel] [PATCH 2/9] ArmPkg: use ID register helper for ArmGicArch(Sec)Lib Date: Fri, 18 Dec 2020 14:16:10 +0000 Message-Id: <20201218141617.26947-3-leif@nuviainc.com> In-Reply-To: <20201218141617.26947-1-leif@nuviainc.com> References: <20201218141617.26947-1-leif@nuviainc.com> MIME-Version: 1.0 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,leif@nuviainc.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1608301004; bh=CR+Yht+taKpQaBlY6A73ckAeK6zGPOl+nGT00q1tnTk=; h=Cc:Date:From:Reply-To:Subject:To; b=fNQbUXmKkqV1iXG9Fl/zyL6NFg93Y03fM8kedxSPjCRiMAfhsZ7G3+voiollsKZy49t fUn5gaw3armxqind8ixrQph9azyCkLvtaT2fea8X/AlSuMP5Ab1P7F9s5G8fbdPEsyLhV hTHSbS2aExDKomxYZtrJRE9WulQwijVb77I= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Use ArmHasGicSystemRegisters () instead of direct ID register tests. Cc: Ard Biesheuvel Signed-off-by: Leif Lindholm Reviewed-by: Ard Biesheuvel --- ArmPkg/Library/ArmGicArchLib/AArch64/ArmGicArchLib.c | 2 +- ArmPkg/Library/ArmGicArchLib/Arm/ArmGicArchLib.c | 2 +- ArmPkg/Library/ArmGicArchSecLib/AArch64/ArmGicArchLib.c | 2 +- ArmPkg/Library/ArmGicArchSecLib/Arm/ArmGicArchLib.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ArmPkg/Library/ArmGicArchLib/AArch64/ArmGicArchLib.c b/ArmPkg/= Library/ArmGicArchLib/AArch64/ArmGicArchLib.c index 4086a294dafd..6fd69658e0e5 100644 --- a/ArmPkg/Library/ArmGicArchLib/AArch64/ArmGicArchLib.c +++ b/ArmPkg/Library/ArmGicArchLib/AArch64/ArmGicArchLib.c @@ -25,7 +25,7 @@ ArmGicArchLibInitialize ( // feature is implemented on the CPU. This is also convenient as our GIC= v3 // driver requires SRE. If only Memory mapped access is available we try= to // drive the GIC as a v2. - if (ArmReadIdPfr0 () & AARCH64_PFR0_GIC) { + if (ArmHasGicSystemRegisters ()) { // Make sure System Register access is enabled (SRE). This depends on = the // higher privilege level giving us permission, otherwise we will eith= er // cause an exception here, or the write doesn't stick in which case w= e need diff --git a/ArmPkg/Library/ArmGicArchLib/Arm/ArmGicArchLib.c b/ArmPkg/Libr= ary/ArmGicArchLib/Arm/ArmGicArchLib.c index 222d8059825d..7e7e46e69faa 100644 --- a/ArmPkg/Library/ArmGicArchLib/Arm/ArmGicArchLib.c +++ b/ArmPkg/Library/ArmGicArchLib/Arm/ArmGicArchLib.c @@ -25,7 +25,7 @@ ArmGicArchLibInitialize ( // feature is implemented on the CPU. This is also convenient as our GIC= v3 // driver requires SRE. If only Memory mapped access is available we try= to // drive the GIC as a v2. - if (ArmReadIdPfr1 () & ARM_PFR1_GIC) { + if (ArmHasGicSystemRegisters ()) { // Make sure System Register access is enabled (SRE). This depends on = the // higher privilege level giving us permission, otherwise we will eith= er // cause an exception here, or the write doesn't stick in which case w= e need diff --git a/ArmPkg/Library/ArmGicArchSecLib/AArch64/ArmGicArchLib.c b/ArmP= kg/Library/ArmGicArchSecLib/AArch64/ArmGicArchLib.c index 4f2479e70c74..ca81951b2b2b 100644 --- a/ArmPkg/Library/ArmGicArchSecLib/AArch64/ArmGicArchLib.c +++ b/ArmPkg/Library/ArmGicArchSecLib/AArch64/ArmGicArchLib.c @@ -23,7 +23,7 @@ ArmGicGetSupportedArchRevision ( // feature is implemented on the CPU. This is also convenient as our GIC= v3 // driver requires SRE. If only Memory mapped access is available we try= to // drive the GIC as a v2. - if (ArmReadIdPfr0 () & AARCH64_PFR0_GIC) { + if (ArmHasGicSystemRegisters ()) { // Make sure System Register access is enabled (SRE). This depends on = the // higher privilege level giving us permission, otherwise we will eith= er // cause an exception here, or the write doesn't stick in which case w= e need diff --git a/ArmPkg/Library/ArmGicArchSecLib/Arm/ArmGicArchLib.c b/ArmPkg/L= ibrary/ArmGicArchSecLib/Arm/ArmGicArchLib.c index 8e1baeee201a..2373ca409a17 100644 --- a/ArmPkg/Library/ArmGicArchSecLib/Arm/ArmGicArchLib.c +++ b/ArmPkg/Library/ArmGicArchSecLib/Arm/ArmGicArchLib.c @@ -23,7 +23,7 @@ ArmGicGetSupportedArchRevision ( // feature is implemented on the CPU. This is also convenient as our GIC= v3 // driver requires SRE. If only Memory mapped access is available we try= to // drive the GIC as a v2. - if (ArmReadIdPfr1 () & ARM_PFR1_GIC) { + if (ArmHasGicSystemRegisters ()) { // Make sure System Register access is enabled (SRE). This depends on = the // higher privilege level giving us permission, otherwise we will eith= er // cause an exception here, or the write doesn't stick in which case w= e need --=20 2.20.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 (#69198): https://edk2.groups.io/g/devel/message/69198 Mute This Topic: https://groups.io/mt/79061634/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- From nobody Mon May 6 22:10:48 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+69199+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+69199+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1608300989; cv=none; d=zohomail.com; s=zohoarc; b=AiHQzDzo4aQjpENI0PNNeRxhbt+Js/ImDujpJVRk8bXFtMAYP/ldRDNnpkJTfFiUCpo/O+xNKRi3ElEN9bSI8PFVg5MLiOp4u6g5AXjILWmkDet2r+tqU3zudVy+kQvT/GAzKpaP1nrMa03XC+Unfz4XmVA83disLD1CCwReiUg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608300989; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Yy/bzoRRRceJZ1vrb8bDuoN8t3ofbN6ahXtgDVBsiMc=; b=l1QR8eOau7EYMTHZXvDl84jczaDaCWgkj2K7Olh54hGDS+z1VpY1n1jPJ1f6dqZWaTJi97tCOM+HfvLt8v2cp5eGYmjI5JCS806oevYaX9icRTrK+G68xntej8PH45JfX5104LUrJMYAvUisv90UTO/AJ8fELM+AD4nXALacOsM= 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+69199+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1608300988894243.00159489436442; Fri, 18 Dec 2020 06:16:28 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id M7UeYY1788612xQBQiPUbbzR; Fri, 18 Dec 2020 06:16:27 -0800 X-Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mx.groups.io with SMTP id smtpd.web08.10540.1608300982939752976 for ; Fri, 18 Dec 2020 06:16:23 -0800 X-Received: by mail-wm1-f52.google.com with SMTP id 3so2729628wmg.4 for ; Fri, 18 Dec 2020 06:16:22 -0800 (PST) X-Gm-Message-State: BFvye1Nwot4YqMxpl82iPGbrx1787277AA= X-Google-Smtp-Source: ABdhPJyLXsQbByPpWmPq5q8r+iQQ3lgzNZy/z3yw+1YPHU7f+ECNxuyiffrE0U2rzhc5TGxTXs1zNQ== X-Received: by 2002:a1c:6208:: with SMTP id w8mr4472557wmb.96.1608300981244; Fri, 18 Dec 2020 06:16:21 -0800 (PST) X-Received: from vanye.hemma.eciton.net (cpc1-cmbg19-2-0-cust915.5-4.cable.virginm.net. [82.27.183.148]) by smtp.gmail.com with ESMTPSA id b12sm18558569wmj.2.2020.12.18.06.16.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Dec 2020 06:16:20 -0800 (PST) From: "Leif Lindholm" To: devel@edk2.groups.io Cc: Ard Biesheuvel Subject: [edk2-devel] [PATCH 3/9] ArmPkg: remove duplicated ARM/AArch64 ArmGicArchLib sources Date: Fri, 18 Dec 2020 14:16:11 +0000 Message-Id: <20201218141617.26947-4-leif@nuviainc.com> In-Reply-To: <20201218141617.26947-1-leif@nuviainc.com> References: <20201218141617.26947-1-leif@nuviainc.com> MIME-Version: 1.0 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,leif@nuviainc.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1608300987; bh=/qRj56zTkPZAA35NPuyFfcwiIi9A8Hgut5zMHrG8ckI=; h=Cc:Date:From:Reply-To:Subject:To; b=c/l7KmlMeJKBmqCbfCecVoggiD1C5K3M3QXv4lm9F76U991Dk6ki2ki38yyxuyjSSHQ bF4TAiYF1pwL/wArMw0ETtFU+BZCjqW7yhVXMf2VVbLtgfxAdB7bw9UVkRklzH7N1DebN WUz9EHC1C57GqZ8IJUqSeLkYVEuk8i3CMRI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The ID register access was the only difference between them, so after switching to the ArmHasGicSystemRegisters () helper, there is no longer any need to have separate ARM/AArch64 source files for ArmGicArchLib, so unify them and drop the subdirectories. Cc: Ard Biesheuvel Signed-off-by: Leif Lindholm Reviewed-by: Ard Biesheuvel --- ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf | 7 +-- ArmPkg/Library/ArmGicArchLib/Arm/ArmGicArchLib.c | 60 ----------= ---------- ArmPkg/Library/ArmGicArchLib/{AArch64 =3D> }/ArmGicArchLib.c | 0 3 files changed, 2 insertions(+), 65 deletions(-) diff --git a/ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf b/ArmPkg/Librar= y/ArmGicArchLib/ArmGicArchLib.inf index 92ac11c2f5e5..bedddff93955 100644 --- a/ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf +++ b/ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf @@ -14,11 +14,8 @@ [Defines] LIBRARY_CLASS =3D ArmGicArchLib|DXE_DRIVER UEFI_DRIVER = UEFI_APPLICATION CONSTRUCTOR =3D ArmGicArchLibInitialize =20 -[Sources.ARM] - Arm/ArmGicArchLib.c - -[Sources.AARCH64] - AArch64/ArmGicArchLib.c +[Sources] + ArmGicArchLib.c =20 [Packages] MdePkg/MdePkg.dec diff --git a/ArmPkg/Library/ArmGicArchLib/Arm/ArmGicArchLib.c b/ArmPkg/Libr= ary/ArmGicArchLib/Arm/ArmGicArchLib.c deleted file mode 100644 index 7e7e46e69faa..000000000000 --- a/ArmPkg/Library/ArmGicArchLib/Arm/ArmGicArchLib.c +++ /dev/null @@ -1,60 +0,0 @@ -/** @file -* -* Copyright (c) 2014, ARM Limited. All rights reserved. -* -* SPDX-License-Identifier: BSD-2-Clause-Patent -* -**/ - -#include -#include - -STATIC ARM_GIC_ARCH_REVISION mGicArchRevision; - -RETURN_STATUS -EFIAPI -ArmGicArchLibInitialize ( - VOID - ) -{ - UINT32 IccSre; - - // Ideally we would like to use the GICC IIDR Architecture version here,= but - // this does not seem to be very reliable as the implementation could ea= sily - // get it wrong. It is more reliable to check if the GICv3 System Regist= er - // feature is implemented on the CPU. This is also convenient as our GIC= v3 - // driver requires SRE. If only Memory mapped access is available we try= to - // drive the GIC as a v2. - if (ArmHasGicSystemRegisters ()) { - // Make sure System Register access is enabled (SRE). This depends on = the - // higher privilege level giving us permission, otherwise we will eith= er - // cause an exception here, or the write doesn't stick in which case w= e need - // to fall back to the GICv2 MMIO interface. - // Note: We do not need to set ICC_SRE_EL2.Enable because the OS is st= arted - // at the same exception level. - // It is the OS responsibility to set this bit. - IccSre =3D ArmGicV3GetControlSystemRegisterEnable (); - if (!(IccSre & ICC_SRE_EL2_SRE)) { - ArmGicV3SetControlSystemRegisterEnable (IccSre| ICC_SRE_EL2_SRE); - IccSre =3D ArmGicV3GetControlSystemRegisterEnable (); - } - if (IccSre & ICC_SRE_EL2_SRE) { - mGicArchRevision =3D ARM_GIC_ARCH_REVISION_3; - goto Done; - } - } - - mGicArchRevision =3D ARM_GIC_ARCH_REVISION_2; - -Done: - return RETURN_SUCCESS; -} - -ARM_GIC_ARCH_REVISION -EFIAPI -ArmGicGetSupportedArchRevision ( - VOID - ) -{ - return mGicArchRevision; -} diff --git a/ArmPkg/Library/ArmGicArchLib/AArch64/ArmGicArchLib.c b/ArmPkg/= Library/ArmGicArchLib/ArmGicArchLib.c similarity index 100% rename from ArmPkg/Library/ArmGicArchLib/AArch64/ArmGicArchLib.c rename to ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.c --=20 2.20.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 (#69199): https://edk2.groups.io/g/devel/message/69199 Mute This Topic: https://groups.io/mt/79061635/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- From nobody Mon May 6 22:10:48 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+69200+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+69200+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1608300986; cv=none; d=zohomail.com; s=zohoarc; b=an8NSkG8RjxGkQ3dyIpNmPsKQ0dUntfXydiddLw+mL6GwDe/BDKsOH9VrXMOmw43MhL6JWDoSBevuTriCfXaiQWXxG7ckM7mMD0nJgANt22zMC59b7ztIsykNYe639/McrOuzZrMz6EHkGRAXvy9wdnMrLrf/HSSUSiZnB1/Q9o= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608300986; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=5KX4JSK8+iy1/4HHD3PopO/ez07S8aDjIVDJxDOfsqo=; b=dMfhZOgGDoSh0hifBCFSfFVpCHObn/x8urjs7Vg8bRBKjigOA3NE2XZnqV2UHphycpjVmUOyPSJmv+EVei3XNXKnOdxLxCvcUlzdNnfL+COI/NkVfestauzu1bboGs5li60LtJbWKpgzzGKoRkYIQ+Ee4qxoRWCVuQrqjt9QVAw= 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+69200+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1608300986406937.0241557537353; Fri, 18 Dec 2020 06:16:26 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id QQoVYY1788612xCioFfRnxea; Fri, 18 Dec 2020 06:16:24 -0800 X-Received: from mail-wm1-f48.google.com (mail-wm1-f48.google.com [209.85.128.48]) by mx.groups.io with SMTP id smtpd.web11.10542.1608300983726341717 for ; Fri, 18 Dec 2020 06:16:24 -0800 X-Received: by mail-wm1-f48.google.com with SMTP id x22so2471217wmc.5 for ; Fri, 18 Dec 2020 06:16:23 -0800 (PST) X-Gm-Message-State: zyrRM19dlf0TVFNILxP9qSaDx1787277AA= X-Google-Smtp-Source: ABdhPJwjmPRgpmUEWgIW6Aju9VWXXPg9Pcb2kVfRsCaYyL+H+GPTRkhUyrWayzf3hEktD3C5pw/ggg== X-Received: by 2002:a05:600c:214a:: with SMTP id v10mr4447227wml.138.1608300982041; Fri, 18 Dec 2020 06:16:22 -0800 (PST) X-Received: from vanye.hemma.eciton.net (cpc1-cmbg19-2-0-cust915.5-4.cable.virginm.net. [82.27.183.148]) by smtp.gmail.com with ESMTPSA id b12sm18558569wmj.2.2020.12.18.06.16.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Dec 2020 06:16:21 -0800 (PST) From: "Leif Lindholm" To: devel@edk2.groups.io Cc: Ard Biesheuvel Subject: [edk2-devel] [PATCH 4/9] ArmPkg: remove duplicated ARM/AArch64 ArmGicArchSecLib sources Date: Fri, 18 Dec 2020 14:16:12 +0000 Message-Id: <20201218141617.26947-5-leif@nuviainc.com> In-Reply-To: <20201218141617.26947-1-leif@nuviainc.com> References: <20201218141617.26947-1-leif@nuviainc.com> MIME-Version: 1.0 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,leif@nuviainc.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1608300984; bh=xWWhj+DmP65pXMHhBhOuWsKxI0CSQJNgpUh0JYldHt4=; h=Cc:Date:From:Reply-To:Subject:To; b=lib5z8MtjtrXTf4WJuAZ8pRA8JDFpG4wpaT3YfGoeAW/tUCTY+/MzjzgLYIOZU+C7Fa l/h5y3FHuoO9If3znF/wg9x3ah6vJTLxRvD9ZWvfi30tb6gB4FEd7sgURYDy46IeZLnM0 /Z2nIrpgOO8jPBvdMIVBhmmB07ZwNZ694OE= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The ID register access was the only difference between them, so after switching to the ArmHasGicSystemRegisters () helper, there is no longer any need to have separate ARM/AArch64 source files for ArmGicArchSecLib, so unify them and drop the subdirectories. Cc: Ard Biesheuvel Signed-off-by: Leif Lindholm Reviewed-by: Ard Biesheuvel --- ArmPkg/Library/ArmGicArchSecLib/ArmGicArchSecLib.inf | 7 +-- ArmPkg/Library/ArmGicArchSecLib/Arm/ArmGicArchLib.c | 45 -------= ------------- ArmPkg/Library/ArmGicArchSecLib/{AArch64 =3D> }/ArmGicArchLib.c | 0 3 files changed, 2 insertions(+), 50 deletions(-) diff --git a/ArmPkg/Library/ArmGicArchSecLib/ArmGicArchSecLib.inf b/ArmPkg/= Library/ArmGicArchSecLib/ArmGicArchSecLib.inf index 1a1179a98012..ccebabe451cc 100644 --- a/ArmPkg/Library/ArmGicArchSecLib/ArmGicArchSecLib.inf +++ b/ArmPkg/Library/ArmGicArchSecLib/ArmGicArchSecLib.inf @@ -13,11 +13,8 @@ [Defines] VERSION_STRING =3D 1.0 LIBRARY_CLASS =3D ArmGicArchLib|SEC =20 -[Sources.ARM] - Arm/ArmGicArchLib.c - -[Sources.AARCH64] - AArch64/ArmGicArchLib.c +[Sources] + ArmGicArchLib.c =20 [Packages] MdePkg/MdePkg.dec diff --git a/ArmPkg/Library/ArmGicArchSecLib/Arm/ArmGicArchLib.c b/ArmPkg/L= ibrary/ArmGicArchSecLib/Arm/ArmGicArchLib.c deleted file mode 100644 index 2373ca409a17..000000000000 --- a/ArmPkg/Library/ArmGicArchSecLib/Arm/ArmGicArchLib.c +++ /dev/null @@ -1,45 +0,0 @@ -/** @file -* -* Copyright (c) 2014, ARM Limited. All rights reserved. -* -* SPDX-License-Identifier: BSD-2-Clause-Patent -* -**/ - -#include -#include - -ARM_GIC_ARCH_REVISION -EFIAPI -ArmGicGetSupportedArchRevision ( - VOID - ) -{ - UINT32 IccSre; - - // Ideally we would like to use the GICC IIDR Architecture version here,= but - // this does not seem to be very reliable as the implementation could ea= sily - // get it wrong. It is more reliable to check if the GICv3 System Regist= er - // feature is implemented on the CPU. This is also convenient as our GIC= v3 - // driver requires SRE. If only Memory mapped access is available we try= to - // drive the GIC as a v2. - if (ArmHasGicSystemRegisters ()) { - // Make sure System Register access is enabled (SRE). This depends on = the - // higher privilege level giving us permission, otherwise we will eith= er - // cause an exception here, or the write doesn't stick in which case w= e need - // to fall back to the GICv2 MMIO interface. - // Note: We do not need to set ICC_SRE_EL2.Enable because the OS is st= arted - // at the same exception level. - // It is the OS responsibility to set this bit. - IccSre =3D ArmGicV3GetControlSystemRegisterEnable (); - if (!(IccSre & ICC_SRE_EL2_SRE)) { - ArmGicV3SetControlSystemRegisterEnable (IccSre| ICC_SRE_EL2_SRE); - IccSre =3D ArmGicV3GetControlSystemRegisterEnable (); - } - if (IccSre & ICC_SRE_EL2_SRE) { - return ARM_GIC_ARCH_REVISION_3; - } - } - - return ARM_GIC_ARCH_REVISION_2; -} diff --git a/ArmPkg/Library/ArmGicArchSecLib/AArch64/ArmGicArchLib.c b/ArmP= kg/Library/ArmGicArchSecLib/ArmGicArchLib.c similarity index 100% rename from ArmPkg/Library/ArmGicArchSecLib/AArch64/ArmGicArchLib.c rename to ArmPkg/Library/ArmGicArchSecLib/ArmGicArchLib.c --=20 2.20.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 (#69200): https://edk2.groups.io/g/devel/message/69200 Mute This Topic: https://groups.io/mt/79061636/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- From nobody Mon May 6 22:10:48 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+69201+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+69201+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1608300990; cv=none; d=zohomail.com; s=zohoarc; b=VS/5lWU0tyW06PIB+VjHpWuU/CW2nYsYQOcPLj3+J1WrqM/mXJYJTBTo51uSfjEWHvWA8TA8VZa+i9pNE12+t9yZisMacU85EkuGuNrT1AECuQwKugny53DG2i6cpvRVFjGcIkpJ4cfmXAnOuSkoJgw1tP6s5nE/VfV7cjPqJqw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608300990; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=cvZ69IuKlQezpAZYeQ4oAslT44FJAJS8QyMGAJF7/5Y=; b=BWQR3wUG0gv9iFhgl59H3LS6bX2mdUWf0wTnHtUoU8sNUVG6L1LcvCZz2lBXADRJ4wBfjo62w3YZF/xLMZSGvZmxLBO5t9U4+LBGw867KszgIf42S3YFRqaIelqNIdi8VwTFDdly6OK1JjIQL2wsqZbzNDFTspEaMX5C/sS/HT8= 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+69201+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1608300990769621.9991936943335; Fri, 18 Dec 2020 06:16:30 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 9m9PYY1788612xCAQkWIPLNo; Fri, 18 Dec 2020 06:16:30 -0800 X-Received: from mail-wr1-f45.google.com (mail-wr1-f45.google.com [209.85.221.45]) by mx.groups.io with SMTP id smtpd.web11.10543.1608300984606921061 for ; Fri, 18 Dec 2020 06:16:24 -0800 X-Received: by mail-wr1-f45.google.com with SMTP id 91so2335264wrj.7 for ; Fri, 18 Dec 2020 06:16:24 -0800 (PST) X-Gm-Message-State: GgZcpVcoR39o1OWSkXZKU0nox1787277AA= X-Google-Smtp-Source: ABdhPJynixOxqOZ0expNPY7AIwfAu016r3D0vZF8a7gkLE+SXq8T5ISdeJjBxiqXKO4A4R6/OPeq2w== X-Received: by 2002:adf:e84f:: with SMTP id d15mr4839967wrn.245.1608300982872; Fri, 18 Dec 2020 06:16:22 -0800 (PST) X-Received: from vanye.hemma.eciton.net (cpc1-cmbg19-2-0-cust915.5-4.cable.virginm.net. [82.27.183.148]) by smtp.gmail.com with ESMTPSA id b12sm18558569wmj.2.2020.12.18.06.16.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Dec 2020 06:16:22 -0800 (PST) From: "Leif Lindholm" To: devel@edk2.groups.io Cc: Ard Biesheuvel Subject: [edk2-devel] [PATCH 5/9] ArmPkg: add ArmHasSecurityExtensions () helper function Date: Fri, 18 Dec 2020 14:16:13 +0000 Message-Id: <20201218141617.26947-6-leif@nuviainc.com> In-Reply-To: <20201218141617.26947-1-leif@nuviainc.com> References: <20201218141617.26947-1-leif@nuviainc.com> MIME-Version: 1.0 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,leif@nuviainc.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1608300990; bh=ZeOKzk5KL6F/+jJ7r6OJZ5J4W8ZMOZ3o1zUo2/QQ004=; h=Cc:Date:From:Reply-To:Subject:To; b=Oq/3Rb5VYcCKq14MCTGN9LzpqqB+P0a5lWP1euoWq7zyqxod4C5lyZAds42rJ56upKw 8NzlV4z0vq3npdo7Ldd96fgee3DGDVlnbrP47Gd4n7ZvRpHhNbI1PgBAOZXCjsfbBC/WZ myL+wkmpkAxWGsqSMyIIY6bbqV2o53jphgM= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Create a helper function to eliminate direct feature register reading. Returns BOOLEAN True if the CPU implements the Security extensions, otherwise returns BOOL False. This function is only implemented for ARM, not AArch64. Cc: Ard Biesheuvel Signed-off-by: Leif Lindholm Reviewed-by: Ard Biesheuvel --- ArmPkg/Include/Library/ArmLib.h | 17 +++++++++++++++++ ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c | 15 +++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/ArmPkg/Include/Library/ArmLib.h b/ArmPkg/Include/Library/ArmLi= b.h index 8a364f2ca96f..c2ed72112b73 100644 --- a/ArmPkg/Include/Library/ArmLib.h +++ b/ArmPkg/Include/Library/ArmLib.h @@ -733,4 +733,21 @@ ArmHasGicSystemRegisters ( VOID ); =20 +#ifdef MDE_CPU_ARM +/// +/// AArch32-only ID Register Helper functions +/// +/** + Check whether the CPU supports the Security extensions + + @return Whether the Security extensions are implemented + +**/ +BOOLEAN +EFIAPI +ArmHasSecurityExtensions ( + VOID + ); +#endif // MDE_CPU_ARM + #endif // __ARM_LIB__ diff --git a/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c b/ArmPkg/Library/ArmLib/A= rm/ArmV7Lib.c index 3faada3a6539..9f81a7223732 100644 --- a/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c +++ b/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c @@ -87,3 +87,18 @@ ArmHasGicSystemRegisters ( { return ((ArmReadIdPfr1 () & ARM_PFR1_GIC) !=3D 0); } + +/** + Check whether the CPU supports the Security extensions + + @return Whether the Security extensions are implemented + +**/ +BOOLEAN +EFIAPI +ArmHasSecurityExtensions ( + VOID + ) +{ + return ((ArmReadIdPfr1 () & ARM_PFR1_SEC) !=3D 0); +} --=20 2.20.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 (#69201): https://edk2.groups.io/g/devel/message/69201 Mute This Topic: https://groups.io/mt/79061638/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- From nobody Mon May 6 22:10:48 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+69202+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+69202+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1608300996; cv=none; d=zohomail.com; s=zohoarc; b=H0f3wzHYcpv5jlpwcrD9XCqPc/Gn1NbMP8fYfrY9ksQuNyj67ZK6gYM66Pfl3zW94dyuiB8F4QIrCHvDSkqbzG27OTM85e3y0eyhlacAjfqnckB3TsflnFlXftkLjEsAGI3iBj/oSGEvSOq7AfLjUeGgcDQHdDqxIieFjy6/stU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608300996; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=Rh8ISfLzvEnROACQvxu1NNQqECcDxT9sl5+Y2rhuW0Q=; b=WyDw+FiIgWETV3L1wFIHHv/kmCFEaPFeNywAkdJU13qD1RgARruq9xLZ2w2RZnUKISlUE/WR5Y+Y3NgOHqo+IE6pGGcaX37G6Onyl1DhE/8s9SB7Rb8BD/nNUS6fqsUwXqS2+ezWJmPeXkbJpa/j30tNhVwJRaYqd2UkLuSQLww= 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+69202+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1608300996287343.84374387884225; Fri, 18 Dec 2020 06:16:36 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id EWXGYY1788612xS3ATZuaCqt; Fri, 18 Dec 2020 06:16:34 -0800 X-Received: from mail-wm1-f50.google.com (mail-wm1-f50.google.com [209.85.128.50]) by mx.groups.io with SMTP id smtpd.web12.10590.1608300985540771696 for ; Fri, 18 Dec 2020 06:16:25 -0800 X-Received: by mail-wm1-f50.google.com with SMTP id a6so2488173wmc.2 for ; Fri, 18 Dec 2020 06:16:25 -0800 (PST) X-Gm-Message-State: d4uMjFEAuwp9WNL9wwjrY6YCx1787277AA= X-Google-Smtp-Source: ABdhPJyjDn2icmWJU7xpAGtcX4eqM1ptxyTxL2YZwIiIpVdRlDtPiy9t2cgPAQ6F9wxCAJtKFw/ejQ== X-Received: by 2002:a1c:2d47:: with SMTP id t68mr4590665wmt.148.1608300983834; Fri, 18 Dec 2020 06:16:23 -0800 (PST) X-Received: from vanye.hemma.eciton.net (cpc1-cmbg19-2-0-cust915.5-4.cable.virginm.net. [82.27.183.148]) by smtp.gmail.com with ESMTPSA id b12sm18558569wmj.2.2020.12.18.06.16.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Dec 2020 06:16:23 -0800 (PST) From: "Leif Lindholm" To: devel@edk2.groups.io Cc: Ard Biesheuvel Subject: [edk2-devel] [PATCH 6/9] ArmPkg: use helper to check for Security extensions in ArmArchTimerLib Date: Fri, 18 Dec 2020 14:16:14 +0000 Message-Id: <20201218141617.26947-7-leif@nuviainc.com> In-Reply-To: <20201218141617.26947-1-leif@nuviainc.com> References: <20201218141617.26947-1-leif@nuviainc.com> MIME-Version: 1.0 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,leif@nuviainc.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1608300994; bh=1+F6qvZddmulrBncSZE9oXPq9D//GCW17ufPSERdz28=; h=Cc:Date:From:Reply-To:Subject:To; b=pe6dvPwg2Io7ejvjryRu17CXo+yfPrgXN9yHkpO/lQ7x+SuykYSEBm/9TYs5Pe9ycFB wa7RMsdjCZHbZQiiLQwdbJ+HBlm8uyq5/h3lTw/66fES/IIv6//Yu8hO1H6ASVv39KODO W34DixtxQ/LwDrAAy5eR9Vq4yYlMxH4bUMI= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" Use the helper ArmHasSecurityExtensions () instead of accessing ID_PFR1 directly. Only affects ARM build. Cc: Ard Biesheuvel Signed-off-by: Leif Lindholm Reviewed-by: Ard Biesheuvel --- ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c b/ArmPkg/Libr= ary/ArmArchTimerLib/ArmArchTimerLib.c index 7c698fe471f3..24d9dae4e660 100644 --- a/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c +++ b/ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c @@ -56,7 +56,7 @@ TimerConstructor ( // If the security extension is not implemented, set Timer Frequency // here. // - if ((ArmReadIdPfr1 () & ARM_PFR1_SEC) =3D=3D 0x0) { + if (ArmHasSecurityExtensions ()) { ArmGenericTimerSetTimerFreq (PcdGet32 (PcdArmArchTimerFreqInHz)); } #endif --=20 2.20.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 (#69202): https://edk2.groups.io/g/devel/message/69202 Mute This Topic: https://groups.io/mt/79061639/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- From nobody Mon May 6 22:10:48 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+69203+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+69203+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1608300996; cv=none; d=zohomail.com; s=zohoarc; b=Gs5Dd70+24yiKgcnDyMuD+3/JW0MxQ2QlTBYGhFh3cW9CvVT7jjTyxyT7BtHLap436S9fTtJ//aPAU9mRtzKfaOy7Q1XL0XAg4k4vQnKrdJkiewtuBgSzrAm8BaLz7KYq08f3kiU25tYGnyp/LXqewLAkYFryc2QyF0Bp6CuvlQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608300996; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=nJ2T0uGfijbZjqZJnnPL2lC+OfW1ZXlGMKkDwjCoc+4=; b=FghEZzsZJ1QZ47asVkDpk/6ycqYy2Pqt49n4wyGPaNnHBq4Cy9+o3ze+9qASDGvHZ3hcpq0m5HA8P/X7ODYH2LUn3P1+qr5/aNY1w8wET6t0zWWU1MgmrfVPxDQMxsFg9rNRrU7SsqSLgFD5x6Jeon8YEOW1TFcu52hqTvCsqdc= 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+69203+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1608300996679603.5212397584008; Fri, 18 Dec 2020 06:16:36 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id z2uuYY1788612x3GIUCiGNuW; Fri, 18 Dec 2020 06:16:35 -0800 X-Received: from mail-wm1-f52.google.com (mail-wm1-f52.google.com [209.85.128.52]) by mx.groups.io with SMTP id smtpd.web08.10542.1608300986142212232 for ; Fri, 18 Dec 2020 06:16:26 -0800 X-Received: by mail-wm1-f52.google.com with SMTP id v14so2484581wml.1 for ; Fri, 18 Dec 2020 06:16:25 -0800 (PST) X-Gm-Message-State: Klm6Xi7NBsO7LqDzsTctssaox1787277AA= X-Google-Smtp-Source: ABdhPJz1UuAuDXISMjk75WuRH+PGcKPnSmT0pfkkccgNsDiIdA+s2rDkA2OgpMkXGmD3kxwDFB95wA== X-Received: by 2002:a7b:cf30:: with SMTP id m16mr4434755wmg.145.1608300984471; Fri, 18 Dec 2020 06:16:24 -0800 (PST) X-Received: from vanye.hemma.eciton.net (cpc1-cmbg19-2-0-cust915.5-4.cable.virginm.net. [82.27.183.148]) by smtp.gmail.com with ESMTPSA id b12sm18558569wmj.2.2020.12.18.06.16.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Dec 2020 06:16:24 -0800 (PST) From: "Leif Lindholm" To: devel@edk2.groups.io Cc: Ard Biesheuvel Subject: [edk2-devel] [PATCH 7/9] ArmPkg/ArmLib: delete AArch64 version of ArmReadIdPfr1 Date: Fri, 18 Dec 2020 14:16:15 +0000 Message-Id: <20201218141617.26947-8-leif@nuviainc.com> In-Reply-To: <20201218141617.26947-1-leif@nuviainc.com> References: <20201218141617.26947-1-leif@nuviainc.com> MIME-Version: 1.0 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,leif@nuviainc.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1608300995; bh=Zg8iOcfOqt22mapgJSLbvZa3//DK5MjS7wN2KLMrnmk=; h=Cc:Date:From:Reply-To:Subject:To; b=GZzt0ysbIgRocI6wYFq0FL34Iw9Zzfwx6uzgPLgSv5l7Esnq8/nUcSjqKvuAl9+d14j jC/DtdkhzSJ8FyZp++/XQzG5IunCNEIMGvHoEN/4H4MQONlZBbSlV/AfduuaVHVhPRR1B BXwUFidcxU2nnBre6JQJ7PU54m3Du3GV0G8= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" The AArch64 version of ArmReadIdPfr1 is not used by any code in tree, or in edk2-platforms. Delete it. Cc: Ard Biesheuvel Signed-off-by: Leif Lindholm Reviewed-by: Ard Biesheuvel --- ArmPkg/Library/ArmLib/AArch64/AArch64Support.S | 8 -------- 1 file changed, 8 deletions(-) diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S b/ArmPkg/Librar= y/ArmLib/AArch64/AArch64Support.S index 199374ff59e3..7f942c29ea66 100644 --- a/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S +++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S @@ -453,14 +453,6 @@ ASM_FUNC(ArmReadIdPfr0) ret =20 =20 -// Q: id_aa64pfr1_el1 not defined yet. What does this function want to acc= ess? -// A: used to setup arch timer. Check if we have security extensions, perm= issions to set stuff. -// See: ArmPkg/Library/ArmArchTimerLib/AArch64/ArmArchTimerLib.c -// Not defined yet, but stick in here for now, should read all zeros. -ASM_FUNC(ArmReadIdPfr1) - mrs x0, id_aa64pfr1_el1 // Read ID_PFR1 Register - ret - // VOID ArmWriteHcr(UINTN Hcr) ASM_FUNC(ArmWriteHcr) msr hcr_el2, x0 // Write the passed HCR value --=20 2.20.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 (#69203): https://edk2.groups.io/g/devel/message/69203 Mute This Topic: https://groups.io/mt/79061640/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- From nobody Mon May 6 22:10:48 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+69205+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+69205+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1608301005; cv=none; d=zohomail.com; s=zohoarc; b=HCV/3wEiGjS7BIw7fkdKA3hcGXExaLhKNJI9yoXwgTxxqdRolcK6EDrHK39yxhD0h20FYJjkmcCmw5q/A6hMlUvKaZrgo0GzRdlsqLIjDpNc/xdonZZQZ1o0x1f7D0HY24Jsg7GGIerc0sFgwTAKuIQnUBHW7zWk7Vx8alUB3zg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608301005; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=n7bfy9A+rmlzPJAD7dsrmIEDpalTmvbamGF5emSPaNo=; b=NRr55qjVlOcgV/yRyEqnJ9y8jxaDZyZ1Y4ZgXfQ3KDRcEoUFjfzLBZ6w/zaSwinYHEMdrTMnxhubJQha342cKVTDZWjJDPmMlPvwEJo6KmeSDxpyAlDvweZ6msDhAdcm+CNR1flVwxcMHBbhZEnRvTtljVTv6KN5JHJJCkfO/Dc= 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+69205+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1608301005626796.638826703413; Fri, 18 Dec 2020 06:16:45 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id puNsYY1788612xsN78AYaRFf; Fri, 18 Dec 2020 06:16:45 -0800 X-Received: from mail-wm1-f43.google.com (mail-wm1-f43.google.com [209.85.128.43]) by mx.groups.io with SMTP id smtpd.web11.10547.1608300991999635796 for ; Fri, 18 Dec 2020 06:16:32 -0800 X-Received: by mail-wm1-f43.google.com with SMTP id q75so2748813wme.2 for ; Fri, 18 Dec 2020 06:16:26 -0800 (PST) X-Gm-Message-State: HFq75Hr5M1z1WzrDfL7ZAFUix1787277AA= X-Google-Smtp-Source: ABdhPJz+DOvMebdAfKr96FaaO5AGdWeDR5nD/RqykhBhsLEWm0I8KVpoYe+/lQLjbhOPtI1EmTtf7w== X-Received: by 2002:a7b:c4d5:: with SMTP id g21mr4497851wmk.92.1608300985242; Fri, 18 Dec 2020 06:16:25 -0800 (PST) X-Received: from vanye.hemma.eciton.net (cpc1-cmbg19-2-0-cust915.5-4.cable.virginm.net. [82.27.183.148]) by smtp.gmail.com with ESMTPSA id b12sm18558569wmj.2.2020.12.18.06.16.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Dec 2020 06:16:24 -0800 (PST) From: "Leif Lindholm" To: devel@edk2.groups.io Cc: Ard Biesheuvel Subject: [edk2-devel] [PATCH 8/9] ArmPkg/ArmLib: rename AArch64 variant of ArmReadIdPfr0 Date: Fri, 18 Dec 2020 14:16:16 +0000 Message-Id: <20201218141617.26947-9-leif@nuviainc.com> In-Reply-To: <20201218141617.26947-1-leif@nuviainc.com> References: <20201218141617.26947-1-leif@nuviainc.com> MIME-Version: 1.0 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,leif@nuviainc.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1608301005; bh=LaK7DPe38iEXlMS57w1KWMZmAv6Evgu2GFBUDbLVG4E=; h=Cc:Date:From:Reply-To:Subject:To; b=g7XuQpL9wJZY4u/+KjmGxvby7AEuvp2OBfvPgwZmmVrhd5CXPw1lX2KTUb2ZZ0c8mBy zsUSo/56WCy3+93d5s95dmrtXLKSIWbKTYRxBCb2qpF9eMBqLCY9XjzITz6dfxeUA68W2 q1bVKlSJuLc34eguSgXGrauWKp/q1obnQrc= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" ArmReadIdPfr0 is now used only inside ArmLib. Rename the AArch64 variant ArmReadIdAA64Pfr0 and add a declaration of that only into local header AArch64/AArch64Lib.h. Cc: Ard Biesheuvel Signed-off-by: Leif Lindholm Reviewed-by: Ard Biesheuvel --- ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h | 6 ++++++ ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c | 2 +- ArmPkg/Library/ArmLib/AArch64/AArch64Support.S | 5 +++-- 3 files changed, 10 insertions(+), 3 deletions(-) diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h b/ArmPkg/Library/Ar= mLib/AArch64/AArch64Lib.h index b2c8a8ea0b84..85bcecda730f 100644 --- a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h +++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h @@ -2,6 +2,7 @@ =20 Copyright (c) 2008 - 2009, Apple Inc. All rights reserved.
Portions Copyright (c) 2011 - 2013, ARM Ltd. All rights reserved.
+ Copyright (c) 2020, NUVIA Inc. All rights reserved.
=20 SPDX-License-Identifier: BSD-2-Clause-Patent =20 @@ -35,5 +36,10 @@ ArmCleanInvalidateDataCacheEntryBySetWay ( IN UINTN SetWayFormat ); =20 +UINTN +EFIAPI +ArmReadIdAA64Pfr0 ( + VOID + ); #endif // __AARCH64_LIB_H__ =20 diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c b/ArmPkg/Library/Ar= mLib/AArch64/AArch64Lib.c index 5b10eb33c97d..53e593bc994b 100644 --- a/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c +++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c @@ -85,5 +85,5 @@ ArmHasGicSystemRegisters ( VOID ) { - return ((ArmReadIdPfr0 () & AARCH64_PFR0_GIC) !=3D 0); + return ((ArmReadIdAA64Pfr0 () & AARCH64_PFR0_GIC) !=3D 0); } diff --git a/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S b/ArmPkg/Librar= y/ArmLib/AArch64/AArch64Support.S index 7f942c29ea66..129205d2ac27 100644 --- a/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S +++ b/ArmPkg/Library/ArmLib/AArch64/AArch64Support.S @@ -3,6 +3,7 @@ # Copyright (c) 2008 - 2010, Apple Inc. All rights reserved.
# Copyright (c) 2011 - 2017, ARM Limited. All rights reserved. # Copyright (c) 2016, Linaro Limited. All rights reserved. +# Copyright (c) 2020, NUVIA Inc. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -395,7 +396,7 @@ ASM_FUNC(ArmReadVBar) ASM_FUNC(ArmEnableVFP) // Check whether floating-point is implemented in the processor. mov x1, x30 // Save LR - bl ArmReadIdPfr0 // Read EL1 Processor Feature Register (PF= R0) + bl ArmReadIdAA64Pfr0 // Read EL1 Processor Feature Register (PF= R0) mov x30, x1 // Restore LR ubfx x0, x0, #16, #4 // Extract the FP bits 16:19 cmp x0, #0xF // Check if FP bits are '1111b', @@ -448,7 +449,7 @@ ASM_FUNC(ArmIsArchTimerImplemented) ret =20 =20 -ASM_FUNC(ArmReadIdPfr0) +ASM_FUNC(ArmReadIdAA64Pfr0) mrs x0, id_aa64pfr0_el1 // Read ID_AA64PFR0 Register ret =20 --=20 2.20.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 (#69205): https://edk2.groups.io/g/devel/message/69205 Mute This Topic: https://groups.io/mt/79061644/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- From nobody Mon May 6 22:10:48 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+69204+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+69204+1787277+3901457@groups.io ARC-Seal: i=1; a=rsa-sha256; t=1608301000; cv=none; d=zohomail.com; s=zohoarc; b=Rhim1FMXSBY0VxHWbM8LQ5fL9n4h50VAHQrlzvb1AT+tn9hPnwa2CYHut+qGXQth0NIYPec0OMffi940Rx1f6ojeEd9tDlKaKXkMapuEkmX7VY+HSEUUvSoptoa0s1oyCBcy84ZVQ7ur3Mf78tavtWkimi9tHR5PBgXw2O0IpE8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1608301000; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Id:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=LlQ87c3zdsvIXbySqM9+xIPVSPDgB4oYZ+v95XI0XHE=; b=ZVxAwTY0dBf50XziQbT/w3c99aNssfRsUNcx9TTLUB4VELTf1HgzuUzDkjbC7uFZ1l2Bbvj5ernAvmotvLKHI6DUw0N8tZXrWTw/zHCGMaGlzxps1e+KAlCSeTApvmTmQBzrD3IpMOzuYZSAMrSqNdtDxgm+EywbWvMxzI1e7y8= 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+69204+1787277+3901457@groups.io Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1608301000039452.99754771635037; Fri, 18 Dec 2020 06:16:40 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 70cbYY1788612xnFSJ6OOUDt; Fri, 18 Dec 2020 06:16:39 -0800 X-Received: from mail-wr1-f44.google.com (mail-wr1-f44.google.com [209.85.221.44]) by mx.groups.io with SMTP id smtpd.web11.10545.1608300987608179624 for ; Fri, 18 Dec 2020 06:16:27 -0800 X-Received: by mail-wr1-f44.google.com with SMTP id r3so2355958wrt.2 for ; Fri, 18 Dec 2020 06:16:27 -0800 (PST) X-Gm-Message-State: CbsXFvdV38AvnkHJi4Ey4gntx1787277AA= X-Google-Smtp-Source: ABdhPJy9jk/w9wODdghS/3oF0pUI/LA4KpKae4UlwL05fg4Zgz5SL5cpF9gXblvp8A8BiDKaRXv7yA== X-Received: by 2002:adf:f5c5:: with SMTP id k5mr4895392wrp.286.1608300986034; Fri, 18 Dec 2020 06:16:26 -0800 (PST) X-Received: from vanye.hemma.eciton.net (cpc1-cmbg19-2-0-cust915.5-4.cable.virginm.net. [82.27.183.148]) by smtp.gmail.com with ESMTPSA id b12sm18558569wmj.2.2020.12.18.06.16.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Dec 2020 06:16:25 -0800 (PST) From: "Leif Lindholm" To: devel@edk2.groups.io Cc: Ard Biesheuvel Subject: [edk2-devel] [PATCH 9/9] ArmPkg/ArmLib: move ArmReadIdPfr0/1 into private header ArmV7Lib.h Date: Fri, 18 Dec 2020 14:16:17 +0000 Message-Id: <20201218141617.26947-10-leif@nuviainc.com> In-Reply-To: <20201218141617.26947-1-leif@nuviainc.com> References: <20201218141617.26947-1-leif@nuviainc.com> MIME-Version: 1.0 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,leif@nuviainc.com Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1608300999; bh=MyuHvo4zMSAKFHPEGF7lZtZ5vp8ZGw7GgVYbKCBRkHo=; h=Cc:Date:From:Reply-To:Subject:To; b=KQqu8YHqSqJ6hZWTfttLbKgxsBJ/TpLHvyboYlL+okWm7kiNUBxLxGVceSro4zObyib usyVdiVxdRKMcKvUbvMwCM6i7qKmqg2BW2KUGXfYi3H9jPZh1Skd7+dlqZ3e8j3TUXH1u c3HJ2X1JpwzhpkatcQoVGV31y9Ftvga9Kac= X-ZohoMail-DKIM: pass (identity @groups.io) Content-Type: text/plain; charset="utf-8" ArmReadIdPfr0 () and ArmReadIdPfr1 () are now used only inside ArmLib. Remove the prototypes from the public header to discourage new id register accessor additions, and direct id register access in general. Move them into local header Arm/ArmV7Lib.h. Cc: Ard Biesheuvel Signed-off-by: Leif Lindholm Reviewed-by: Ard Biesheuvel --- ArmPkg/Include/Library/ArmLib.h | 12 ------------ ArmPkg/Library/ArmLib/Arm/ArmV7Lib.h | 12 ++++++++++++ 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/ArmPkg/Include/Library/ArmLib.h b/ArmPkg/Include/Library/ArmLi= b.h index c2ed72112b73..26cb05def0a2 100644 --- a/ArmPkg/Include/Library/ArmLib.h +++ b/ArmPkg/Include/Library/ArmLib.h @@ -133,18 +133,6 @@ ArmIsArchTimerImplemented ( VOID ); =20 -UINTN -EFIAPI -ArmReadIdPfr0 ( - VOID - ); - -UINTN -EFIAPI -ArmReadIdPfr1 ( - VOID - ); - UINTN EFIAPI ArmCacheInfo ( diff --git a/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.h b/ArmPkg/Library/ArmLib/A= rm/ArmV7Lib.h index 93183e67230e..bb7bda0a3aeb 100644 --- a/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.h +++ b/ArmPkg/Library/ArmLib/Arm/ArmV7Lib.h @@ -48,5 +48,17 @@ ArmCleanInvalidateDataCacheEntryBySetWay ( IN UINTN SetWayFormat ); =20 +UINTN +EFIAPI +ArmReadIdPfr0 ( + VOID + ); + +UINTN +EFIAPI +ArmReadIdPfr1 ( + VOID + ); + #endif // __ARM_V7_LIB_H__ =20 --=20 2.20.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 (#69204): https://edk2.groups.io/g/devel/message/69204 Mute This Topic: https://groups.io/mt/79061642/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-