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.web10.3580.1681754989243162647 for ; Mon, 17 Apr 2023 11:09:49 -0700 Authentication-Results: mx.groups.io; dkim=fail reason="body hash did not verify" header.i=@posteo.de header.s=2017 header.b=giIqlQ/V; 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 B534C2401BB for ; Mon, 17 Apr 2023 20:09:46 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=posteo.de; s=2017; t=1681754986; bh=fOA/g/D0h5dpOf4rL0ZIFwuNK/6+HB8mkFa6WP6zl74=; h=From:To:Cc:Subject:Date:From; b=giIqlQ/VUjVI/UCHyV70EnhtDdrwN9Nf/O4dw/ddNdBT6B+qXwgivcXwdbBZq6he0 4D2uSE2vxxCQLjRRVmejTAS+ejg1aHc+PfZZmhFp8dSqwBWxyJ3w28WLF6D/gi/eu0 5b8xkRcYi4lOQx4PKGwLnpiYuWAZZfHSZuNXiUBPp36bz5C3LYb/AWOYgzz5mVo6gH 44S4jm6S3cia9YmnMk5yR6Xim+cEzrMusUUpFko+4nbB/koENyeXx8+Y3cltjCjzF/ 7EyGQgNtLdMnzT5CdbhLNB9dT6F8BYj7+87wdj1x9W8j0Cta3G3w43uy2eNN/w/grl zygBu+IWXkk+A== Received: from customer (localhost [127.0.0.1]) by submission (posteo.de) with ESMTPSA id 4Q0Zp15CF7z9rxG; Mon, 17 Apr 2023 20:09:45 +0200 (CEST) From: =?UTF-8?B?TWFydmluIEjDpHVzZXI=?= To: devel@edk2.groups.io Cc: =?UTF-8?q?Marvin=20Ha=CC=88user?= , Leif Lindholm , Ard Biesheuvel , Sami Mujawar , Vitaly Cheptsov Subject: [PATCH 2/2] ArmPkg/ArmMmuLib: Fix ArmReplaceLiveTranslationEntry() alignment Date: Mon, 17 Apr 2023 18:09:16 +0000 Message-Id: <20230417180916.95237-2-mhaeuser@posteo.de> In-Reply-To: <20230417180916.95237-1-mhaeuser@posteo.de> References: <20230417180916.95237-1-mhaeuser@posteo.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable As the ASM_FUNC() macro performs a section switch, the preceding .balign directive applies the alignment constraint to the current location in the previous section. As the linker may not merge the sections in-order, ArmReplaceLiveTranslationEntry() may be left unaligned. Replace the explicit invocation of .balign with the ASM_FUNC_ALIGN() macro, which guarantees the alignment constraint is applied correctly. Signed-off-by: Marvin H=C3=A4user Cc: Leif Lindholm Cc: Ard Biesheuvel Cc: Sami Mujawar Cc: Vitaly Cheptsov --- ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S b/A= rmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S index e936a5be4e11..7627aeb95464 100644 --- a/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S +++ b/ArmPkg/Library/ArmMmuLib/AArch64/ArmMmuLibReplaceEntry.S @@ -69,17 +69,16 @@ .L2_\@: .endm =20 - // Align this routine to a log2 upper bound of its size, so that it is - // guaranteed not to cross a page or block boundary. - .balign 0x200 - //VOID //ArmReplaceLiveTranslationEntry ( // IN UINT64 *Entry, // IN UINT64 Value, // IN UINT64 Address // ) -ASM_FUNC(ArmReplaceLiveTranslationEntry) +// +// Align this routine to a log2 upper bound of its size, so that it is +// guaranteed not to cross a page or block boundary. +ASM_FUNC_ALIGN(ArmReplaceLiveTranslationEntry, 0x200) =20 // disable interrupts mrs x4, daif --=20 2.40.0