From mboxrd@z Thu Jan 1 00:00:00 1970 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=-14.4 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED 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 B6E39C433ED for ; Thu, 13 May 2021 11:33:22 +0000 (UTC) Received: from desiato.infradead.org (desiato.infradead.org [90.155.92.199]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 01F4C60FE3 for ; Thu, 13 May 2021 11:33:21 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 01F4C60FE3 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-m68k.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=desiato.20200630; h=Sender:Content-Transfer-Encoding :Content-Type:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Cc:To:Subject:Message-ID:Date:From:In-Reply-To: References:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=KpS6GSc32VTRmhIFBFoE2lyJ2s2xO0IN0eVvdI/X0us=; b=Pz0gSOECoVVGBriMiDxQDfDR7 wQSwWlVT9vVtpEWSCgMGX0Mn8LWqNKEBViktBcgrah1zxR5ugn8cNM+IM4dvC6Yc+hfSM12QHfeB6 xetVEMnc90Df4JJP8d6LYp2QbxHEmWWJgI9Y3EoBLPLXi0bTRDB2zvMtr2HKgUVUMx+TQslnP1/Zl vRHuAzTVhS3mTKS/ySCHQEK9u+EGVM6+ZYGAW/AGsouI/BXrUR3watUG8nkl1CFuk81Sm4CPPyr4L 8/AncKCZDdiA9xfWPlTJ85ySPE3QdUq8Td9j6/MWKXHXoeMMNnAjaqFSva2DW/CcshF8EJlY0mjRj hGzGfa7hg==; Received: from localhost ([::1] helo=desiato.infradead.org) by desiato.infradead.org with esmtp (Exim 4.94 #2 (Red Hat Linux)) id 1lh9Yd-005QDN-Pe; Thu, 13 May 2021 11:31:12 +0000 Received: from bombadil.infradead.org ([2607:7c80:54:e::133]) by desiato.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lh9Yb-005QDC-9D for linux-arm-kernel@desiato.infradead.org; Thu, 13 May 2021 11:31:09 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Type:Cc:To:Subject:Message-ID :Date:From:In-Reply-To:References:MIME-Version:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=8W7zkaz71CL9b7Tf8gelEPdkYIQkCjjI5TeLw7vKN6s=; b=WnAv22CdBXf/+atEY0nHLC02fW sCMvOgGOTKx/fnG03oBopqi8uTd/j2DB4744EzAnl3Cw7NrmmiAu5LQI2gmH29uqliBcdM/mCpT/H jT+pfcN08ytYHqGw3bF1c3swgrx4vY/Y7DRmUO5a+BxHtPFDWTLzl4j5m5uDHM37+2VU92PtDBefA FBlylm2a+saVNWeH5YMsjFhfBHetAn3EEEOarhLFE1lwyYDyg45LxX6PyONuE/18ZZNgpMIIVmVGQ 1/jMs6N85mr0rBwCXAy6VBqien75iVu5Hpi31ulaqTNFSrj4V1so88agxCQ2eznSYiY/C/2VA0EF3 pLi7WkmQ==; Received: from mail-ua1-f51.google.com ([209.85.222.51]) by bombadil.infradead.org with esmtps (Exim 4.94 #2 (Red Hat Linux)) id 1lh9YY-00BCpC-GF for linux-arm-kernel@lists.infradead.org; Thu, 13 May 2021 11:31:08 +0000 Received: by mail-ua1-f51.google.com with SMTP id 14so1322217uac.9 for ; Thu, 13 May 2021 04:31:05 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=8W7zkaz71CL9b7Tf8gelEPdkYIQkCjjI5TeLw7vKN6s=; b=k/5JwjKCmJmIPcN+Txdw3INEc7nphCIWwTRieGZX4QU1bhePdbIp6NyHOAaDY1Yldw CcW0JY45qi1Top9kXG5ex6mMFbFtrXX15eADimahmkIpiCBbfVBp2lI4BgkulXA2Nu7D MUdrJY5xi1WbBtTLuW80d6LMcWID5/70aQT1q2zW7SK2607pxKfqH3uvuKp9UefUp73e pfZ772xpwWX68Zwd+G26TUcvZSkwyHsDPn2it7v05JZSEWT63o/4+0CNekcMEm9eBu/N aYHyIyrTh9ndo3E7Xaolv90P8d39LYPfm0rtdA4o09Ooo5d7+sPDtN4BQZRe6eb/4m58 vJhA== X-Gm-Message-State: AOAM530+iReKtO+o/5HCXyoOFh6bUUQRGyrdB8/hDMczwggrpB0/5/RI ZC7SuuV3qSuXqgKi1cPuApBlzGyzvUl1dgY3JfA= X-Google-Smtp-Source: ABdhPJx34ODIgsDGEmJG5eoFTg+Z7uGTpw4vw7glwJjFC/RG+UpdIKBWV/g2h6qj66uG4eZiu8GFS1yPfFLJh+CM1yo= X-Received: by 2002:a9f:3852:: with SMTP id q18mr37237579uad.58.1620905464521; Thu, 13 May 2021 04:31:04 -0700 (PDT) MIME-Version: 1.0 References: <20210428121231.11219-1-broonie@kernel.org> In-Reply-To: <20210428121231.11219-1-broonie@kernel.org> From: Geert Uytterhoeven Date: Thu, 13 May 2021 13:30:53 +0200 Message-ID: Subject: Re: [PATCH] arm64: Generate cpucaps.h To: Mark Brown Cc: Catalin Marinas , Will Deacon , Suzuki K Poulose , Linux ARM X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20210513_043106_562742_76FB21DB X-CRM114-Status: GOOD ( 29.91 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Hi Mark, On Wed, Apr 28, 2021 at 2:25 PM Mark Brown wrote: > The arm64 code allocates an internal constant to every CPU feature it can > detect, distinct from the public hwcap numbers we use to expose some > features to userspace. Currently this is maintained manually which is an > irritating source of conflicts when working on new features, to avoid this > replace the header with a simple text file listing the names we've assigned > and sort it to minimise conflicts. > > As part of doing this we also do the Kbuild hookup required to hook up > an arch tools directory and to generate header files in there. > > This will result in a renumbering and reordering of the existing constants, > since they are all internal only the values should not be important. The > reordering will impact the order in which some steps in enumeration handle > features but the algorithm is not intended to depend on this and I haven't > seen any issues when testing. Due to the UAO cpucap having been removed in > the past we end up with ARM64_NCAPS being 1 smaller than it was before. > > Signed-off-by: Mark Brown > --- > arch/arm64/Makefile | 3 ++ > arch/arm64/include/asm/Kbuild | 2 + > arch/arm64/include/asm/cpucaps.h | 74 -------------------------------- > arch/arm64/tools/Makefile | 22 ++++++++++ > arch/arm64/tools/cpucaps | 65 ++++++++++++++++++++++++++++ > arch/arm64/tools/gen-cpucaps.awk | 40 +++++++++++++++++ I guess the reason you're doing it like this, and not using a simple C enum, is that some of these definitions are used from asm files? Do we use similar mechanisms in other places? Would introducing a generic way to generate headers with definitions from a C enum be worthwhile? Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel