From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f42.google.com (mail-wr1-f42.google.com [209.85.221.42]) by mx.groups.io with SMTP id smtpd.web12.10585.1608300980370127930 for ; Fri, 18 Dec 2020 06:16:20 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=F1FDqBTk; spf=pass (domain: nuviainc.com, ip: 209.85.221.42, mailfrom: leif@nuviainc.com) Received: by mail-wr1-f42.google.com with SMTP id t30so2369246wrb.0 for ; Fri, 18 Dec 2020 06:16:20 -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:mime-version :content-transfer-encoding; bh=6eAZws+/oFgBe8W3g/7aVkAcHUINbcyPADhRMJHxg1s=; b=F1FDqBTkWrSTTYazhkVnwrB/kD7KeGH9b7lg9/cUHcezHVaH9yo5oh6VLY7YdbPNAy 8FhlTLMsJG82swSLdIrQ+7Zc/teA18ydMDJx5SHWA46X85cDckE0csiCfjAc0gmWBHUg p9DqaIpLH/YeSIx418jZBygAbKp1CjAzjky9Ik9LeZk/tuHNusFk02KDKUUXoKCL2m44 uCvGxEGy6X9qQvqp8SFiXdyZ8whBZ/Yc+8npOqgsa4mGZMb+KRhErnnKC5fsemdcVpWO /9rGI6Ja/3xSgIxt8lIEXhX+xyxY36qnayo1NDl67Bmi/c8H3iEVKJBVSl4dSXTGZ0tl YuIg== 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:mime-version :content-transfer-encoding; bh=6eAZws+/oFgBe8W3g/7aVkAcHUINbcyPADhRMJHxg1s=; b=MpwsZi4JM1bUIPpnpRosdvYuEJNygaufKw50/2u3tCNo4KMl04T6x0mTMFrjkmdSdl 0JT3RGI8YjUS9oyOAqbxwhAxc0/Dp2L8zLLEAZlFUN4JMCqPeOKkJ/z1Z2mx9zA1nXXw 8wOA0sqQTKapql1Lqr+EbuBH5p06LCsUEuEoHoo781xJqmGTUhxYZCqEmNAnFAqGD7dt kepEynoEcJiBzfnYHy/011E7DgF1YiGOTaLRpmReBY3ZPSidzJKPkkI0fVq3eHFaf4L1 D+ubs/Co2UNDmW6b5/SNhUR5sI52USjehZ4cyGjqlC9CpJCdEJuMhJ7DyfZMDMdBbme5 D/IQ== X-Gm-Message-State: AOAM533vCtrJmHZuZ+RssGG+LqQbjhGSwYpqqmL/FP2EnRi4IsY5V9Az Bla5WNedFqUksiY6IvFMU1T1OJLVhqlUxdx1w4zpVN1Jc2cIojoJWg2f4Q6nkz5g5vuDSw7ktTU +qma4IrZJP8NByHYmtWIZf37yrjmaCRMoepLKimhaAgCpBjmJvc6aJNrDgbjqoxEBpw== X-Google-Smtp-Source: ABdhPJxBt1Sar7eecowd568M6B7mtfR2SBFxPpnMJrAqFsl3Py/ZlIHfJE9Hhz5SJ9esqtCvvH4dGw== X-Received: by 2002:adf:e5c7:: with SMTP id a7mr4796645wrn.300.1608300978630; Fri, 18 Dec 2020 06:16:18 -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.17 (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: [PATCH 0/9] ArmPkg: Start cleaning up ID register handling Date: Fri, 18 Dec 2020 14:16:08 +0000 Message-Id: <20201218141617.26947-1-leif@nuviainc.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit As discussed in https://edk2.groups.io/g/devel/topic/78784065, the ARM and AArch64 ports were using an unfortunate overloading of accessor functions for the ID registers which describe the presence and versions of features implemented in a CPU. This makes no sense, since the layout, and indeed the names of the registers for the different architectural states differ. This set replaces the use of the current accessor functions with some helper functions in ArmLib. It also moves the accessor function prototypes into private headers so they can no longer be called from outside ArmLib As a pure side effect, we're able to throw away half of ArmGicArchLib/ArmGicArchSecLib. Note that some additional cleanup can also be done in the ARM portion of ArmMmuLib (which implements its own direct accessor for ID_MMFR0), and internally in ArmLib where some assembly code does its own feature checks, which could be moved to C helpers. Furthermore, it might be useful to move the ID register field definitions to a private header. Cc: Ard Biesheuvel Leif Lindholm (9): ArmPkg/ArmLib: add ArmHasGicSystemRegisters () helper function ArmPkg: use ID register helper for ArmGicArch(Sec)Lib ArmPkg: remove duplicated ARM/AArch64 ArmGicArchLib sources ArmPkg: remove duplicated ARM/AArch64 ArmGicArchSecLib sources ArmPkg: add ArmHasSecurityExtensions () helper function ArmPkg: use helper to check for Security extensions in ArmArchTimerLib ArmPkg/ArmLib: delete AArch64 version of ArmReadIdPfr1 ArmPkg/ArmLib: rename AArch64 variant of ArmReadIdPfr0 ArmPkg/ArmLib: move ArmReadIdPfr0/1 into private header ArmV7Lib.h ArmPkg/Library/ArmGicArchLib/ArmGicArchLib.inf | 7 +-- ArmPkg/Library/ArmGicArchSecLib/ArmGicArchSecLib.inf | 7 +-- ArmPkg/Include/Library/ArmLib.h | 47 +++++++++++---- ArmPkg/Library/ArmLib/AArch64/AArch64Lib.h | 6 ++ ArmPkg/Library/ArmLib/Arm/ArmV7Lib.h | 12 ++++ ArmPkg/Library/ArmArchTimerLib/ArmArchTimerLib.c | 2 +- ArmPkg/Library/ArmGicArchLib/Arm/ArmGicArchLib.c | 60 -------------------- ArmPkg/Library/ArmGicArchLib/{AArch64 => }/ArmGicArchLib.c | 2 +- ArmPkg/Library/ArmGicArchSecLib/Arm/ArmGicArchLib.c | 45 --------------- ArmPkg/Library/ArmGicArchSecLib/{AArch64 => }/ArmGicArchLib.c | 2 +- ArmPkg/Library/ArmLib/AArch64/AArch64Lib.c | 16 ++++++ ArmPkg/Library/ArmLib/Arm/ArmV7Lib.c | 31 ++++++++++ ArmPkg/Library/ArmLib/AArch64/AArch64Support.S | 13 +---- 13 files changed, 110 insertions(+), 140 deletions(-) delete mode 100644 ArmPkg/Library/ArmGicArchLib/Arm/ArmGicArchLib.c rename ArmPkg/Library/ArmGicArchLib/{AArch64 => }/ArmGicArchLib.c (94%) delete mode 100644 ArmPkg/Library/ArmGicArchSecLib/Arm/ArmGicArchLib.c rename ArmPkg/Library/ArmGicArchSecLib/{AArch64 => }/ArmGicArchLib.c (94%) -- 2.20.1