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=-5.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=no 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 A4035C43603 for ; Thu, 20 May 2021 09:27:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8C244613BF for ; Thu, 20 May 2021 09:27:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232314AbhETJ3B (ORCPT ); Thu, 20 May 2021 05:29:01 -0400 Received: from mail.skyhub.de ([5.9.137.197]:34194 "EHLO mail.skyhub.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231811AbhETJ1t (ORCPT ); Thu, 20 May 2021 05:27:49 -0400 Received: from zn.tnic (p200300ec2f0eb6008eba81a1ad09a99c.dip0.t-ipconnect.de [IPv6:2003:ec:2f0e:b600:8eba:81a1:ad09:a99c]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id 4721A1EC051F; Thu, 20 May 2021 11:26:26 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1621502786; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=sBPCBfFxpVVzA8qvfueuilIPqhAowYTHXr3cnG4eLoI=; b=Ps5CMwItn7MpMTJ7xjmt5Te7zi7KyKAeJu1+YnmeLarTJdGGkhGNyRrYiLuMWqemQBxvJk anKV0jiMn14lqWauALXkE4RwiiUPsYosxjjwmgqbyTltUkyT44O2vOA8LqAg/+ijlDlpav xmBC5chCNww4ZWjVHkkaXZJu2/rHo+4= Date: Thu, 20 May 2021 11:26:25 +0200 From: Borislav Petkov To: "Yu, Yu-cheng" Cc: x86@kernel.org, "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, linux-api@vger.kernel.org, Arnd Bergmann , Andy Lutomirski , Balbir Singh , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , "H.J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , Vedvyas Shanbhogue , Dave Martin , Weijiang Yang , Pengfei Xu , Haitao Huang , Mark Brown , Catalin Marinas Subject: Re: [PATCH v26 26/30] ELF: Introduce arch_setup_elf_property() Message-ID: References: <20210427204315.24153-1-yu-cheng.yu@intel.com> <20210427204315.24153-27-yu-cheng.yu@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, May 19, 2021 at 03:14:58PM -0700, Yu, Yu-cheng wrote: > However, those parsing functions take (struct arch_elf_state *) as an input. Exactly. > It probably makes sense to have ARCH_USE_GNU_PROPERTY dependent on > ARCH_BINFMT_ELF_STATE. It would be ok as-is too. ARM people might have > other plans in mind. Well, let's look at ARM, ARM64 in particular. They have defined struct arch_elf_state without the ifdeffery in arch/arm64/include/asm/elf.h and are using that struct in arch_parse_elf_property(). And they have selected ARCH_BINFMT_ELF_STATE just so that they disable those dummy accessors in fs/binfmt_elf.c And you're practically glueing together ARCH_BINFMT_ELF_STATE and ARCH_USE_GNU_PROPERTY. However, all the functionality is for adding the gnu property note so I think you should select both but only use ARCH_USE_GNU_PROPERTY in all the ifdeffery in your patch to at least have this as simple as possible. > I just looked at the ABI document. Which document is that? Link? > ARM has GNU_PROPERTY_AARCH64_FEATURE_1_AND 0xc0000000 > > X86 has: > GNU_PROPERTY_X86_ISA_1_USED 0xc0000000 > GNU_PROPERTY_X86_ISA_1_NEEDED 0xc0000001 > GNU_PROPERTY_X86_FEATURE_1_AND 0xc0000002 Our defines should at least have a comment pointing to that document. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette