From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id E31D4AC1198 for ; Wed, 13 Dec 2023 18:02:06 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=VZLiADojGyGHYFlMhoPElxmKoBbyqdJGZjhin//GqnY=; c=relaxed/simple; d=groups.io; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20140610; t=1702490525; v=1; b=Y9Ur6t/4ShAH3OrrAQD5v6LIvpgA7lXT0NGER/q9edh6oLEow3uwvlpyTqWZyUiKAEweS157 m81iPNUtZDlb+ZmVbyjGK95+eTkwxapjDPZJN7Se8/jS4+9x/cjsTI5awv2fb0JvyjIxcRsAPDJ 9bRFAFmbe7JrpkXCCoVnYmkQ= X-Received: by 127.0.0.2 with SMTP id CiMPYY7687511x7u8DZL3jSj; Wed, 13 Dec 2023 10:02:05 -0800 X-Received: from mail-oo1-f50.google.com (mail-oo1-f50.google.com [209.85.161.50]) by mx.groups.io with SMTP id smtpd.web10.43606.1702490525013605038 for ; Wed, 13 Dec 2023 10:02:05 -0800 X-Received: by mail-oo1-f50.google.com with SMTP id 006d021491bc7-59067ccb090so4629332eaf.1 for ; Wed, 13 Dec 2023 10:02:04 -0800 (PST) X-Gm-Message-State: P1uGJOHFErvexLe1s1AzfMHpx7686176AA= X-Google-Smtp-Source: AGHT+IE/L9dzDDU9HwhmuS64LIHNaHUBRJO43kKmcBmWDHIy8Bb1IV2rfLoVaw0yDBz/C6SH9mKsErKNpM9MRy0x9SA= X-Received: by 2002:a05:6358:cc1e:b0:16d:bc07:7d2f with SMTP id gx30-20020a056358cc1e00b0016dbc077d2fmr7824502rwb.15.1702490524227; Wed, 13 Dec 2023 10:02:04 -0800 (PST) MIME-Version: 1.0 References: In-Reply-To: From: "Pedro Falcato" Date: Wed, 13 Dec 2023 18:01:52 +0000 Message-ID: Subject: Re: [edk2-devel] [PATCH] BaseTools/GenFw: Change opcode when converting ADR to ADRP To: Ard Biesheuvel Cc: Jake Garver , "devel@edk2.groups.io" , "rebecca@bsdio.com" , "gaoliming@byosoft.com.cn" , "bob.c.feng@intel.com" , "yuwei.chen@intel.com" 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 Reply-To: devel@edk2.groups.io,pedro.falcato@gmail.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20140610 header.b="Y9Ur6t/4"; 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 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io On Wed, Dec 13, 2023 at 5:31=E2=80=AFPM Ard Biesheuvel wr= ote: > > On Wed, 13 Dec 2023 at 15:58, Jake Garver wrote: > > > > Totally understand and agree, Ard. > > > > In the meantime, I've now experienced the issue with Ubuntu22's GCC 12.= 3. Originally, we didn't see the issue on this toolchain, but a developer = ran into when preparing a change. Even more concerning, when I instrumente= d that change, it went away. So, it seems to be very sensitive to the inpu= t, which will make it hard to reproduce. > > > > Specifically, like the Ubuntu20 10.5 toolchain, the Ubuntu 12.3 toolcha= in generated an R_AARCH64_ADR_GOT_PAGE relocation against an ADR instructio= n. Further, it was when loading the value of __stack_chk_guard. > > > > I was again unable to reproduce this using a crosstool-ng build of GCC = 12.3, even when matching the ./configure arguments. > > > > Since it's now reproducible in a toolchain we're actively using, I'll c= ontinue looking at it. I'll let you know what I find. > > OK, mystery solved. > > # Load to set the stack canary > 2ffc: 10000480 adr x0, 0x308c > 3008: 912ec000 add x0, x0, #0xbb0 > > The location of the ADRP instruction is at the end of a 4k page > (0xffc), which could trigger erratum #843419 on Cortex-A53, and is > therefore converted into ADR. Ha! Great deduction! And because GCC builds don't turn on the a53 ADRP errata by default, the toolchains Jake built weren't catching this issue. --=20 Pedro -=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 (#112489): https://edk2.groups.io/g/devel/message/112489 Mute This Topic: https://groups.io/mt/102202314/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-