From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f42.google.com (mail-wm1-f42.google.com [209.85.128.42]) by mx.groups.io with SMTP id smtpd.web09.9390.1614085347155391979 for ; Tue, 23 Feb 2021 05:02:27 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@nuviainc-com.20150623.gappssmtp.com header.s=20150623 header.b=hwkP8aC8; spf=pass (domain: nuviainc.com, ip: 209.85.128.42, mailfrom: leif@nuviainc.com) Received: by mail-wm1-f42.google.com with SMTP id o16so434581wmh.0 for ; Tue, 23 Feb 2021 05:02:26 -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:content-transfer-encoding:in-reply-to :user-agent; bh=yAcbBgcmqWROON5tt7/P3nGpK2xxokIhtVmOfuBBweM=; b=hwkP8aC8HStrCPBJJsJHC3khJo1/5MVCVRVRGKrczBG6ZL0USxStdh9V1DA38R36ki v6e1jyNz5pclXYWmZy73rjPppcXMEWm67tKsvgtsliNZ+8rO4r7kuYMz4HMzr4Hs2jMp Mel8GTQbwZHJS1d3LL9xwYQx/0W42u+MCTsmNyPlZraDYocNX1NsOztoWWenuIiImujT XxeH3EMr9zjwkoA20OtIcRITDD208/mVtdnZXBirrTd4AB6lcGKfnK3lY/J+Zbkql3kE ADmZt8KUxkMk42RNldWa3ZzBEIzH7rh4pwFiX82+wg1jsRHSoZdkIFoNpkWI5MeDOaeN tujg== 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:content-transfer-encoding :in-reply-to:user-agent; bh=yAcbBgcmqWROON5tt7/P3nGpK2xxokIhtVmOfuBBweM=; b=CnrkxS6m3FgTvavMpMsIoOMoRr0OvqGFVn8G/3xv2LBncy5d7aU1swosXd68rP4esw 4SPCSVAyPNoWrSJxLBjN9xsUYEbwuOQDX/n5niTRvIDp61Ok+amEBosNx38rkTpHsR3X oUkuoIPgEXJ80hLYnT4ozcKrSipWcKcOMtBSwyxxRTuE1xsab1ZrIhlGgUDQkotEzDdH EF8iMARtEyvHxpmY4s+oKCRaJ/3AHh/6Y/eVK9lMp6z4JAg9TtsZ4cuGB51tNYmAKw39 jKT29sDMmP5Qgk4tzm65+sz+jFd4wadtoymXy9K5ilv3Siy6hUc/tjh1tTNWdQ4QC5w/ rOEg== X-Gm-Message-State: AOAM532AifMeHwdub7dvIgpBVPzSvflA+22xy8mjmwAcjBdJzUBltlvx X9Sm2Km80jdIi69qThKIycispuiiojpEztwgrAqrSFVg97cCXnglBdjpOEVj8n625DtpfVtKCkS Ok5IBP0G9XTH3Tb+lxDIJY69DEu9+ML8u7/KnXCwIDpplPEgwv0Jr0C6M7iA9GBB0Nw== X-Google-Smtp-Source: ABdhPJxMxQDU5wP3rM+uWxpmtY5utjOO5jsyWZ7GadhWy5nLBfkw/kvj5bAaqYqMq7q/ZBO5YEFqLQ== X-Received: by 2002:a1c:a90e:: with SMTP id s14mr24965471wme.36.1614085345477; Tue, 23 Feb 2021 05:02:25 -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 y5sm15863686wrh.38.2021.02.23.05.02.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Feb 2021 05:02:24 -0800 (PST) Date: Tue, 23 Feb 2021 13:02:22 +0000 From: "Leif Lindholm" To: devel@edk2.groups.io, guoheyi@linux.alibaba.com Cc: huangming@linux.alibaba.com, ardb+tianocore@kernel.org Subject: Re: [edk2-devel] [PATCH edk2 v2 1/1] ArmPkg/ArmGic: Fix GICR_IPRIORITYR address wrong issue Message-ID: <20210223130222.GB1664@vanye> References: <20210223110642.90020-1-huangming@linux.alibaba.com> <09c64a00-9334-a778-8b0d-b943cb5319d7@linux.alibaba.com> MIME-Version: 1.0 In-Reply-To: <09c64a00-9334-a778-8b0d-b943cb5319d7@linux.alibaba.com> User-Agent: Mutt/1.10.1 (2018-07-13) Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Tue, Feb 23, 2021 at 20:58:14 +0800, Heyi Guo wrote: > > 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. You are correct. > How about adding one more patch to fix the existing macros ICENABLER_ADDRESS > and ISENABLER_ADDRESS first and then this patch? If Ming could spin that at the same time as adding Signed-off-by, that would be ideal. Thanks! / Leif > 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 > > ); > > > > >