From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id 28C9B941D7B for ; Sat, 22 Jun 2024 18:04:47 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=muwgAsGT5105l0Wp0/+UAQmQfVVR0aaSPo0GJ6HoMNY=; c=relaxed/simple; d=groups.io; h=Feedback-ID:Message-ID:Date:MIME-Version:User-Agent:From:Subject:To:Cc:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20240206; t=1719079486; v=1; b=OlIMetNGUnSaC3C6gh/idPXNmrRqUR1KHbBGefMvZ8QOJMW9hqA2syHaqBRyqCYc7p+D22Kz Cp42xFdrW1S5HURti8JS3axIs9UUmaaYMfBu6mkEVsxHPCvTZoUzBXMZB1DPe+TjoHCO/dbSR1q c+zBeXkLzIcgYnM/uXIDo9VyaL+D75QwfoIk88fZL+4+GO/+rjwSF5rIDrMqlrn7yMI+Q5sph21 3YXsFHkd8HkRmmC5PFwycwOeevqom2RPZ2kPMih82j3lgmOei7j7kV8nfrh1OORPqhi+wHwbD2U M8czNKT0+p16ZTLggLTumbyk52oQsYa6lBEPFZ7+uSHgw== X-Received: by 127.0.0.2 with SMTP id jFjLYY7687511xtwaka8aWz7; Sat, 22 Jun 2024 11:04:45 -0700 X-Received: from fout8-smtp.messagingengine.com (fout8-smtp.messagingengine.com [103.168.172.151]) by mx.groups.io with SMTP id smtpd.web10.102677.1719079484462172166 for ; Sat, 22 Jun 2024 11:04:44 -0700 X-Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfout.nyi.internal (Postfix) with ESMTP id C891F13800F0; Sat, 22 Jun 2024 14:04:43 -0400 (EDT) X-Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Sat, 22 Jun 2024 14:04:43 -0400 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrfeefiedguddvfecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enogfuuhhsphgvtghtffhomhgrihhnucdlgeelmdenucfjughrpefkffggfgfhuffvvegt gfesthekredttddvjeenucfhrhhomheptfgvsggvtggtrgcuvehrrghnuceorhgvsggvtg gtrgessghsughiohdrtghomheqnecuggftrfgrthhtvghrnhepfeefjefhfeejudehheev ffetgfdtieejheegleevieejleektdekfedvleeiiefgnecuffhomhgrihhnpehgihhthh husgdrtghomhdpghhithhhuhgsrdhiohenucevlhhushhtvghrufhiiigvpedtnecurfgr rhgrmhepmhgrihhlfhhrohhmpehrvggsvggttggrsegsshguihhordgtohhm X-ME-Proxy: Feedback-ID: i5b994698:Fastmail X-Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 22 Jun 2024 14:04:43 -0400 (EDT) Message-ID: <428c3293-3899-4794-a51b-7670331e58a2@bsdio.com> Date: Sat, 22 Jun 2024 12:04:34 -0600 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird From: "Rebecca Cran" Subject: [edk2-devel] Alignment fault in __memcpy when SbsaQemu is built uncompressed To: "devel@edk2.groups.io" Cc: Ard Biesheuvel , Marcin Juszkiewicz 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: Sat, 22 Jun 2024 11:04:44 -0700 Resent-From: rebecca@bsdio.com Reply-To: devel@edk2.groups.io,rebecca@bsdio.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: mrgXHmSKC9p3VvypxAbuHRXox7686176AA= Content-Language: en-US Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240206 header.b=OlIMetNG; dmarc=none; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io I decided to do some testing around the cost of copying vs decompressing and moved all the drivers in SbsaQemu into the uncompressed section (as described in https://github.com/tianocore/tianocore.github.io/wiki/ArmPkg-Compression), but firmware built with CLANGDWARF causes an alignment fault when writing the last 64 bytes in __memcpy via FvReadFile -> AllocateCopyPool -> InternalAllocateCopyPool -> InternalMemCopyMem -> __memcpy (AArch64/CopyMem.S in BaseMemoryLibOptDxe). InternalAllocateCopyPool calls CopyMem with Memory=0x1000694d018, Buffer=0x10a71300, AllocationSize=274476. The instruction that causes the fault is: ldp x14, x15, [x4, #-64] Where x4=0x10ab432c The crash log is: Synchronous Exception at 0x0000010007F48628 PC 0x010007F48628 (0x010007F42000+0x00006628) [ 0] DxeCore.dll PC 0x010007F484CC (0x010007F42000+0x000064CC) [ 0] DxeCore.dll PC 0x010007F4A404 (0x010007F42000+0x00008404) [ 0] DxeCore.dll PC 0x010007F4A558 (0x010007F42000+0x00008558) [ 0] DxeCore.dll PC 0x010007F79BF0 (0x010007F42000+0x00037BF0) [ 0] DxeCore.dll PC 0x010007F7A210 (0x010007F42000+0x00038210) [ 0] DxeCore.dll PC 0x0100078A192C (0x010007880000+0x0002192C) [ 1] BdsDxe.dll PC 0x0100078A2674 (0x010007880000+0x00022674) [ 1] BdsDxe.dll PC 0x01000789781C (0x010007880000+0x0001781C) [ 1] BdsDxe.dll PC 0x010007898330 (0x010007880000+0x00018330) [ 1] BdsDxe.dll PC 0x01000788C6F4 (0x010007880000+0x0000C6F4) [ 1] BdsDxe.dll PC 0x01000788CFCC (0x010007880000+0x0000CFCC) [ 1] BdsDxe.dll PC 0x01000788A400 (0x010007880000+0x0000A400) [ 1] BdsDxe.dll PC 0x010007F51648 (0x010007F42000+0x0000F648) [ 2] DxeCore.dll PC 0x010007F43654 (0x010007F42000+0x00001654) [ 2] DxeCore.dll PC 0x010007F43024 (0x010007F42000+0x00001024) [ 2] DxeCore.dll [ 0] /home/bcran/src/tiano/Build/SbsaQemu/NOOPT_CLANGDWARF/AARCH64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll [ 1] /home/bcran/src/tiano/Build/SbsaQemu/NOOPT_CLANGDWARF/AARCH64/MdeModulePkg/Universal/BdsDxe/BdsDxe/DEBUG/BdsDxe.dll [ 2] /home/bcran/src/tiano/Build/SbsaQemu/NOOPT_CLANGDWARF/AARCH64/MdeModulePkg/Core/Dxe/DxeMain/DEBUG/DxeCore.dll   X0 0x000001000694D018   X1 0x0000000010AB42F8   X2 0xFFFFFFFFFFFFFFE4   X3 0x000001000698FFD0   X4 0x0000000010AB432C   X5 0x0000010006990044   X6 0x0000000000000000   X7 0x0000000000000000   X8 0x0000000000000000   X9 0x0000000000000000  X10 0x0000000000000000  X11 0x0000000000000000  X12 0x0000000000000000  X13 0x0000000000000000  X14 0x0000000000000023  X15 0x0000000000000031  X16 0x0000010007F41DB0  X17 0x0000000000000000  X18 0x0000000000000000  X19 0x0000000000000000  X20 0x0000000000000000  X21 0x0000000000000000  X22 0x0000000000000000  X23 0x0000000000000000  X24 0x0000000000000000  X25 0x0000000000000000  X26 0x0000000000000000  X27 0x0000000000000000  X28 0x0000000000000000   FP 0x0000010007F41860   LR 0x0000010007F484CC   V0 0xAFAFAFAFAFAFAFAF AFAFAFAFAFAFAFAF   V1 0xFFFFFF80FFFFFFD0 0000010007F41540   V2 0x0000000000000000 0000000000000000   V3 0x0000000000000000 0000000000000000   V4 0x0000000000000000 0000000000000000   V5 0x0000000000000000 0000000000000000   V6 0x0000000000000000 0000000000000000   V7 0x0000000000000000 0000000000000000   V8 0x0000000000000000 0000000000000000   V9 0x0000000000000000 0000000000000000  V10 0x0000000000000000 0000000000000000  V11 0x0000000000000000 0000000000000000  V12 0x0000000000000000 0000000000000000  V13 0x0000000000000000 0000000000000000  V14 0x0000000000000000 0000000000000000  V15 0x0000000000000000 0000000000000000  V16 0x0000000000000000 0000000000000000  V17 0x0000000000000000 0000000000000000  V18 0x0000000000000000 0000000000000000  V19 0x0000000000000000 0000000000000000  V20 0x0000000000000000 0000000000000000  V21 0x0000000000000000 0000000000000000  V22 0x0000000000000000 0000000000000000  V23 0x0000000000000000 0000000000000000  V24 0x0000000000000000 0000000000000000  V25 0x0000000000000000 0000000000000000  V26 0x0000000000000000 0000000000000000  V27 0x0000000000000000 0000000000000000  V28 0x0000000000000000 0000000000000000  V29 0x0000000000000000 0000000000000000  V30 0x0000000000000000 0000000000000000  V31 0x0000000000000000 0000000000000000   SP 0x0000010007F41840  ELR 0x0000010007F48628  SPSR 0x80000209 FPSR 0x00000000  ESR 0x96000021          FAR 0x0000000010AB42EC  ESR : EC 0x25  IL 0x1  ISS 0x00000021 Data abort: Alignment fault Stack dump:   0010007F41740: 0000000000000000 0000000000000000 0000000000000000 0000000000000000   0010007F41760: 0000000000000000 0000000000000000 0000000000000000 0000000000000000   0010007F41780: 0000000000000000 0000000000000000 0000000000000000 0000000000000000   0010007F417A0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000   0010007F417C0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000   0010007F417E0: 0000000000000000 0000000000000000 0000000000000000 0000000000000000   0010007F41800: 0000000000000000 0000000000000000 0000010007F48618 0000000020000209   0010007F41820: 0000000000000000 0000000000000000 0000000000000000 0000000000000040 > 0010007F41840: 000000000004302C 0000000010A71300 000001000694D018 0000010007F4A3E4   0010007F41860: 0000010007F41890 0000010007F4A404 000001000694D018 0000000010A71300   0010007F41880: 000000000004302C 0000000407F4A538 0000010007F418C0 0000010007F4A558   0010007F418A0: 0000010007F79BF0 0000000020000209 0000000010A71300 000000000004302C   0010007F418C0: 0000010007F41980 0000010007F79BF0 0004302C00000000 000001000753D098   0010007F418E0: 0000010007F41970 0000000100000000 000000000004302C 0000000000000000   0010007F41900: 0000000010A71300 0000000000000000 0000000000043014 0900000000000200   0010007F41920: 45037614462CAA21 312366F4B68A6E83 000001000753D098 0000000000000000 ASSERT [ArmCpuDxe] DefaultExceptionHandler.c(343): ((BOOLEAN)(0==1)) -- Rebecca Cran -=-=-=-=-=-=-=-=-=-=-=- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#119677): https://edk2.groups.io/g/devel/message/119677 Mute This Topic: https://groups.io/mt/106820121/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=-=-=-=-=-=-=-=-=-=-=-