From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 62FCF941F1B for ; Thu, 25 Apr 2024 22:04:10 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=5D6hVlRbCVsHZLnGt68sZxmroVtFZOGvT7l+pHTcGhE=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20240206; t=1714082649; v=1; b=eJ+d6vRggaJ0pnkZXR9sOaVXa1Lm/ZoY0IHXFoG/Qloy8MqOhdr1AUkdnz4Ile2Hy/8TSm3i aMN+nA1/1ZgCTzRSkZwesa2YWefNu02LhCqcYQsPGxSsyA7g/HCFyYfDqqs80/zXoChhziZPqE4 UuONmrMfe3cOrEZk7pZFD+a5q/y0H5lgdJHQW6yW6gadYNJbUYZi7fGkqnePPteLXcvbWCnHKLp zykbu3HliJJ/tr9kgw3pYh5wGU0uH8LPFv/x/NJuiRT6CPg6k2hUK663rn/UMA5oQ7yswbgEgbl IgR3nY0hUkLidkVB6SGbjRx4pPONJMmzZ96bkkyRZxh0Q== X-Received: by 127.0.0.2 with SMTP id TzBfYY7687511xEbHhWhrB2h; Thu, 25 Apr 2024 15:04:09 -0700 X-Received: from mail-ej1-f45.google.com (mail-ej1-f45.google.com [209.85.218.45]) by mx.groups.io with SMTP id smtpd.web10.11866.1714032728497366327 for ; Thu, 25 Apr 2024 01:12:08 -0700 X-Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-a58bd410f92so21029166b.0 for ; Thu, 25 Apr 2024 01:12:08 -0700 (PDT) X-Forwarded-Encrypted: i=1; AJvYcCUKZ91xkmcleLnX9lzqme4EngDBXi7teLBxVxYcF8mQn0rj+YGWt2DjrWXW54id/QplfAVKCFE4wNCBYrnUlJeeGmGtOA== X-Gm-Message-State: l3aPbINawNQKf7vgpSEhXRxJx7686176AA= X-Google-Smtp-Source: AGHT+IE9a4AkeSujUgJhGd8YZl2u77SXgiWYYpMYrFzzMHaREtt7FuJ5KYqH0H5C9pVqkZySMqMvag00V3z2GnbKfHE= X-Received: by 2002:a17:906:5653:b0:a51:982e:b3f7 with SMTP id v19-20020a170906565300b00a51982eb3f7mr3215694ejr.37.1714032726586; Thu, 25 Apr 2024 01:12:06 -0700 (PDT) MIME-Version: 1.0 References: <157C60A3-DE16-457C-9651-7987CCD07B93@apple.com> In-Reply-To: <157C60A3-DE16-457C-9651-7987CCD07B93@apple.com> From: Ba Gia Bao Phan Date: Thu, 25 Apr 2024 10:11:55 +0200 Message-ID: Subject: Re: [edk2-devel] Synchronous Exception at ArmGicDxe To: "Andrew (EFI) Fish" , devel@edk2.groups.io Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Thu, 25 Apr 2024 15:04:07 -0700 Resent-From: phanbagiabao2001@gmail.com Reply-To: devel@edk2.groups.io,phanbagiabao2001@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: multipart/alternative; boundary="000000000000cd407c0616e757a3" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=eJ+d6vRg; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=gmail.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io --000000000000cd407c0616e757a3 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable It is near to the GicDistributorBase (0x4ac10000) of STM32MP25 Le jeu. 25 avr. 2024 =C3=A0 02:21, Andrew (EFI) Fish a = =C3=A9crit : > The fault address is 0x00000004AC100004. Is that in the address range of > the GIC for this platform? What does that Physical address map to you on > the STM32MP25? > > Thanks, > > Andrew Fish > > On Apr 21, 2024, at 10:07=E2=80=AFPM, Ba Gia Bao Phan > wrote: > > Hi Everyone, > > I'm working on a project with edk2, and these guys are trying to port edk= 2 > to STM32MP25 platforms. I had no issue compiling and booting the image on > my device. Then I've come across an issue at very early stages of booting= . > I was given a Synchronous Exception listed briefly below. > > Synchronous Exception at *0x000000010A63501C* > PC 0x00010A63501C (0x00010A633000+0x0000201C) [ 0] ArmGicDxe.dll > PC 0x00010A6350CC (0x00010A633000+0x000020CC) [ 0] ArmGicDxe.dll > PC 0x00010A63657C (0x00010A633000+0x0000357C) [ 0] ArmGicDxe.dll > PC 0x00010A85853C (0x00010A851000+0x0000753C) [ 1] DxeCore.dll > PC 0x00010A8666DC (0x00010A851000+0x000156DC) [ 1] DxeCore.dll > PC 0x00010A85BF14 (0x00010A851000+0x0000AF14) [ 1] DxeCore.dll > PC 0x000084006EBC > PC 0x00008400700C > > [ 0] > /local/home/phanbagi/Documents/RPi3/Build/STM32MP25/DEBUG_GCC5/AARCH64/Ar= mPkg/Drivers/ArmGic/ArmGicDxe/DEBUG/ArmGicDxe.dll > [ 1] > /local/home/phanbagi/Documents/RPi3/Build/STM32MP25/DEBUG_GCC5/AARCH64/Md= eModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll > > X0 0x00000004AC100004 X1 0x0000000000000000 X2 0x0000000000000000 > X3 0x4F46A76E3FDDA605 > X4 0x083D1B53F41229AD X5 0x00000000003CF238 X6 0x0000000000000080 > X7 0x0000000000000000 > X8 0x000000010A850688 X9 0x0000000400000000 X10 0x0000000109E9F000 > X11 0x000000010A297FFF > X12 0x0000000000000000 X13 0x000000000000000E X14 0x00000000000000FF > X15 0x0000000000000002 > X16 0x000000010AFFFAD0 X17 0x0000000000395790 X18 0x0000000000000000 > X19 0x00000004AC100004 > X20 0x000000010A638000 X21 0x000000010A638000 X22 0x000000010A638000 > X23 0x000000010A6380A8 > X24 0x000000010A876448 X25 0x000000010A873026 X26 0x000000010A877000 > X27 0x800000000000000E > X28 0x0000000000000001 FP 0x000000010AFFFA50 LR 0x000000010A6350CC > > V0 0xAFAFAFAFAFAFAFAF AFAFAFAFAFAFAFAF V1 0xFFFFFF80FFFFFFD0 > 000000010AFFFA30 > V2 0x00000007AAAA0000 000000000E001858 V3 0x0000100000000000 > 0000000000000100 > V4 0x0000000000000000 0000000000000000 V5 0x0000000000000000 > 0000000000000000 > V6 0x0000000000000000 0000000000000000 V7 0x0000000000000000 > 0000000000000000 > V8 0x0000000000000000 0000000000000000 V9 0x0000000000000000 > 0000000000000000 > V10 0x0000000000000000 0000000000000000 V11 0x0000000000000000 > 0000000000000000 > V12 0x0000000000000000 0000000000000000 V13 0x0000000000000000 > 0000000000000000 > V14 0x0000000000000000 0000000000000000 V15 0x0000000000000000 > 0000000000000000 > V16 0x6145998C70863CB0 9004002B4AC68640 V17 0x646586E820A5D596 > AA30249EC11F1469 > V18 0x5756252D20E5B421 336EEAEC2122B3AB V19 0x6285C083AAECD063 > 020A72C37700322A > V20 0x40846C68BA2085FB 20966526601C44BB V21 0x818208204CD0A89D > 6D84E94813E14B24 > V22 0x2362CBA9962AF073 E83ED49CD4A13F98 V23 0x0C1123CD73F5C5B0 > C3E9222891467015 > V24 0x02B1194895858177 1B028BE1A860D73B V25 0x542AB00936183D90 > 752F1D1CCC4D2345 > V26 0x03D02013962356F3 0CCA6F83842045EA V27 0x9DF9D2A28D44915E > 2892460B223FD84C > V28 0x61A2CC120A809CD8 AC33034803D74C10 V29 0x7A1089709810B030 > 88B3298EEB68B450 > V30 0xD20F81310E0896C0 20E2BA370E2AC6F9 V31 0x6C3BBEA030B2BB50 > 2C2A91AAF201EF50 > > SP 0x000000010AFFFA50 ELR 0x000000010A63501C SPSR 0x400003C5 FPSR > 0x00000000 > ESR 0x96000005 FAR 0x00000004AC100004 > > ESR : EC 0x25 IL 0x1 ISS 0x00000005 > > Data abort: Translation fault, first level > > > By using objdump to determine where the wrong source code is, I found out > that the program stopped around the code below. > > UINT32 > EFIAPI > MmioRead32 ( > IN UINTN Address > ) > { > UINT32 Value; > BOOLEAN Flag; > > ASSERT ((Address & 3) =3D=3D 0); > > Flag =3D FilterBeforeMmIoRead (FilterWidth32, Address, &Value); > if (Flag) { > MemoryFence (); > > if (IsTdxGuest ()) { > Value =3D TdMmioRead32 (Address); > } else { > Value =3D *(volatile UINT32 *)Address; > } > > MemoryFence (); > } > > FilterAfterMmIoRead (FilterWidth32, Address, &Value); > > return Value; > } > > Output of objdump: > UINT32 > EFIAPI > MmioRead32 ( > IN UINTN Address > ) > { > 1fec: a9be7bfd stp x29, x30, [sp, #-32]! > 1ff0: 910003fd mov x29, sp > 1ff4: f9000bf3 str x19, [sp, #16] > 1ff8: aa0003f3 mov x19, x0 > UINT32 Value; > BOOLEAN Flag; > > ASSERT ((Address & 3) =3D=3D 0); > 1ffc: f240041f tst x0, #0x3 > 2000: 540000e0 b.eq 201c // b.none > 2004: b0000002 adrp x2, 3000 > 2008: b0000000 adrp x0, 3000 > 200c: 913ac442 add x2, x2, #0xeb1 > 2010: 913b1000 add x0, x0, #0xec4 > 2014: d2804461 mov x1, #0x223 // #547 > 2018: 97ffff7a bl 1e00 > > Flag =3D FilterBeforeMmIoRead (FilterWidth32, Address, &Value); > if (Flag) { > > * Value =3D *(volatile UINT32 *)Address; 201c: b9400260 ldr w0, [x1= 9]* > } > > FilterAfterMmIoRead (FilterWidth32, Address, &Value); > > return Value; > } > > Thanks > -- > PHAN Ba Gia Bao > Etudiant en 5A STI - INSA Centre Val de Loire >=20 > > > --=20 PHAN Ba Gia Bao Etudiant en 5A STI - INSA Centre Val de Loire -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#118303): https://edk2.groups.io/g/devel/message/118303 Mute This Topic: https://groups.io/mt/105721886/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- --000000000000cd407c0616e757a3 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
It is near to the GicDistributorBase (0x4ac10000) of STM32= MP25

Le=C2=A0jeu. 25 avr. 2024 =C3=A0=C2=A002:21, Andrew (EFI) Fish <= afish@apple.com> a =C3=A9crit=C2= =A0:
The fa= ult address is 0x00000004AC100004. Is that in the address range of the GIC = for this platform? What does that Physical address map to you on the STM32M= P25?

Thanks,

Andrew Fish

On Apr 21, 2024, at 10:07=E2=80=AFPM, = Ba Gia Bao Phan <phanbagiabao2001@gmail.com> wrote:

Hi Everyone,

I'm working on a project with= edk2, and these guys are trying to port edk2 to STM32MP25 platforms. I had= no issue compiling and booting the image on my device. Then I've come = across an issue at very early stages of booting. I was given a Synchronous = Exception=C2=A0listed briefly below.=C2=A0

Synchronous = Exception at=C2=A00x000000010A63501C
PC 0x00010A6350= 1C (0x00010A633000+0x0000201C) [ 0] ArmGicDxe.dll
PC 0x00010A6350CC (0x0= 0010A633000+0x000020CC) [ 0] ArmGicDxe.dll
PC 0x00010A63657C (0x00010A63= 3000+0x0000357C) [ 0] ArmGicDxe.dll
PC 0x00010A85853C (0x00010A851000+0x= 0000753C) [ 1] DxeCore.dll
PC 0x00010A8666DC (0x00010A851000+0x000156DC)= [ 1] DxeCore.dll
PC 0x00010A85BF14 (0x00010A851000+0x0000AF14) [ 1] Dxe= Core.dll
PC 0x000084006EBC
PC 0x00008400700C

[ 0] /local/home/= phanbagi/Documents/RPi3/Build/STM32MP25/DEBUG_GCC5/AARCH64/ArmPkg/Drivers/A= rmGic/ArmGicDxe/DEBUG/ArmGicDxe.dll
[ 1] /local/home/phanbagi/Documents/= RPi3/Build/STM32MP25/DEBUG_GCC5/AARCH64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG= /DxeCore.dll

=C2=A0 X0 0x00000004AC100004 =C2=A0 X1 0x00000000000000= 00 =C2=A0 X2 0x0000000000000000 =C2=A0 X3 0x4F46A76E3FDDA605
=C2=A0 X4 0= x083D1B53F41229AD =C2=A0 X5 0x00000000003CF238 =C2=A0 X6 0x0000000000000080= =C2=A0 X7 0x0000000000000000
=C2=A0 X8 0x000000010A850688 =C2=A0 X9 0x0= 000000400000000 =C2=A0X10 0x0000000109E9F000 =C2=A0X11 0x000000010A297FFF=C2=A0X12 0x0000000000000000 =C2=A0X13 0x000000000000000E =C2=A0X14 0x000= 00000000000FF =C2=A0X15 0x0000000000000002
=C2=A0X16 0x000000010AFFFAD0 = =C2=A0X17 0x0000000000395790 =C2=A0X18 0x0000000000000000 =C2=A0X19 0x00000= 004AC100004
=C2=A0X20 0x000000010A638000 =C2=A0X21 0x000000010A638000 = =C2=A0X22 0x000000010A638000 =C2=A0X23 0x000000010A6380A8
=C2=A0X24 0x00= 0000010A876448 =C2=A0X25 0x000000010A873026 =C2=A0X26 0x000000010A877000 = =C2=A0X27 0x800000000000000E
=C2=A0X28 0x0000000000000001 =C2=A0 FP 0x00= 0000010AFFFA50 =C2=A0 LR 0x000000010A6350CC =C2=A0

=C2=A0 V0 0xAFAFA= FAFAFAFAFAF AFAFAFAFAFAFAFAF =C2=A0 V1 0xFFFFFF80FFFFFFD0 000000010AFFFA30<= br>=C2=A0 V2 0x00000007AAAA0000 000000000E001858 =C2=A0 V3 0x00001000000000= 00 0000000000000100
=C2=A0 V4 0x0000000000000000 0000000000000000 =C2=A0= V5 0x0000000000000000 0000000000000000
=C2=A0 V6 0x0000000000000000 000= 0000000000000 =C2=A0 V7 0x0000000000000000 0000000000000000
=C2=A0 V8 0x= 0000000000000000 0000000000000000 =C2=A0 V9 0x0000000000000000 000000000000= 0000
=C2=A0V10 0x0000000000000000 0000000000000000 =C2=A0V11 0x000000000= 0000000 0000000000000000
=C2=A0V12 0x0000000000000000 0000000000000000 = =C2=A0V13 0x0000000000000000 0000000000000000
=C2=A0V14 0x00000000000000= 00 0000000000000000 =C2=A0V15 0x0000000000000000 0000000000000000
=C2=A0= V16 0x6145998C70863CB0 9004002B4AC68640 =C2=A0V17 0x646586E820A5D596 AA3024= 9EC11F1469
=C2=A0V18 0x5756252D20E5B421 336EEAEC2122B3AB =C2=A0V19 0x628= 5C083AAECD063 020A72C37700322A
=C2=A0V20 0x40846C68BA2085FB 20966526601C= 44BB =C2=A0V21 0x818208204CD0A89D 6D84E94813E14B24
=C2=A0V22 0x2362CBA99= 62AF073 E83ED49CD4A13F98 =C2=A0V23 0x0C1123CD73F5C5B0 C3E9222891467015
= =C2=A0V24 0x02B1194895858177 1B028BE1A860D73B =C2=A0V25 0x542AB00936183D90 = 752F1D1CCC4D2345
=C2=A0V26 0x03D02013962356F3 0CCA6F83842045EA =C2=A0V27= 0x9DF9D2A28D44915E 2892460B223FD84C
=C2=A0V28 0x61A2CC120A809CD8 AC3303= 4803D74C10 =C2=A0V29 0x7A1089709810B030 88B3298EEB68B450
=C2=A0V30 0xD20= F81310E0896C0 20E2BA370E2AC6F9 =C2=A0V31 0x6C3BBEA030B2BB50 2C2A91AAF201EF5= 0

=C2=A0 SP 0x000000010AFFFA50 =C2=A0ELR 0x000000010A63501C =C2=A0SP= SR 0x400003C5 =C2=A0FPSR 0x00000000
=C2=A0ESR 0x96000005 =C2=A0 =C2=A0 = =C2=A0 =C2=A0 =C2=A0FAR 0x00000004AC100004

=C2=A0ESR : EC 0x25 =C2= =A0IL 0x1 =C2=A0ISS 0x00000005

Data abort: Translation fault, first = level


By using objdump to determine where the wrong source code = is, I found out that the program stopped around the code below.

UINT= 32
EFIAPI
MmioRead32 (
=C2=A0 IN =C2=A0 =C2=A0 =C2=A0UINTN =C2=A0A= ddress
=C2=A0 )
{
=C2=A0 UINT32 =C2=A0 Value;
=C2=A0 BOOLEAN = =C2=A0Flag;

=C2=A0 ASSERT ((Address & 3) =3D=3D 0);

=C2= =A0 Flag =3D FilterBeforeMmIoRead (FilterWidth32, Address, &Value);
= =C2=A0 if (Flag) {
=C2=A0 =C2=A0 MemoryFence ();

=C2=A0 =C2=A0 if= (IsTdxGuest ()) {
=C2=A0 =C2=A0 =C2=A0 Value =3D TdMmioRead32 (Address)= ;
=C2=A0 =C2=A0 } else {
=C2=A0 =C2=A0 =C2=A0 Value =3D *(volatile UI= NT32 *)Address;
=C2=A0 =C2=A0 }

=C2=A0 =C2=A0 MemoryFence ();
= =C2=A0 }

=C2=A0 FilterAfterMmIoRead (FilterWidth32, Address, &Va= lue);

=C2=A0 return Value;
}

Output of objdump:
UINT32<= br>EFIAPI
MmioRead32 (
=C2=A0 IN =C2=A0 =C2=A0 =C2=A0UINTN =C2=A0Addr= ess
=C2=A0 )
{
=C2=A0 =C2=A0 1fec: a9be7bfd stp x29, x30, [sp, #-3= 2]!
=C2=A0 =C2=A0 1ff0: 910003fd mov x29, sp
=C2=A0 =C2=A0 1ff4: f900= 0bf3 str x19, [sp, #16]
=C2=A0 =C2=A0 1ff8: aa0003f3 mov x19, x0
=C2= =A0 UINT32 =C2=A0 Value;
=C2=A0 BOOLEAN =C2=A0Flag;

=C2=A0 ASSERT= ((Address & 3) =3D=3D 0);
=C2=A0 =C2=A0 1ffc: f240041f tst x0, #0x3=
=C2=A0 =C2=A0 2000: 540000e0 b.eq 201c <MmioRead32+0x30> =C2=A0//= b.none
=C2=A0 =C2=A0 2004: b0000002 adrp x2, 3000 <MmioAndThenOr32.i= sra.0>
=C2=A0 =C2=A0 2008: b0000000 adrp x0, 3000 <MmioAndThenOr32= .isra.0>
=C2=A0 =C2=A0 200c: 913ac442 add x2, x2, #0xeb1
=C2=A0 = =C2=A0 2010: 913b1000 add x0, x0, #0xec4
=C2=A0 =C2=A0 2014: d2804461 mo= v x1, #0x223 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 // #54= 7
=C2=A0 =C2=A0 2018: 97ffff7a bl 1e00 <DebugAssert>

=C2=A0= Flag =3D FilterBeforeMmIoRead (FilterWidth32, Address, &Value);
=C2= =A0 if (Flag) {
=C2=A0 =C2=A0 Value =3D *(volatile UINT32 *)Address;<= br>=C2=A0 =C2=A0 201c: b9400260 ldr w0, [x19]
=C2=A0 }

=C2=A0= FilterAfterMmIoRead (FilterWidth32, Address, &Value);

=C2=A0 re= turn Value;
}

Thanks
--=C2=A0
PHAN Ba Gia Bao
Etudiant en 5A STI - IN= SA Centre Val de Loire

=


--
PHAN Ba Gia Bao
Etudiant en 5A STI - INS= A Centre Val de Loire
_._,_._,_

Groups.io Links:

=20 You receive all messages sent to this group. =20 =20

View/Reply Online (#118303) | =20 | Mute= This Topic | New Topic
Your Subscriptio= n | Contact Group Owner | Unsubscribe [rebecca@openfw.io]

_._,_._,_
--000000000000cd407c0616e757a3--