From mboxrd@z Thu Jan 1 00:00:00 1970 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 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=YTkTVWuM; spf=pass (domain: nuviainc.com, ip: 209.85.221.54, mailfrom: leif@nuviainc.com) Received: by mail-wr1-f54.google.com with SMTP id 91so2335114wrj.7 for ; Fri, 18 Dec 2020 06:16:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nuviainc-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=ZVlefox8e1WCwkIBwKJJIb0YE39i9jWW+VP8DHj4kBU=; b=YTkTVWuMhctAPgp4r4NVE6G19tzTFmNfVbbl5FmDWklXsBdJZjLXZpV6F9IE9rbaRh bZHcjjtIW+cy9HYY6e2ky4oLyNNc2QI9UzCwHH2pCiEIxkBNB4USCBBteXKxkT7TaoPk XByuVDBTbGNWJanwBRuBJ/Ng93zHnzF4WB6waONpCHVYMNn2HB4Cuz5AGlGsg3/xa9FO IwpXqS1fls5ryFpOhPC4VPFAwGWUkAtnENO4BWz3Z5bu6TNaHrYO8xnEdjvd95GFi+RD Q8xq6NMRaR5mcWzYRudM5kUHprlxol04oyDiSmblkloojMD2smd+/EgGJ8OlBAHbWOTH 9JhA== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=ZVlefox8e1WCwkIBwKJJIb0YE39i9jWW+VP8DHj4kBU=; b=TO/w+LymKrgFxFsjKslqVjNfe2fJ2v0fW5/MNraBlyJkGTLCEJsPKkIJ6CNftAHNHi ssenac4SGMhWtRmp008G/g/ISQgAzhkZRE16jDgoVT/6TM6uGkkF9L32L1eUW6dg2k0z leBa4CrzefY+gPJo6Zas9ENnle55d1W8iY2pqTunUliREaI+3gZ27PBOjpiCJHmrFuib eFOsQnt0WwA1QWnd7TXSFXbHuE3v+hLGjv/bCki1oal/Um/3MfNTgraI8+6C3RlIQG1Z RGCGqG7uwEfMuUq1fncIW1wmcnD4CXpOqoJYR7Hj2vtaJXpDHfeIS46evtNTXErsAjNY jPfA== X-Gm-Message-State: AOAM531b4m4py9tE6jeaZdQGcRG7B9PDR+QSrBBj9SygBUXG28nu/HKR MBNKOiN9tgfofjcScwNfwMp+F2w5pHSpSRKGEc2sm+cEAto85CnCDHV3I99CRXjkfUChHqm1yks k8XDTYFnM+NnjtSkxGpTWcrh0cR3dH1cXdniS1K9S9a0BU5JBIPksJ6Uf3QklZU0MdQ== 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) Return-Path: 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: [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> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20201218141617.26947-1-leif@nuviainc.com> References: <20201218141617.26947-1-leif@nuviainc.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Use ArmHasGicSystemRegisters () instead of direct ID register tests. Cc: Ard Biesheuvel Signed-off-by: Leif Lindholm --- 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 GICv3 // 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 either // cause an exception here, or the write doesn't stick in which case we need diff --git a/ArmPkg/Library/ArmGicArchLib/Arm/ArmGicArchLib.c b/ArmPkg/Library/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 GICv3 // 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 either // cause an exception here, or the write doesn't stick in which case we need diff --git a/ArmPkg/Library/ArmGicArchSecLib/AArch64/ArmGicArchLib.c b/ArmPkg/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 GICv3 // 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 either // cause an exception here, or the write doesn't stick in which case we need diff --git a/ArmPkg/Library/ArmGicArchSecLib/Arm/ArmGicArchLib.c b/ArmPkg/Library/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 GICv3 // 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 either // cause an exception here, or the write doesn't stick in which case we need -- 2.20.1