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 1B6DE941DB6 for ; Tue, 26 Mar 2024 20:07:30 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=1FiUTzOkcN0iC+RWRrR3XlCChoXMX+OnndsAnYAG4So=; 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:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type; s=20240206; t=1711483649; v=1; b=FZCELH0ORa5NSzZwPasx0UAKMELnIYy4EtKeH1vZ58bcFdCZDRkOUhPUcZD6qmLBfPlgJ4Q4 ezSJ7meD4U68pkLUI7SQQVck87m+Glyw6McEpndEyiyMn+06va1P9bTGSpUEbGHwdRFtIgWhYFy qEhcQ6yEsw+25/ErSaJcRRQjhpzOv2cmQ0oCDxonGemABcI7IYxXzt5Lm7qpl3i+J0kWDDaheCy NETpVW7NVL6d4wVoskXoxVPhoQENP8PS/4EaXuZbsvrNeq9KgRajCQ86HPEzJAEnP8UWxBpwOQl SOAQKMmvodda/jkBkZNtrVZlNwsyBsknr05KEwmrF+znQ== X-Received: by 127.0.0.2 with SMTP id edUnYY7687511xiKi1Tf3gEA; Tue, 26 Mar 2024 13:07:29 -0700 X-Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web11.20400.1711483649106069614 for ; Tue, 26 Mar 2024 13:07:29 -0700 X-Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 91FC861419 for ; Tue, 26 Mar 2024 20:07:28 +0000 (UTC) X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3C8E4C433B2 for ; Tue, 26 Mar 2024 20:07:28 +0000 (UTC) X-Received: by mail-lj1-f181.google.com with SMTP id 38308e7fff4ca-2d68cf90ec4so98264041fa.1 for ; Tue, 26 Mar 2024 13:07:28 -0700 (PDT) X-Gm-Message-State: doLvNqdMrokYhSxK7yEOFliGx7686176AA= X-Google-Smtp-Source: AGHT+IHYa49E71PBeq0/RtW0eOCNAgJBqGi46ODBnNpylxqUjqxX0DNcs5xqESez8GSmr5+JKxxfFBMKWJbuapgrcrI= X-Received: by 2002:a2e:8903:0:b0:2d6:ef64:b48d with SMTP id d3-20020a2e8903000000b002d6ef64b48dmr1478903lji.10.1711483646402; Tue, 26 Mar 2024 13:07:26 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: "Ard Biesheuvel" Date: Tue, 26 Mar 2024 22:07:14 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [PATCH 1/1] OvmfPkg: Align the SEC module within OvmfPkgX64 To: devel@edk2.groups.io, ggriffiniii@gmail.com, Andrew Fish , Michael Kinney , Jiewen Yao 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: Tue, 26 Mar 2024 13:07:29 -0700 Reply-To: devel@edk2.groups.io,ardb@kernel.org List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: Content-Type: text/plain; charset="UTF-8" X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=FZCELH0O; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=kernel.org (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 Tue, 26 Mar 2024 at 22:01, Glenn Griffin wrote: > > Prior to this change the alignment of the SEC module would be 4 bytes. > This is inconsistent with the expectations of the compiler and can lead > to unexpected behavior. > > For example a modern version of clang with size optimizations enabled > (-Oz) can break the ALIGN_POINTER macro in the SEC module. > ... > > However by mapping the data section that contains mArray onto a > 4-byte-aligned base address we violate the compiler's expectations. The > last 4 bits of the mArray address are no longer zeroes leading to an > ALIGN_POINTER macro that doesn't work. > > Cc: Ard Biesheuvel > > Signed-off-by: Glenn Griffin > --- > OvmfPkg/OvmfPkgX64.fdf | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf > index eb3fb90cb8b6..8b60355de40b 100644 > --- a/OvmfPkg/OvmfPkgX64.fdf > +++ b/OvmfPkg/OvmfPkgX64.fdf > @@ -434,7 +434,7 @@ [FV.FVMAIN_COMPACT] > > [Rule.Common.SEC] > FILE SEC = $(NAMED_GUID) { > - PE32 PE32 $(INF_OUTPUT)/$(MODULE_NAME).efi > + PE32 PE32 Align=Auto $(INF_OUTPUT)/$(MODULE_NAME).efi > UI STRING ="$(MODULE_NAME)" Optional > VERSION STRING ="$(INF_VERSION)" Optional BUILD_NUM=$(BUILD_NUMBER) > } Thanks Glenn. As you have mentioned to me off-list, this is the same issue Andrew reported here Link: https://bugzilla.tianocore.org/show_bug.cgi?id=3887 Your fix is obviously correct, and I intend to merge it unless anyone has any concerns with this. -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#117140): https://edk2.groups.io/g/devel/message/117140 Mute This Topic: https://groups.io/mt/105165329/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-