From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mout01.posteo.de (mout01.posteo.de [185.67.36.65]) by mx.groups.io with SMTP id smtpd.web11.3351.1681805925889766485 for ; Tue, 18 Apr 2023 01:18:46 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@posteo.de header.s=2017 header.b=qK/LrFxL; spf=pass (domain: posteo.de, ip: 185.67.36.65, mailfrom: mhaeuser@posteo.de) Received: from submission (posteo.de [185.67.36.169]) by mout01.posteo.de (Postfix) with ESMTPS id 2DC18240085 for ; Tue, 18 Apr 2023 10:18:43 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1681805924; bh=MqUsEFeRQPu4qa9IUK/+CMdAkY7Et6fS4UZgrteKHhw=; h=Subject:From:Date:Cc:To:From; b=qK/LrFxLQ/gmkOWlEiG1Oc4GzUQ9EZXM2eT3w/HVHTO7UxSAZiFIdWWqfotqPQ5mU Mgv2yFMvtb3oR6g9Jz4rxex1C4T1FDpMrU55gqZ2I57yiYjzzVC3WOxQKjOCed0YC6 NfJFPgFtom6uH2LoxdBwjm6V881QAwS6rgqnLiX6j28pz1p4A8hcfXWpltNQ6QNeoV eDYtYuiZAdk1e9F1Ni9/cq7o0MDl94VbHwzY3jyuxKr9rr/izKtYbWdjWdG4ewlLev qgG1duCgScMozSzvyTdG4z6wwyYpZ0XrfnPAudlr6kFQqFIb2pfp2UmihFZ9d4ypQ6 fhzaxJSo8qR9Q== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Q0xdZ6g3Kz9rxL; Tue, 18 Apr 2023 10:18:42 +0200 (CEST) Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3731.500.231\)) Subject: Re: [PATCH 1/2] ArmPkg/AsmMacroIoLibV8: Introduce ASM_FUNC_ALIGN() From: =?UTF-8?B?TWFydmluIEjDpHVzZXI=?= In-Reply-To: Date: Tue, 18 Apr 2023 08:18:32 +0000 Cc: Leif Lindholm , edk2-devel-groups-io , Ard Biesheuvel , Sami Mujawar , Vitaly Cheptsov Message-Id: References: <46CED01C-BEA6-49F3-9634-051DC63D248C@posteo.de> To: Ard Biesheuvel Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable > On 18. Apr 2023, at 10:10, Ard Biesheuvel wrote: >=20 > On Tue, 18 Apr 2023 at 08:40, Marvin H=C3=A4user = wrote: >>=20 >>=20 >>> On 17. Apr 2023, at 23:18, Ard Biesheuvel wrote: >>>=20 >>> Agree with all of this. >>>=20 >>> And thanks for tracking this down - must not have been fun :-) >>=20 >> No worries - it wasn=E2=80=99t. :) It was mere luck Vitaly discovered = early it was an issue that triggered based on the binary layout rather = than a bug in the mapping code itself=E2=80=A6 >>=20 >> Speaking of not fun to track down, I initially wanted to add ASSERTs = (yes, runtime :( ) to check the alignment guarantee is actually met. = Leif basically declined any form of regression-testing at runtime. Do = you happen to have a simple(!) idea for how it could be checked at = build-time? (It=E2=80=99s less about =E2=80=9Cwhich commands do I = run?=E2=80=9D and more about integration with the build process / = BaseTools, cross-OS compatibility, etc.) >>=20 >=20 >=20 > I think we should just add another align to the code: >=20 > .align xx > func: >=20 > < code > >=20 > .align xx > .org func + xx >=20 > That way, if the code straddles a xx-aligned boundary, the .org will > move backwards and force an error. Wow, that's pretty fucking smart... I didn't even know that directive = was a thing. I will try to toy with it soon. Do you want it as a = separate series, separate commit in the current series, or squashed into = the fix?=