From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by mx.groups.io with SMTP id smtpd.web11.48555.1681933733798792643 for ; Wed, 19 Apr 2023 12:48:53 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=XFSXWJUp; spf=pass (domain: kernel.org, ip: 139.178.84.217, mailfrom: ardb@kernel.org) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 32896640C4 for ; Wed, 19 Apr 2023 19:48:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 95246C433EF for ; Wed, 19 Apr 2023 19:48:52 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1681933732; bh=IXRunyS6ZpTADkl9faXreezLo3ebccnavTjC3s22KeM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=XFSXWJUpnw1H4yEyxBNjJXVllPWFXZwm2y7atDl2NuXdmUUlLVyGIwWJn13m9YQ9/ Zd3WbikTZmH0nqw2KmgJt0Nc7RvPOeddYF7/9cZRB//bpFkoa+RBzl8nciNgv69ync cIeSsbQCyk+pQ1+IqCkAw1Lgg0pbEaFVu1hDD3CA+Mf8QTzygVopbi2oJLt2QToKTL Lq2LK4tuWFsbErtrYsdrDAj8CcboMglYMqZCY8n2AptbuNo1uiLw0VcCdtj/9AJNwg 1K3avamvz5F0RrIqEXDRQcGGcl2N33G30wjtxyE4iY/uNtyZEII7MDoUkL0W3evgLt JIpSX0cMX+DWQ== Received: by mail-lj1-f178.google.com with SMTP id y24so229566ljm.6 for ; Wed, 19 Apr 2023 12:48:52 -0700 (PDT) X-Gm-Message-State: AAQBX9e/YNrViHHHAxcXUmMGYUB+8RbKytZ4iLk6i+XZS3Y67Q6FI0oo SJ3rt6+19ATzD/nE3EDt2kfQJvm55IEc/CMNpXg= X-Google-Smtp-Source: AKy350Y1UO25We5BhYak90ijkwZgdZJw2JlnJynsup2cAx9mxjZQW+CvO2Cxhl+5vWxWOucf39w7qdpvpfDEvDvdtQw= X-Received: by 2002:a2e:8852:0:b0:29a:9b26:4e25 with SMTP id z18-20020a2e8852000000b0029a9b264e25mr2298150ljj.6.1681933730664; Wed, 19 Apr 2023 12:48:50 -0700 (PDT) MIME-Version: 1.0 References: <46CED01C-BEA6-49F3-9634-051DC63D248C@posteo.de> <696924B3-EF5B-4799-AAD9-E090C97D9AA9@posteo.de> <1CE9D3E9-4D3E-49B7-B66B-527B16322980@posteo.de> <12934A9D-8ABE-426A-8F0D-DFCB5836F642@posteo.de> In-Reply-To: <12934A9D-8ABE-426A-8F0D-DFCB5836F642@posteo.de> From: "Ard Biesheuvel" Date: Wed, 19 Apr 2023 21:48:39 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [edk2-devel] [PATCH 1/2] ArmPkg/AsmMacroIoLibV8: Introduce ASM_FUNC_ALIGN() To: =?UTF-8?Q?Marvin_H=C3=A4user?= Cc: edk2-devel-groups-io , Leif Lindholm , Ard Biesheuvel , Sami Mujawar , Vitaly Cheptsov Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, 19 Apr 2023 at 20:32, Marvin H=C3=A4user wrote= : > > > On 19. Apr 2023, at 20:26, Ard Biesheuvel wrote: > > On Wed, 19 Apr 2023 at 20:25, Marvin H=C3=A4user wro= te: > > > > On 19. Apr 2023, at 20:03, Ard Biesheuvel wrote: > > Your branch seems to be missing 16e0969ef775b898ac700f3261d76030b8ab9ef0 > > "ArmVirtPkg/ArmVirtQemu: Use PEI flavor of ArmMmuLib for all PEIMs" > > > That's correct (because that commit is after the last commit I managed to= reproduce the issue with), but I don't see how this commit would fix the i= ssue. As I said, the symptom is that PeiCore memory is badly corrupted and = the stall happens due to executing said corruption, not due to jumping to N= ULL. Those broken branches I linked can all be made work by rolling back th= e change to MemoryAllocationLib (which changes the code size, thus misalign= s *something*). In fact, using the broken variant only for MemoryInitPei is= sufficient to reproduce the issue, other modules don't seem to be involved= . > > > Applying that commit made your branch work for me. > > > Yes, that might very well be - applying ae2c904 also "fixes" the issue as= per https://github.com/mhaeuser/edk2/tree/arm_corruption-earliest-fixed > > And technically, so does reverting this line :) https://github.com/mhaeus= er/edk2/commit/7a96986e024f9c7ccf4774cc6f2ddb47a3abc86e#diff-1edfe01abdf8e4= dcac640db4d9436e17b5f15d037714df7f365b58fcfc91e425R409 > > I don't understand how the changes would *fix* (rather than hide) the iss= ue, so I'd attribute it to lucky codegen that doesn't misalign whatever is = misaligned. I unfortunately have absolutely no time to get back to debuggin= g this. :( > The issue is likely caused by -Wl,--defsym=3DPECOFF_HEADER_SIZE=3D0 Why are you setting that? It breaks the ELF to PE conversion.