From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail.byosoft.com.cn (mail.byosoft.com.cn [58.240.74.242]) by mx.groups.io with SMTP id smtpd.web12.1986.1621995729460729061 for ; Tue, 25 May 2021 19:22:10 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=none, err=permanent DNS error (domain: byosoft.com.cn, ip: 58.240.74.242, mailfrom: gaoliming@byosoft.com.cn) Received: from DESKTOPS6D0PVI ([58.246.60.130]) (envelope-sender ) by 192.168.6.13 with ESMTP for ; Wed, 26 May 2021 10:22:00 +0800 X-WM-Sender: gaoliming@byosoft.com.cn X-Originating-IP: 58.246.60.130 X-WM-AuthFlag: YES X-WM-AuthUser: gaoliming@byosoft.com.cn From: "gaoliming" To: , , Cc: , , , , , References: <20210524130130.22280-1-sami.mujawar@arm.com> In-Reply-To: Subject: =?UTF-8?B?5Zue5aSNOiBbZWRrMi1kZXZlbF0gW2VkazItZGV2ZWwyMDIxMDUgUEFUQ0ggdjIgMS8xXSBBcm1Qa2cvQXJtR2ljOiBGaXggbWF4aW11bSBudW1iZXIgb2YgaW50ZXJydXB0cyBpbiBHSUN2Mw==?= Date: Wed, 26 May 2021 10:22:02 +0800 Message-ID: <007e01d751d5$e9e23940$bda6abc0$@byosoft.com.cn> MIME-Version: 1.0 X-Mailer: Microsoft Outlook 16.0 Thread-Index: AQHNeds1RqbQMhqNd5QNgl+daW7fcQDwADgoqwE318A= Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Content-Language: zh-cn Laszlo, Ard, Sami: I am OK to merge this patch for stable tag 202105.=20 Thanks Liming > -----=E9=82=AE=E4=BB=B6=E5=8E=9F=E4=BB=B6----- > =E5=8F=91=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io = =E4=BB=A3=E8=A1=A8 Laszlo Ersek > =E5=8F=91=E9=80=81=E6=97=B6=E9=97=B4: 2021=E5=B9=B45=E6=9C=8825=E6=97=A5= 19:55 > =E6=94=B6=E4=BB=B6=E4=BA=BA: devel@edk2.groups.io; sami.mujawar@arm.com > =E6=8A=84=E9=80=81: ardb@kernel.org; leif@nuviainc.com; Matteo.Carlini@a= rm.com; > Andreas.Sandberg@arm.com; joey.gouly@arm.com; nd@arm.com > =E4=B8=BB=E9=A2=98: Re: [edk2-devel] [edk2-devel202105 PATCH v2 1/1] Arm= Pkg/ArmGic: > Fix maximum number of interrupts in GICv3 >=20 > Hi Sami, >=20 > On 05/24/21 15:01, Sami Mujawar wrote: > > From: Andreas Sandberg > > > > Bugzilla: 3415 (https://bugzilla.tianocore.org/show_bug.cgi?id=3D3415) > > > > The GICv3 architecture supports up to 1020 ordinary interrupt > > lines. The actual number of interrupts supported is described by the > > ITLinesNumber field in the GICD_TYPER register. The total number of > > implemented registers is normally calculated as > > 32*(ITLinesNumber+1). However, maximum value (0x1f) is a special case > > since that would indicate that 1024 interrupts are implemented. > > > > Add handling for this special case in ArmGicGetMaxNumInterrupts. > > > > Signed-off-by: Andreas Sandberg > > Signed-off-by: Joey Gouly > > Signed-off-by: Sami Mujawar > > Reviewed-by: Ard Biesheuvel > > --- > > The changes can be seen at: > > https://github.com/samimujawar/edk2/tree/1396_gic_max_num_intr_v2 > > > > Notes: > > v2: > > - Fix comment style. > [Laszlo] > > - Updated comment style. > [Sami] > > > > ArmPkg/Drivers/ArmGic/ArmGicLib.c | 11 +++++++++-- > > 1 file changed, 9 insertions(+), 2 deletions(-) >=20 > I think this patch should be merged really soon, as long as Ard agrees. >=20 > Thanks, > Laszlo >=20 > > > > diff --git a/ArmPkg/Drivers/ArmGic/ArmGicLib.c > b/ArmPkg/Drivers/ArmGic/ArmGicLib.c > > index > 6b01c88206ad8adef3100dd44c0d57660db77783..bd4b5edb903f3846f4f0e43 > 1f93e001f01cd9e7d 100644 > > --- a/ArmPkg/Drivers/ArmGic/ArmGicLib.c > > +++ b/ArmPkg/Drivers/ArmGic/ArmGicLib.c > > @@ -1,6 +1,6 @@ > > /** @file > > * > > -* Copyright (c) 2011-2018, ARM Limited. All rights reserved. > > +* Copyright (c) 2011-2021, Arm Limited. All rights reserved. > > * > > * SPDX-License-Identifier: BSD-2-Clause-Patent > > * > > @@ -120,7 +120,14 @@ ArmGicGetMaxNumInterrupts ( > > IN INTN GicDistributorBase > > ) > > { > > - return 32 * ((MmioRead32 (GicDistributorBase + ARM_GIC_ICDICTR) & > 0x1F) + 1); > > + UINTN ItLines; > > + > > + ItLines =3D MmioRead32 (GicDistributorBase + ARM_GIC_ICDICTR) & > 0x1F; > > + > > + // > > + // Interrupt ID 1020-1023 are reserved. > > + // > > + return (ItLines =3D=3D 0x1f) ? 1020 : 32 * (ItLines + 1); > > } > > > > VOID > > >=20 >=20 >=20 >=20 >=20