Received: by 2002:a25:6193:0:0:0:0:0 with SMTP id v141csp490426ybb; Fri, 10 Apr 2020 04:16:35 -0700 (PDT) X-Google-Smtp-Source: APiQypLy63a1k1geZhmlr4b0QOSjtJ0K8DJTXSGL05zXX3Hx2DFAoxMHzEHD7yfHnfRkWA/EBaJU X-Received: by 2002:ac8:7769:: with SMTP id h9mr3906517qtu.234.1586517395697; Fri, 10 Apr 2020 04:16:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1586517395; cv=none; d=google.com; s=arc-20160816; b=Ax40dDpuFRTJr0Cg8biZ3+vY2gtsA0+90jS6QS+UB7fJ9p9dENmMByTMvCR0ch9yLd 9eBQRuKXJpK8NfkDQzizACI3P8XZCtfTC3n5b4QyO8NdQ2moISloeZOpSwv5vjcyv4kM BsoQUR3UpbP2s1mG2TSJBL2O/1hCSKEoXYJkDxxme63Uo0x2J694HSRtmX4YRsaPPKHE vVTejxQaa4orY9dpa73K+qicHd7zKf4lego7mph1eyysMaPA/X3RcozGf0jcoip2rb5J RPFkTo+4eHNPjF2wvi8VbbLgtYtoroq4ZQyzpqbYB1LfFkaFtTKtVnVj/QzOWTb548xA PyNw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=iKo/mDdaPYxcPPcLZBizq+p5u1ritpzBmsNSheDWaGE=; b=FcWihHImmQkXNp9bW685yru8ZX4sG9Grve0pgsZ1uUp5NXfZW6W3frQAJ51mdP8hYv 78m2L4Gcoj1wV2iVaR5xCwvA7V3MixxJBn/EVGqIqGlZAw+YBezrMbbhPFiKR2BruMy5 Db4yOGDrI9XjlO8bOc/LThlXJpZwUURSfSPSa54NCvVCspQmkHqtww4wdAlD0z5jruXb 9h7wbC1/JeSn0olZ+sOCtmqxfA2H8rCyZB/0/nTYwkwS3J/uJxR/yzrGir9Z5Fn14tqF q6Mg3BO5HdxusJgmKbsOlihCluRa1/i9fBLD6/68AQZp6xghrk6AEG8bogxrBJJ9A86D KGQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=A3ZpHJd0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n2si971125qtd.118.2020.04.10.04.16.20; Fri, 10 Apr 2020 04:16:35 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=A3ZpHJd0; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726203AbgDJLPV (ORCPT + 99 others); Fri, 10 Apr 2020 07:15:21 -0400 Received: from mail.kernel.org ([198.145.29.99]:41856 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725913AbgDJLPV (ORCPT ); Fri, 10 Apr 2020 07:15:21 -0400 Received: from mail-il1-f169.google.com (mail-il1-f169.google.com [209.85.166.169]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 9D785212CC for ; Fri, 10 Apr 2020 11:15:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1586517320; bh=3YXzGC3ObJihzyd1AuE7dmr+XaEQodkdzqmLPWjQZVw=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=A3ZpHJd0z3q5d5P39vHKt3H1YIccE8/FYC13OkS3RTWHHUR6WwU0CJSd/XUdXeOhe eHu7qHEBz+eEwbEQLxVl0ThOX9wzt/c/Yu6ttYQSw75PGEAZcaSCLxQdXaITrl0YDK 84a/mTOL6J9LpDwRwGSOfqcnrJ3Df1cqtJeA2JU0= Received: by mail-il1-f169.google.com with SMTP id t11so1553997ils.1 for ; Fri, 10 Apr 2020 04:15:20 -0700 (PDT) X-Gm-Message-State: AGi0PubS/gdy9+iXDwa/WD5iMG7VKn2I8FAqzIWqMDHLr4gx4s8PEHGg fLeUpOnEobjLSZHbUKghWVhtZT5k2b/v+2zP34k= X-Received: by 2002:a92:c788:: with SMTP id c8mr4514670ilk.279.1586517319930; Fri, 10 Apr 2020 04:15:19 -0700 (PDT) MIME-Version: 1.0 References: <20200409232728.231527-1-caij2003@gmail.com> In-Reply-To: From: Ard Biesheuvel Date: Fri, 10 Apr 2020 13:15:08 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] ARM: do not assemble iwmmxt.S with LLVM toolchain To: Arnd Bergmann Cc: Jian Cai , Linus Walleij , Peter Smith , Stefan Agner , David Howells , Mauro Carvalho Chehab , Manoj Gupta , Benjamin Gaignard , "Joel Fernandes (Google)" , clang-built-linux , Ilie Halip , Masahiro Yamada , Russell King , Krzysztof Kozlowski , Bartosz Golaszewski , Sami Tolvanen , "Eric W. Biederman" , "Steven Rostedt (VMware)" , jiancai@google.com, Doug Anderson , Dan Williams , Linux ARM , Greg Kroah-Hartman , Nick Desaulniers , "linux-kernel@vger.kernel.org" , Patrick Bellasi , Masami Hiramatsu , Tejun Heo , Andrew Morton Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 10 Apr 2020 at 11:56, Arnd Bergmann wrote: > > On Fri, Apr 10, 2020 at 1:28 AM Jian Cai wrote: > > > > iwmmxt.S contains XScale instructions LLVM ARM backend does not support. > > Skip this file if LLVM integrated assemmbler or LLD is used to build ARM > > kernel. > > > > Signed-off-by: Jian Cai > > It clearly makes sense to limit the Kconfig option to compilers that > can actually build it. > A few questions though: > > - Given that Armada XP with its PJ4B was still marketed until fairly > recently[1], > wouldn't it make sense to still add support for it? Is it a lot of work? > The part of that file that the assembler chokes on hasn't been touched by anyone since Nico added it 15+ years ago. It can only be built in ARM mode, and it disassembles to the sequence below (the ld/st fe/fp mnemonics are not document in recent versions of the ARM ARM, and aren't understood by Clang either) Instead of playing all these tricks with Kconfig, couldn't we simply insert the bare opcodes and be done with it? 00000054 : 54: fd812120 stc2 1, cr2, [r1, #128] ; 0x80 58: fd813121 stc2 1, cr3, [r1, #132] ; 0x84 5c: fd818122 stc2 1, cr8, [r1, #136] ; 0x88 60: fd819123 stc2 1, cr9, [r1, #140] ; 0x8c 64: fd81a124 stc2 1, cr10, [r1, #144] ; 0x90 68: fd81b125 stc2 1, cr11, [r1, #148] ; 0x94 6c: e3120002 tst r2, #2 70: 0a00000f beq b4 74: edc10100 stfe f0, [r1] 78: edc11102 stfe f1, [r1, #8] 7c: edc12104 stfe f2, [r1, #16] 80: edc13106 stfe f3, [r1, #24] 84: edc14108 stfe f4, [r1, #32] 88: edc1510a stfe f5, [r1, #40] ; 0x28 8c: edc1610c stfe f6, [r1, #48] ; 0x30 90: edc1710e stfe f7, [r1, #56] ; 0x38 94: edc18110 stfp f0, [r1, #64] ; 0x40 98: edc19112 stfp f1, [r1, #72] ; 0x48 9c: edc1a114 stfp f2, [r1, #80] ; 0x50 a0: edc1b116 stfp f3, [r1, #88] ; 0x58 a4: edc1c118 stfp f4, [r1, #96] ; 0x60 a8: edc1d11a stfp f5, [r1, #104] ; 0x68 ac: edc1e11c stfp f6, [r1, #112] ; 0x70 b0: edc1f11e stfp f7, [r1, #120] ; 0x78 b4: e3300000 teq r0, #0 b8: 012fff1e bxeq lr 000000bc : bc: edd00100 ldfe f0, [r0] c0: edd01102 ldfe f1, [r0, #8] c4: edd02104 ldfe f2, [r0, #16] c8: edd03106 ldfe f3, [r0, #24] cc: edd04108 ldfe f4, [r0, #32] d0: edd0510a ldfe f5, [r0, #40] ; 0x28 d4: edd0610c ldfe f6, [r0, #48] ; 0x30 d8: edd0710e ldfe f7, [r0, #56] ; 0x38 dc: edd08110 ldfp f0, [r0, #64] ; 0x40 e0: edd09112 ldfp f1, [r0, #72] ; 0x48 e4: edd0a114 ldfp f2, [r0, #80] ; 0x50 e8: edd0b116 ldfp f3, [r0, #88] ; 0x58 ec: edd0c118 ldfp f4, [r0, #96] ; 0x60 f0: edd0d11a ldfp f5, [r0, #104] ; 0x68 f4: edd0e11c ldfp f6, [r0, #112] ; 0x70 f8: edd0f11e ldfp f7, [r0, #120] ; 0x78 fc: fd902120 ldc2 1, cr2, [r0, #128] ; 0x80 100: fd903121 ldc2 1, cr3, [r0, #132] ; 0x84 104: fd908122 ldc2 1, cr8, [r0, #136] ; 0x88 108: fd909123 ldc2 1, cr9, [r0, #140] ; 0x8c 10c: fd90a124 ldc2 1, cr10, [r0, #144] ; 0x90 110: fd90b125 ldc2 1, cr11, [r0, #148] ; 0x94 114: e3310000 teq r1, #0 118: e3a02000 mov r2, #0 11c: 012fff1e bxeq lr 120: ee012110 flts f1, r2 124: e12fff1e bx lr > - Why does the linker have to understand it, rather than just the assembler? > > > diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig > > index 66a04f6f4775..39de8fc64a73 100644 > > --- a/arch/arm/Kconfig > > +++ b/arch/arm/Kconfig > > @@ -804,7 +804,7 @@ source "arch/arm/mm/Kconfig" > > > > config IWMMXT > > bool "Enable iWMMXt support" > > - depends on CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_PJ4 || CPU_PJ4B > > + depends on !AS_IS_CLANG && !LD_IS_LLD && (CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_PJ4 || CPU_PJ4B) > > I would suggest splitting it into two lines for readability: > > depends on CPU_XSCALE || CPU_XSC3 || CPU_MOHAWK || CPU_PJ4 || CPU_PJ4B > depends on !AS_IS_CLANG && !LD_IS_LLD > > Arnd > > [1] http://web.archive.org/web/20191015165247/https://www.marvell.com/embedded-processors/armada/index.jsp > > _______________________________________________ > linux-arm-kernel mailing list > linux-arm-kernel@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-arm-kernel