Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-18.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 74A50C4338F for ; Sun, 22 Aug 2021 00:54:18 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 32C4E6124D for ; Sun, 22 Aug 2021 00:54:17 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 32C4E6124D Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 8912082C0C; Sun, 22 Aug 2021 02:54:14 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=sholland.org header.i=@sholland.org header.b="XWliD6Ny"; dkim=pass (2048-bit key; unprotected) header.d=messagingengine.com header.i=@messagingengine.com header.b="KPdgWG7u"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id C862D82D13; Sun, 22 Aug 2021 02:54:12 +0200 (CEST) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id CB29382B77 for ; Sun, 22 Aug 2021 02:54:06 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=sholland.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=samuel@sholland.org Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.nyi.internal (Postfix) with ESMTP id 28EA95C0092; Sat, 21 Aug 2021 20:54:05 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute5.internal (MEProxy); Sat, 21 Aug 2021 20:54:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sholland.org; h= from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; s=fm3; bh=F/ZqRput5Zy9wS0ItacI9LhOVj smgLQMGvpSz+LOV6I=; b=XWliD6Nyqd52EosDDF68z/tMzucPBSdOyzC8KO2C8G kPt8TfcxEGkhvvDGYv9C+nC2fiuRtUBcZy19DE5THAAbHKPJSlXoFgso9UVrenIx OM0KwZwSv1S5BfJ5cCVKNosQgOk3lY8qtXsyfhJZpCJRtVT9wOAe9W2S2DeDys3p hjOZ3GjMXiQGpMrt+wcC3rSyPnawQVF2GNMNwj+/y9hRyHv3OlHJhHeTNjMX1fwj cb9N76QEzvGEG50g+l6rO+IY/9uVULqQ6P2Gsi1nqeTxVWAE2CX6c0zun9r8KyuB GrRzyhFBvd62Y4H1UBqHNmP/Z5dxTJonAOPFLwEI2VPg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:date:from :message-id:mime-version:subject:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=F/ZqRput5Zy9wS0It acI9LhOVjsmgLQMGvpSz+LOV6I=; b=KPdgWG7uEC6L/3uZr4O2ylmTTAUPlisEd U3ditVKUlnXjHpGnxWqxylefWfK7fMF9GQG1941py/nGUa8pjuo9rLMGvSKqyDoc 7v/tm5rAhYeMQe3OMX00QSeMjGLufQc8HNrteX9YEQk7D9SDOkgFN6ufxSVixAil QOZr/FYp/sRBpvVYO95l2NwlupOho38U0lurMOT0F6p5EZGolYmMvJnW3YsHmnjz eZ+LxQf1Fr/geAap2OOFlrm3BZSnGUMxMF8FK38rr6b2H08RAGTlnZzNcegrzDb1 FqFjWpeg43xHZqzi0pAyNNGTwyu9RYRZLRioE2bE5O4oR/96GlEHA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddruddtvddggedtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhephffvufffkffoggfgsedtkeertdertddtnecuhfhrohhmpefurghmuhgvlhcu jfholhhlrghnugcuoehsrghmuhgvlhesshhhohhllhgrnhgurdhorhhgqeenucggtffrrg htthgvrhhnpeeiteekhfehuddugfeltddufeejjeefgeevheekueffhffhjeekheeiffdt vedtveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hsrghmuhgvlhesshhhohhllhgrnhgurdhorhhg X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Sat, 21 Aug 2021 20:54:03 -0400 (EDT) From: Samuel Holland To: u-boot@lists.denx.de, Tom Rini , Jagan Teki , Andre Przywara Cc: Samuel Holland Subject: [PATCH v2] ARM: Prevent the compiler from using NEON registers Date: Sat, 21 Aug 2021 19:54:02 -0500 Message-Id: <20210822005402.18113-1-samuel@sholland.org> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean For ARMv8-A, NEON is standard, so the compiler can use it even when no special target flags are provided. For example, it can use stores from NEON registers to zero-initialize large structures. GCC 11 decides to do this inside the DRAM init code for the Allwinner H6. However, GCC 11 has a bug where it generates misaligned NEON register stores even with -mstrict-align. Since the MMU is not enabled this early in SPL, the misaligned store causes an exception and breaks booting. Work around this issue by restricting the compiler to using GPRs only, not vector registers. This prevents any future surprises relating to NEON use as well. Signed-off-by: Samuel Holland --- Changes in v2: - Updated commit message to describe problem more precisely arch/arm/config.mk | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/config.mk b/arch/arm/config.mk index 16c63e12667..964c6b026ec 100644 --- a/arch/arm/config.mk +++ b/arch/arm/config.mk @@ -25,6 +25,7 @@ endif PLATFORM_RELFLAGS += -fno-common -ffixed-r9 PLATFORM_RELFLAGS += $(call cc-option, -msoft-float) \ + $(call cc-option,-mgeneral-regs-only) \ $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) # LLVM support -- 2.31.1