Received: by 2002:ac0:da4c:0:0:0:0:0 with SMTP id a12csp346729imi; Thu, 21 Jul 2022 02:01:13 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uJKhVYtbacU67dXnOuBUKXv3u8nzsVS/kztX4flTrpwhcuWzR/XvifHcnAxRrHL182u2T1 X-Received: by 2002:aa7:dd4b:0:b0:43a:d508:7cb9 with SMTP id o11-20020aa7dd4b000000b0043ad5087cb9mr56580441edw.218.1658394073146; Thu, 21 Jul 2022 02:01:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658394073; cv=none; d=google.com; s=arc-20160816; b=fUaEJcQJ+Qdu+4o9fWd0K6K4xIEPO4G6ClcPzti3EztULxCdtKSKuF+ZgaYFqTIc9k zzkNhjDmeBFT4d8iYtsj5Q8hNug60kMtWR+1dmGpBzZPJxjxs4Hdr0ECFeUsIjAcGC2p flVjbPVKDoCQAXm+pLJiICNY6PMk9pB6tdpFrKsOmfEFtLLP/QL7TIkecCXF+g0tFbqP IBGDnjtYN8PQcUU+48lIe3Ijw18642DKMGIEJWaeyBRb4MnT+hKw0JJVawXkPPG6WATN hQzklWhja8PYA4vM+37/o2zRHCtUVCArb4sOQzAAV8JyG5Wk8DiVq0c/sW1rNJd5A1iU nmYA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=nKpz/OqRztg5EzCK42ZfWepbK8TN0TvfFCyvjm5mdIY=; b=Q8elWnzW1H5KLZ1FYkwPn2dcnQKQw/p9sL3OEfsNdb8/lqkKoScpALewf/JPiUOE93 /dL6Cj1TReaFG+foyfek7n8xpz+zUIDmraxrPyOf5pE44AHrtEFajUjWWXZ+74isDIKC 50zOAuXqzyD6ejkjBTCzL3Fcxf22tHPinYAcClwwwxNUl0yboGMOArgqm64QJrfe/c8+ 9UKtip6kJ2/LzVR9nrKiBvsI+pv1PLryyLDA90JGAeMK5uevLnJw0MX5H35Jzo7Gwtdl qwfl+S9J2PzoBd0vFVoLupzF7Zt+q5o3kbcaF/QTUerVHjrPyRs+wYpSfJaLZFfJAwSd aMKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=A+bMhyz+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s11-20020a05640217cb00b0043bc4a92ccfsi1327296edy.530.2022.07.21.02.00.47; Thu, 21 Jul 2022 02:01:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=A+bMhyz+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 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 S232153AbiGUIgm (ORCPT + 99 others); Thu, 21 Jul 2022 04:36:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232361AbiGUIga (ORCPT ); Thu, 21 Jul 2022 04:36:30 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 729D33B946 for ; Thu, 21 Jul 2022 01:36:24 -0700 (PDT) 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 ams.source.kernel.org (Postfix) with ESMTPS id 4C280B82375 for ; Thu, 21 Jul 2022 08:36:23 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id B95CEC36AF2 for ; Thu, 21 Jul 2022 08:36:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1658392581; bh=nKpz/OqRztg5EzCK42ZfWepbK8TN0TvfFCyvjm5mdIY=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=A+bMhyz+nHDfKK4NfWjEW+Vv65X+YF922kXyOusZOYcgGfruM+e6flOuE99wPPcHT dl4geEg4tuNIBIZpKpJqAVrlBGI82HGMfVVOSHjTpG/wyOqyVjii1hXCfq8bLj+kiv 0lhMS18hTlbxo0g6TsB1cz9pU9ltIzBTGStm4VKFJrsjs7++0e/1qNqdVFE0t94yLf b7XO4QFmkJvlSu+3N+zB9xI49PajgB6WuhwV+QzQhDQFMqcaVJIV9o8uXlRuZNXTng FjgDS8Sd+4A2+uLWjRmieS6Hqoh/nZIznpUGitL/IdrFGy+AWndZOT/ei0BP1NBsxg l5qRuGqNhEHAw== Received: by mail-ua1-f47.google.com with SMTP id p8so296349uam.12 for ; Thu, 21 Jul 2022 01:36:21 -0700 (PDT) X-Gm-Message-State: AJIora8UeD6DChE5VE0wOCLf8HEcXJOlYqJYvvtU7YCwboiKrsy7CCF5 m5Ry9haxneba5lvznwXfsLE64Uy80tuJzV+Rn2k= X-Received: by 2002:ab0:37d7:0:b0:384:47a1:eb8e with SMTP id e23-20020ab037d7000000b0038447a1eb8emr2239729uav.23.1658392580666; Thu, 21 Jul 2022 01:36:20 -0700 (PDT) MIME-Version: 1.0 References: <20220721021127.1086628-1-yijun@loongson.cn> <4a8f5963-28f1-7439-9b52-7084d51707b2@xen0n.name> In-Reply-To: <4a8f5963-28f1-7439-9b52-7084d51707b2@xen0n.name> From: Huacai Chen Date: Thu, 21 Jul 2022 16:36:08 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH] LoongArch: Remove unused header compiler.h To: WANG Xuerui Cc: Jun Yi , loongarch@lists.linux.dev, LKML , Jiaxun Yang Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org OK, please update the commit message and send V2, please. On Thu, Jul 21, 2022 at 1:38 PM WANG Xuerui wrote: > > On 2022/7/21 11:22, Huacai Chen wrote: > > Hi, Xuerui, > > > > On Thu, Jul 21, 2022 at 11:17 AM WANG Xuerui wrote: > >> Hi YI Jun and Huacai, > >> > >> On 2022/7/21 10:52, Huacai Chen wrote: > >>> Hi, Jun, > >>> > >>> On Thu, Jul 21, 2022 at 10:11 AM Jun Yi wrote: > >>>> Loongarch not used arch-specific compiler.h > >>> I'm not sure whether compiler.h will be used in future. If it will be > >>> used, I want to keep it as is. Xuerui, what do you think about it? > >> I surveyed all the existing arch compiler.h in the tree: > >> > >> $ find ./arch -name compiler.h > >> ./arch/alpha/include/asm/compiler.h > >> ./arch/alpha/include/uapi/asm/compiler.h > >> ./arch/arm/include/asm/compiler.h > >> ./arch/arm64/include/asm/compiler.h > >> ./arch/mips/include/asm/compiler.h > >> ./arch/loongarch/include/asm/compiler.h > >> > >> Of all these occurrences: > >> > >> - alpha needs to ensure a certain insn is being emitted from time to > >> time, with plain C constructs (or built-ins) on compiler versions with > >> said support, falling back to inline asm otherwise; > >> - arm and arm64 both need some inline assembly help (of different sort), > >> with arm64 stuffing some pointer authentication helpers into this file too; > >> - mips, which is obviously what the loongarch version is based on, needs > >> (1) a kludge for older compilers to fix delay slot filling around > >> __builtin_unreachable, (2) definitions for explicit arch level > >> selection. There is also the historical GCC_OFF_SMALL_ASM() constraint > >> definition that was rendered redundant by commit 4abaacc704729 ("MIPS: > >> remove GCC < 4.9 support"). > >> > >> For loongarch, the "ZC" constraint (I don't think it was a coincidence > >> BTW) should be usable for all present and future hardware, so I do think > >> the GCC_OFF_SMALL_ASM() here is redundant. We may want to remove the > >> mips one too. And the arch level thing is not currently needed either, > >> future revisions to the LoongArch ISA should be largely backwards > >> compatible, so it could be a long time before such explicit selection of > >> arch level is necessary, for exact control over emitted insn. > >> > >> So overall, I'm in favor of removing this header for now. > > Have you considered the new relocation types will be added in the near > > future? I think we need compiler.h at that time. > > I assume you mean the proposal being discussed at [1] [2] and [3]. > > For new reloc types that affect module loading, asm/elf.h and > kernel/module.c need modification to add awareness, but this doesn't > involve compiler.h. The kernel image itself is not affected. > > There is also the case of building LoongArch kernel sources without > support for the new reloc types, but on a newer compiler that emits the > new-style reloc records by default. In this case, a switch reverting the > compiler to the old-style relocs is needed in CFLAGS, but (1) not all > essential support are merged for LoongArch so practically we don't need > to care about non-kernel-ABI compatibility at this time, and (2) CFLAGS > tweaks don't involve compiler.h either. > > [1]: https://sourceware.org/pipermail/binutils/2022-July/121849.html > [2]: https://sourceware.org/pipermail/binutils/2022-July/121933.html > [3]: https://github.com/loongson/LoongArch-Documentation/pull/57 > >