Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp836514pxj; Thu, 20 May 2021 23:43:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwm2vID/a2s9qQeFztmdeXD5p4QOrR9+lPsEcXLjxfeJc7yMBeGhe234VcBvcqOyKcB7NVd X-Received: by 2002:a05:6402:2714:: with SMTP id y20mr9294002edd.348.1621579380144; Thu, 20 May 2021 23:43:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621579380; cv=none; d=google.com; s=arc-20160816; b=xJugkTZOxniD1BTU+M1c7DvqI2DZJjXFBesgtUPTcXUxCNbaEnRJFFuqczUA1oPY8n Zz2bIUDkcgrxdZ1PRTgm8lkVHf1HAurK5NjqATj2bd4dK5QnClYGfveY0dxi+Hlv6g6A hmvr0Hgl8g04MVsnQlr+e4DylOEPHNISITLsqCZNtBmQ0fCAdoAR4zPfUxvRjgQXEVpM 5f5CjvV5V8ijPOLNJzPMTZyYlRx616Jg/k5pSx2VY3CT9qnhqBzcYX5Buj4gEWeUu7Vt 4Hkwc//Y9bXukq2oTZLfz91Lui+FI4cfEwBNhOQEC80a857J1AJg8J/DqVIT2YXFzGbH Ga5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:ironport-sdr:ironport-sdr; bh=Ap6EXo+uP/V2lTNyMEvJaZH+ySoq+2yD6tu3ta9DAII=; b=oTgZPkVdExKPQ5J4ke2TbN+yc/+AXdMflUT5D1t1UGdFanVju4TT+/Du/27WjGjJzJ JrE97dSC9BdK+ICwxJ2VfOfFp1DPuYIps8XlqiAqO8tkxYPk6CnMV2YfFlmwoU3fSOqL lNMMtgxMi47o3EigZO7eNeqI1k48TWJsdP4UN+TZlex1CpEavGmwElm7vEdS31s/C6Je Mv+s/R0dcCjvdE89lb4WvsphcBdPD24WlacELudU/rDHFVt7rBCCFntTTcrz6ferJ9A0 lzYduQLY0iHY8mCRfpr/7tEa+C7VNCI2Ms2yj3mtguHIlMrGNuo3NrKiZv5zjBVIgMs5 xHGw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id cy24si4274743edb.333.2021.05.20.23.42.37; Thu, 20 May 2021 23:43:00 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233183AbhETRTg (ORCPT + 99 others); Thu, 20 May 2021 13:19:36 -0400 Received: from mga06.intel.com ([134.134.136.31]:21876 "EHLO mga06.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231730AbhETRTe (ORCPT ); Thu, 20 May 2021 13:19:34 -0400 IronPort-SDR: qrlswRfHOWb/ahG1ob9aj0ZqJAasiwKywXqw564NefupT5MYaVKxXYqhxT6+9YbAW6tfUJcio9 E3oN2Q2J4WpQ== X-IronPort-AV: E=McAfee;i="6200,9189,9990"; a="262508282" X-IronPort-AV: E=Sophos;i="5.82,313,1613462400"; d="scan'208";a="262508282" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga104.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2021 10:18:11 -0700 IronPort-SDR: +Ag2SsApIJEIlKZfue7i6g7Kg5zY9nUKyaziq+N5gU5DS0FMi1OlubULGDUNx+eIrh36+w89Ij 4osxWTb2YRng== X-IronPort-AV: E=Sophos;i="5.82,313,1613462400"; d="scan'208";a="475283324" Received: from yyu32-mobl1.amr.corp.intel.com (HELO [10.209.167.234]) ([10.209.167.234]) by fmsmga002-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 20 May 2021 10:18:10 -0700 Subject: Re: [PATCH v26 26/30] ELF: Introduce arch_setup_elf_property() To: Borislav Petkov 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 References: <20210427204315.24153-1-yu-cheng.yu@intel.com> <20210427204315.24153-27-yu-cheng.yu@intel.com> From: "Yu, Yu-cheng" Message-ID: Date: Thu, 20 May 2021 10:18:10 -0700 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.10.2 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 5/20/2021 2:26 AM, Borislav Petkov wrote: > 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. > ARM64 has ARCH_USE_GNU_PROPERTY and ARCH_BINFMT_ELF_STATE selected unconditionally. We will do the same for X86_64 and remove the ifdeffery. >> 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. > The latest pdf's are posted here. https://gitlab.com/x86-psABIs/x86-64-ABI/-/wikis/x86-64-psABI Thanks, Yu-cheng