From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) by mx.groups.io with SMTP id smtpd.web12.16.1608305794265884485 for ; Fri, 18 Dec 2020 07:36:34 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=GykRJzJv; spf=pass (domain: nuviainc.com, ip: 209.85.221.50, mailfrom: leif@nuviainc.com) Received: by mail-wr1-f50.google.com with SMTP id r7so2616403wrc.5 for ; Fri, 18 Dec 2020 07:36:33 -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=BleUjlDTshuE3yxk4ZddoG4PAs8N8SPOW6PdW9jD4dY=; b=GykRJzJvMk/AqjGVIZYJkXoykbjhwOEv73A0f6dGgH7imuRx+gpa4ocW36cTeg/cCD ihmhx6cSdcmuZurQQxyj5vkJRBflVqVp7sM9LIgUxx/FoyGyPoW3C1TWUgkWKe3hUQYG wKONWX3DX4y4hDKGYj4dUO9pb6ywZ0zpNoRod5I0m/Rm44ZWe0oQdh6Q8c4e7/EFF/44 Yrjw3FUwF4GC+zSoptGwOOfgMg/PB0TJ2FZN4B1plRdztyRHG8+55qBSx0AWJs6enYGY 5jCQ9B8eWe6hXQJwhf7Ez35X7p8cXiro+PljNVeopBjRXbhF8YLFi1eLEtAQJM5DT5bp Ll4g== 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=BleUjlDTshuE3yxk4ZddoG4PAs8N8SPOW6PdW9jD4dY=; b=iUcswaVlgKeosGaGRiAx6LZm2zQFfLn+w6Mg7jXgmWmHdF7nijanUEqyVCtsvdfgAb co8ILt5rpNXfBwHRsjQGm5/R1KxzkPjttInRyr0+YhS0G9VMdaFFoDmOhZsq+ZCoY105 7yjyWToNbtN1AVoycDXwiXH9l74mmILblzUObRGJCtFvktr7hclKT19VY7d7OM/LAb9l X9IF9+oQcs9MIfxWtrYFzQoIr9vETBEPAx+JgCWlM8S45cuDzzpHPJLXktI7PNZNRBe0 B7hdf9Po+5WsLXBukR8Iw4GlrnkQGUYlQX2xzr74XLGOO2xxVC0mKztGC2r6RJihOgld ZBSg== X-Gm-Message-State: AOAM532k4puRv3y7GUC6TH9B1O4Q/t6zj6UQBtvOqfS+1nwrwnLuGbMu Jy7MWmNnp7QqvGx+iOlPMDmDRw== X-Google-Smtp-Source: ABdhPJzVoSC/7Tyc8Y/7WhrSQKO39cHId/aYlqXbLjzXsFp5zFni0XIXY8nzeSYfQAvX24Lf4XWb+Q== X-Received: by 2002:adf:efc5:: with SMTP id i5mr5012033wrp.377.1608305792727; Fri, 18 Dec 2020 07:36:32 -0800 (PST) Return-Path: Received: from vanye (cpc1-cmbg19-2-0-cust915.5-4.cable.virginm.net. [82.27.183.148]) by smtp.gmail.com with ESMTPSA id k1sm14286305wrn.46.2020.12.18.07.36.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 18 Dec 2020 07:36:32 -0800 (PST) Date: Fri, 18 Dec 2020 15:36:30 +0000 From: "Leif Lindholm" To: Ard Biesheuvel Cc: devel@edk2.groups.io Subject: Re: [PATCH 0/9] ArmPkg: Start cleaning up ID register handling Message-ID: <20201218153630.GU1664@vanye> References: <20201218141617.26947-1-leif@nuviainc.com> <63bfb26c-6e41-f35a-8fc7-1fd26604a82c@arm.com> MIME-Version: 1.0 In-Reply-To: <63bfb26c-6e41-f35a-8fc7-1fd26604a82c@arm.com> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Fri, Dec 18, 2020 at 16:02:07 +0100, Ard Biesheuvel wrote: > On 12/18/20 3:16 PM, Leif Lindholm wrote: > > 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 > > > > Thanks for getting started on this. > > For the series, > > Reviewed-by: Ard Biesheuvel Thanks! Pushed as 6573ae8c8575..e2bfd172e4b9 (#1244). > > 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%) > > >