[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c29348d8-caae-5226-d095-ae3992d88338@intel.com>
Date: Wed, 19 May 2021 15:14:58 -0700
From: "Yu, Yu-cheng" <yu-cheng.yu@...el.com>
To: Borislav Petkov <bp@...en8.de>
Cc: x86@...nel.org, "H. Peter Anvin" <hpa@...or.com>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...hat.com>, linux-kernel@...r.kernel.org,
linux-doc@...r.kernel.org, linux-mm@...ck.org,
linux-arch@...r.kernel.org, linux-api@...r.kernel.org,
Arnd Bergmann <arnd@...db.de>,
Andy Lutomirski <luto@...nel.org>,
Balbir Singh <bsingharora@...il.com>,
Cyrill Gorcunov <gorcunov@...il.com>,
Dave Hansen <dave.hansen@...ux.intel.com>,
Eugene Syromiatnikov <esyr@...hat.com>,
Florian Weimer <fweimer@...hat.com>,
"H.J. Lu" <hjl.tools@...il.com>, Jann Horn <jannh@...gle.com>,
Jonathan Corbet <corbet@....net>,
Kees Cook <keescook@...omium.org>,
Mike Kravetz <mike.kravetz@...cle.com>,
Nadav Amit <nadav.amit@...il.com>,
Oleg Nesterov <oleg@...hat.com>, Pavel Machek <pavel@....cz>,
Peter Zijlstra <peterz@...radead.org>,
Randy Dunlap <rdunlap@...radead.org>,
"Ravi V. Shankar" <ravi.v.shankar@...el.com>,
Vedvyas Shanbhogue <vedvyas.shanbhogue@...el.com>,
Dave Martin <Dave.Martin@....com>,
Weijiang Yang <weijiang.yang@...el.com>,
Pengfei Xu <pengfei.xu@...el.com>,
Haitao Huang <haitao.huang@...el.com>,
Mark Brown <broonie@...nel.org>,
Catalin Marinas <catalin.marinas@....com>
Subject: Re: [PATCH v26 26/30] ELF: Introduce arch_setup_elf_property()
On 5/19/2021 11:10 AM, Borislav Petkov wrote:
> On Tue, Apr 27, 2021 at 01:43:11PM -0700, Yu-cheng Yu wrote:
>> @@ -1951,6 +1951,8 @@ config X86_SHADOW_STACK
>> depends on AS_WRUSS
>> depends on ARCH_HAS_SHADOW_STACK
>> select ARCH_USES_HIGH_VMA_FLAGS
>> + select ARCH_USE_GNU_PROPERTY
>> + select ARCH_BINFMT_ELF_STATE
> ^^^^^^^^
>
> What's that for? Isn't ARCH_USE_GNU_PROPERTY enough?
>
ARCH_USE_GNU_PROPERTY is for defining parsing functions, e.g.
arch_parse_elf_property(),
arch_setup_property().
ARCH_BINFMT_ELF_STATE is for defining "struct arch_elf_state".
However, those parsing functions take (struct arch_elf_state *) as an
input. 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.
[...]
>
>> diff --git a/include/uapi/linux/elf.h b/include/uapi/linux/elf.h
>> index 30f68b42eeb5..24ba55ba8278 100644
>> --- a/include/uapi/linux/elf.h
>> +++ b/include/uapi/linux/elf.h
>> @@ -455,4 +455,13 @@ typedef struct elf64_note {
>> /* Bits for GNU_PROPERTY_AARCH64_FEATURE_1_BTI */
>> #define GNU_PROPERTY_AARCH64_FEATURE_1_BTI (1U << 0)
>>
>> +/* .note.gnu.property types for x86: */
>> +#define GNU_PROPERTY_X86_FEATURE_1_AND 0xc0000002
>
> Why not 0xc0000001? ARM64 is 0xc0000000...
>
I just looked at the ABI document.
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
Yu-cheng
Powered by blists - more mailing lists