From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out30-131.freemail.mail.aliyun.com (out30-131.freemail.mail.aliyun.com [115.124.30.131]) by mx.groups.io with SMTP id smtpd.web11.9310.1614085103641728379 for ; Tue, 23 Feb 2021 04:58:24 -0800 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: linux.alibaba.com, ip: 115.124.30.131, mailfrom: guoheyi@linux.alibaba.com) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R131e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04423;MF=guoheyi@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0UPNNKg4_1614085094; Received: from B-G4TALVDL-1650.local(mailfrom:guoheyi@linux.alibaba.com fp:SMTPD_---0UPNNKg4_1614085094) by smtp.aliyun-inc.com(127.0.0.1); Tue, 23 Feb 2021 20:58:15 +0800 Subject: Re: [edk2-devel] [PATCH edk2 v2 1/1] ArmPkg/ArmGic: Fix GICR_IPRIORITYR address wrong issue To: devel@edk2.groups.io, huangming@linux.alibaba.com, ardb+tianocore@kernel.org, leif@nuviainc.com References: <20210223110642.90020-1-huangming@linux.alibaba.com> From: "Heyi Guo" Message-ID: <09c64a00-9334-a778-8b0d-b943cb5319d7@linux.alibaba.com> Date: Tue, 23 Feb 2021 20:58:14 +0800 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.16; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210223110642.90020-1-huangming@linux.alibaba.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US On 2021/2/23 下午7:06, Ming Huang wrote: > The register address of GICR_IPRIORITYR is in SGI_base frame. Add > IPRIORITY_ADDRESS macro for getting GICR_IPRIORITYR address. Otherwise > GIC RAS error(Uncorrected software error) may report in ArmGicDxe. > --- > ArmPkg/Drivers/ArmGic/ArmGicLib.c | 5 ++++- > 1 file changed, 4 insertions(+), 1 deletion(-) > > diff --git a/ArmPkg/Drivers/ArmGic/ArmGicLib.c b/ArmPkg/Drivers/ArmGic/ArmGicLib.c > index 8ef32b33a1..b4d3965acb 100644 > --- a/ArmPkg/Drivers/ArmGic/ArmGicLib.c > +++ b/ArmPkg/Drivers/ArmGic/ArmGicLib.c > @@ -30,6 +30,9 @@ > #define ICENABLER_ADDRESS(base,offset) ((base) + \ > ARM_GICR_CTLR_FRAME_SIZE + ARM_GICR_ICENABLER + (4 * offset)) > > +#define IPRIORITY_ADDRESS(base,offset) ((base) + \ > + ARM_GICR_CTLR_FRAME_SIZE + ARM_GIC_ICDIPR + (4 * offset)) For macro parameter, I think we need to put "offset" in parentheses, and it is not necessary to put 4 * offset inside parentheses. How about adding one more patch to fix the existing macros ICENABLER_ADDRESS and ISENABLER_ADDRESS first and then this patch? Thanks, Heyi > + > /** > * > * Return whether the Source interrupt index refers to a shared interrupt (SPI) > @@ -236,7 +239,7 @@ ArmGicSetInterruptPriority ( > } > > MmioAndThenOr32 ( > - GicCpuRedistributorBase + ARM_GIC_ICDIPR + (4 * RegOffset), > + IPRIORITY_ADDRESS (GicCpuRedistributorBase, RegOffset), > ~(0xff << RegShift), > Priority << RegShift > );