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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0E20EC433EF for ; Fri, 15 Oct 2021 06:01:34 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DE1586115C for ; Fri, 15 Oct 2021 06:01:33 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230236AbhJOGDj (ORCPT ); Fri, 15 Oct 2021 02:03:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51140 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230030AbhJOGDi (ORCPT ); Fri, 15 Oct 2021 02:03:38 -0400 Received: from mail-pg1-x52e.google.com (mail-pg1-x52e.google.com [IPv6:2607:f8b0:4864:20::52e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5440CC061570; Thu, 14 Oct 2021 23:01:32 -0700 (PDT) Received: by mail-pg1-x52e.google.com with SMTP id 66so7632849pgc.9; Thu, 14 Oct 2021 23:01:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:subject:to:cc:references:in-reply-to:mime-version :message-id:content-transfer-encoding; bh=DRXHnGOtNMfw8OWo78ntmmDlXjC+sRWdxkm3O7xJKjA=; b=m7MXudFQQqL1/k+ClP+ZXqn1o6SFyJ1f66Q3Bu5Odc8OBiFPiJ13cAIC7Bb91L57Qa wg5htfRXIvWmL1XBYWjt/KapNQJ484jheOqT4laWX+5LN25duemH5efLGCCw1ezRbE2D oHMydeL853jKYzvsuglxlc6/9GhP1bSqW16TyWHFANeiap8ne6FIAs3VXM7FPdZAJDPr hU16Gs2Zstt6WT2sdSKZuMLxHFbekr7X7SOwkFRSxnKP5z+P1yr4gzJjxpUvxVIfW4aP QUYuse0SEylu3+vPw+KSZUvOf1cy/kCU1ZZUBIG6P0gbZ5pbPXMIlVRrCdBvd6rsYHuZ EXjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:subject:to:cc:references:in-reply-to :mime-version:message-id:content-transfer-encoding; bh=DRXHnGOtNMfw8OWo78ntmmDlXjC+sRWdxkm3O7xJKjA=; b=c61tfo9B2mqFZLPsi/oP043cu7aJD6igHju2A76vzFluFnsMaIO8H1Tkv1H3e20jm6 y6X2aTHEQxYO9tcOACPfcmcrLIbKPSqi8Ngdklj9L6Uz6YLd9vexllnJF7CqK/+UZ80I Gu/9VKvhxW6u5utqWLNeakF5znYMo/ClD2rIh4yWDoghqLrOqMeSh/vdYeRbTxfPXctN 8i/l5ObXmGISMGYfDnku0zvoExVlYXi4mn6DlwLVuGDBuzrbn3pUqrhPKfsw35MmpptJ 74jDdSvXkluEtGRLHVciqmr5l6bafcQzI1GhYPcKq8hmKMKZ7byFVjMhWptlo5rNxkFl TmTQ== X-Gm-Message-State: AOAM533lYEysCwentAmTxn8txfVQK4t4uGT7b5okj23biGdWjIJeDn6G KMnBrxC9alErUQeYZ7K+zI8= X-Google-Smtp-Source: ABdhPJyx9VH+hAArTXbMzhj3941MCZEg4aTo2VOCQWAyZHa9YGltTOulV3JGtxxAcgJGHi5zyYTL3Q== X-Received: by 2002:a05:6a00:1487:b0:44d:c51:c88b with SMTP id v7-20020a056a00148700b0044d0c51c88bmr10003874pfu.32.1634277691871; Thu, 14 Oct 2021 23:01:31 -0700 (PDT) Received: from localhost (14-203-144-177.static.tpgi.com.au. [14.203.144.177]) by smtp.gmail.com with ESMTPSA id v6sm3998303pfv.83.2021.10.14.23.01.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 23:01:31 -0700 (PDT) Date: Fri, 15 Oct 2021 16:01:26 +1000 From: Nicholas Piggin Subject: Re: [PATCH v2 02/13] powerpc: Rename 'funcaddr' to 'addr' in 'struct ppc64_opd_entry' To: Andrew Morton , Arnd Bergmann , Benjamin Herrenschmidt , Christophe Leroy , Helge Deller , Greg Kroah-Hartman , "James E.J. Bottomley" , Kees Cook , Michael Ellerman , Paul Mackerras Cc: linux-arch@vger.kernel.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org References: <49f59a8bf2c4d95cfaa03bd3dd3c1569822ad6ba.1634190022.git.christophe.leroy@csgroup.eu> In-Reply-To: <49f59a8bf2c4d95cfaa03bd3dd3c1569822ad6ba.1634190022.git.christophe.leroy@csgroup.eu> MIME-Version: 1.0 Message-Id: <1634277517.7t2t049cd5.astroid@bobo.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-parisc@vger.kernel.org Excerpts from Christophe Leroy's message of October 14, 2021 3:49 pm: > There are three architectures with function descriptors, try to > have common names for the address they contain in order to > refactor some functions into generic functions later. >=20 > powerpc has 'funcaddr' > ia64 has 'ip' > parisc has 'addr' >=20 > Vote for 'addr' and update 'struct ppc64_opd_entry' accordingly. It is the "address of the entry point of the function" according to=20 powerpc ELF spec, so addr seems fine. Reviewed-by: Nicholas Piggin >=20 > Reviewed-by: Kees Cook > Signed-off-by: Christophe Leroy > --- > arch/powerpc/include/asm/elf.h | 2 +- > arch/powerpc/include/asm/sections.h | 2 +- > arch/powerpc/kernel/module_64.c | 6 +++--- > 3 files changed, 5 insertions(+), 5 deletions(-) >=20 > diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/el= f.h > index a4406714c060..bb0f278f9ed4 100644 > --- a/arch/powerpc/include/asm/elf.h > +++ b/arch/powerpc/include/asm/elf.h > @@ -178,7 +178,7 @@ void relocate(unsigned long final_address); > =20 > /* There's actually a third entry here, but it's unused */ > struct ppc64_opd_entry { > - unsigned long funcaddr; > + unsigned long addr; > unsigned long r2; > }; > =20 > diff --git a/arch/powerpc/include/asm/sections.h b/arch/powerpc/include/a= sm/sections.h > index 6e4af4492a14..32e7035863ac 100644 > --- a/arch/powerpc/include/asm/sections.h > +++ b/arch/powerpc/include/asm/sections.h > @@ -77,7 +77,7 @@ static inline void *dereference_function_descriptor(voi= d *ptr) > struct ppc64_opd_entry *desc =3D ptr; > void *p; > =20 > - if (!get_kernel_nofault(p, (void *)&desc->funcaddr)) > + if (!get_kernel_nofault(p, (void *)&desc->addr)) > ptr =3D p; > return ptr; > } > diff --git a/arch/powerpc/kernel/module_64.c b/arch/powerpc/kernel/module= _64.c > index 6baa676e7cb6..82908c9be627 100644 > --- a/arch/powerpc/kernel/module_64.c > +++ b/arch/powerpc/kernel/module_64.c > @@ -72,11 +72,11 @@ static func_desc_t func_desc(unsigned long addr) > } > static unsigned long func_addr(unsigned long addr) > { > - return func_desc(addr).funcaddr; > + return func_desc(addr).addr; > } > static unsigned long stub_func_addr(func_desc_t func) > { > - return func.funcaddr; > + return func.addr; > } > static unsigned int local_entry_offset(const Elf64_Sym *sym) > { > @@ -187,7 +187,7 @@ static int relacmp(const void *_x, const void *_y) > static unsigned long get_stubs_size(const Elf64_Ehdr *hdr, > const Elf64_Shdr *sechdrs) > { > - /* One extra reloc so it's always 0-funcaddr terminated */ > + /* One extra reloc so it's always 0-addr terminated */ > unsigned long relocs =3D 1; > unsigned i; > =20 > --=20 > 2.31.1 >=20 >=20 >=20 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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E109AC433F5 for ; Fri, 15 Oct 2021 06:02:10 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (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 0E46560FDA for ; Fri, 15 Oct 2021 06:02:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0E46560FDA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4HVwdr5VgYz30MC for ; Fri, 15 Oct 2021 17:02:08 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=m7MXudFQ; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=gmail.com (client-ip=2607:f8b0:4864:20::532; helo=mail-pg1-x532.google.com; envelope-from=npiggin@gmail.com; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=m7MXudFQ; dkim-atps=neutral Received: from mail-pg1-x532.google.com (mail-pg1-x532.google.com [IPv6:2607:f8b0:4864:20::532]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4HVwdC1Hm6z2xr1 for ; Fri, 15 Oct 2021 17:01:34 +1100 (AEDT) Received: by mail-pg1-x532.google.com with SMTP id e65so5249082pgc.5 for ; Thu, 14 Oct 2021 23:01:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=date:from:subject:to:cc:references:in-reply-to:mime-version :message-id:content-transfer-encoding; bh=DRXHnGOtNMfw8OWo78ntmmDlXjC+sRWdxkm3O7xJKjA=; b=m7MXudFQQqL1/k+ClP+ZXqn1o6SFyJ1f66Q3Bu5Odc8OBiFPiJ13cAIC7Bb91L57Qa wg5htfRXIvWmL1XBYWjt/KapNQJ484jheOqT4laWX+5LN25duemH5efLGCCw1ezRbE2D oHMydeL853jKYzvsuglxlc6/9GhP1bSqW16TyWHFANeiap8ne6FIAs3VXM7FPdZAJDPr hU16Gs2Zstt6WT2sdSKZuMLxHFbekr7X7SOwkFRSxnKP5z+P1yr4gzJjxpUvxVIfW4aP QUYuse0SEylu3+vPw+KSZUvOf1cy/kCU1ZZUBIG6P0gbZ5pbPXMIlVRrCdBvd6rsYHuZ EXjA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:subject:to:cc:references:in-reply-to :mime-version:message-id:content-transfer-encoding; bh=DRXHnGOtNMfw8OWo78ntmmDlXjC+sRWdxkm3O7xJKjA=; b=VPX1WZth+t2l7Qm57P3PjlGtuNxceCcxPwhOrSoxYGbEEYYCSSmMbfG1VCGa1TXOmI wiCg71c32DO+3h1E/AQ9V4ukgRzYa6kg+RahXgs06F27teckdn5+Xlx3y+DRzZeidQds QtA8fKxOmf402IJ3cK/Hr8VxBtbBGhq+w0A+W5d8ZQDb4lFhcWZwU0IQzcZvQP4malBM a3AmfL6B1yZxXHnjy2Y2x+euMWt57TSGb2RRMK/4EmoVpFacHYIN/mVv77S2Rz6Eoy14 Vdb/PvLHbDM0mAf+LbjiJBDANGOO6QEbBpml0cILhKpJLaF8vEuNpRo+UtUSshh+YFmw ZL7g== X-Gm-Message-State: AOAM530Ziw+5tCzA18cM5K6DMv+ezLe44pQFe9RsGhWj9ynLeE+3owza RFGdxj+5mZ/IQkNYTqLHfOo= X-Google-Smtp-Source: ABdhPJyx9VH+hAArTXbMzhj3941MCZEg4aTo2VOCQWAyZHa9YGltTOulV3JGtxxAcgJGHi5zyYTL3Q== X-Received: by 2002:a05:6a00:1487:b0:44d:c51:c88b with SMTP id v7-20020a056a00148700b0044d0c51c88bmr10003874pfu.32.1634277691871; Thu, 14 Oct 2021 23:01:31 -0700 (PDT) Received: from localhost (14-203-144-177.static.tpgi.com.au. [14.203.144.177]) by smtp.gmail.com with ESMTPSA id v6sm3998303pfv.83.2021.10.14.23.01.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 14 Oct 2021 23:01:31 -0700 (PDT) Date: Fri, 15 Oct 2021 16:01:26 +1000 From: Nicholas Piggin Subject: Re: [PATCH v2 02/13] powerpc: Rename 'funcaddr' to 'addr' in 'struct ppc64_opd_entry' To: Andrew Morton , Arnd Bergmann , Benjamin Herrenschmidt , Christophe Leroy , Helge Deller , Greg Kroah-Hartman , "James E.J. Bottomley" , Kees Cook , Michael Ellerman , Paul Mackerras References: <49f59a8bf2c4d95cfaa03bd3dd3c1569822ad6ba.1634190022.git.christophe.leroy@csgroup.eu> In-Reply-To: <49f59a8bf2c4d95cfaa03bd3dd3c1569822ad6ba.1634190022.git.christophe.leroy@csgroup.eu> MIME-Version: 1.0 Message-Id: <1634277517.7t2t049cd5.astroid@bobo.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arch@vger.kernel.org, linux-ia64@vger.kernel.org, linux-parisc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linuxppc-dev@lists.ozlabs.org Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Excerpts from Christophe Leroy's message of October 14, 2021 3:49 pm: > There are three architectures with function descriptors, try to > have common names for the address they contain in order to > refactor some functions into generic functions later. >=20 > powerpc has 'funcaddr' > ia64 has 'ip' > parisc has 'addr' >=20 > Vote for 'addr' and update 'struct ppc64_opd_entry' accordingly. It is the "address of the entry point of the function" according to=20 powerpc ELF spec, so addr seems fine. Reviewed-by: Nicholas Piggin >=20 > Reviewed-by: Kees Cook > Signed-off-by: Christophe Leroy > --- > arch/powerpc/include/asm/elf.h | 2 +- > arch/powerpc/include/asm/sections.h | 2 +- > arch/powerpc/kernel/module_64.c | 6 +++--- > 3 files changed, 5 insertions(+), 5 deletions(-) >=20 > diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/el= f.h > index a4406714c060..bb0f278f9ed4 100644 > --- a/arch/powerpc/include/asm/elf.h > +++ b/arch/powerpc/include/asm/elf.h > @@ -178,7 +178,7 @@ void relocate(unsigned long final_address); > =20 > /* There's actually a third entry here, but it's unused */ > struct ppc64_opd_entry { > - unsigned long funcaddr; > + unsigned long addr; > unsigned long r2; > }; > =20 > diff --git a/arch/powerpc/include/asm/sections.h b/arch/powerpc/include/a= sm/sections.h > index 6e4af4492a14..32e7035863ac 100644 > --- a/arch/powerpc/include/asm/sections.h > +++ b/arch/powerpc/include/asm/sections.h > @@ -77,7 +77,7 @@ static inline void *dereference_function_descriptor(voi= d *ptr) > struct ppc64_opd_entry *desc =3D ptr; > void *p; > =20 > - if (!get_kernel_nofault(p, (void *)&desc->funcaddr)) > + if (!get_kernel_nofault(p, (void *)&desc->addr)) > ptr =3D p; > return ptr; > } > diff --git a/arch/powerpc/kernel/module_64.c b/arch/powerpc/kernel/module= _64.c > index 6baa676e7cb6..82908c9be627 100644 > --- a/arch/powerpc/kernel/module_64.c > +++ b/arch/powerpc/kernel/module_64.c > @@ -72,11 +72,11 @@ static func_desc_t func_desc(unsigned long addr) > } > static unsigned long func_addr(unsigned long addr) > { > - return func_desc(addr).funcaddr; > + return func_desc(addr).addr; > } > static unsigned long stub_func_addr(func_desc_t func) > { > - return func.funcaddr; > + return func.addr; > } > static unsigned int local_entry_offset(const Elf64_Sym *sym) > { > @@ -187,7 +187,7 @@ static int relacmp(const void *_x, const void *_y) > static unsigned long get_stubs_size(const Elf64_Ehdr *hdr, > const Elf64_Shdr *sechdrs) > { > - /* One extra reloc so it's always 0-funcaddr terminated */ > + /* One extra reloc so it's always 0-addr terminated */ > unsigned long relocs =3D 1; > unsigned i; > =20 > --=20 > 2.31.1 >=20 >=20 >=20 From mboxrd@z Thu Jan 1 00:00:00 1970 From: Nicholas Piggin Date: Fri, 15 Oct 2021 06:01:26 +0000 Subject: Re: [PATCH v2 02/13] powerpc: Rename 'funcaddr' to 'addr' in 'struct ppc64_opd_entry' Message-Id: <1634277517.7t2t049cd5.astroid@bobo.none> List-Id: References: <49f59a8bf2c4d95cfaa03bd3dd3c1569822ad6ba.1634190022.git.christophe.leroy@csgroup.eu> In-Reply-To: <49f59a8bf2c4d95cfaa03bd3dd3c1569822ad6ba.1634190022.git.christophe.leroy@csgroup.eu> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Andrew Morton , Arnd Bergmann , Benjamin Herrenschmidt , Christophe Leroy , Helge Deller , Greg Kroah-Hartman , "James E.J. Bottomley" , Kees Cook , Michael Ellerman , Paul Mackerras Cc: linux-arch@vger.kernel.org, linux-ia64@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-parisc@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Excerpts from Christophe Leroy's message of October 14, 2021 3:49 pm: > There are three architectures with function descriptors, try to > have common names for the address they contain in order to > refactor some functions into generic functions later. > > powerpc has 'funcaddr' > ia64 has 'ip' > parisc has 'addr' > > Vote for 'addr' and update 'struct ppc64_opd_entry' accordingly. It is the "address of the entry point of the function" according to powerpc ELF spec, so addr seems fine. Reviewed-by: Nicholas Piggin > > Reviewed-by: Kees Cook > Signed-off-by: Christophe Leroy > --- > arch/powerpc/include/asm/elf.h | 2 +- > arch/powerpc/include/asm/sections.h | 2 +- > arch/powerpc/kernel/module_64.c | 6 +++--- > 3 files changed, 5 insertions(+), 5 deletions(-) > > diff --git a/arch/powerpc/include/asm/elf.h b/arch/powerpc/include/asm/elf.h > index a4406714c060..bb0f278f9ed4 100644 > --- a/arch/powerpc/include/asm/elf.h > +++ b/arch/powerpc/include/asm/elf.h > @@ -178,7 +178,7 @@ void relocate(unsigned long final_address); > > /* There's actually a third entry here, but it's unused */ > struct ppc64_opd_entry { > - unsigned long funcaddr; > + unsigned long addr; > unsigned long r2; > }; > > diff --git a/arch/powerpc/include/asm/sections.h b/arch/powerpc/include/asm/sections.h > index 6e4af4492a14..32e7035863ac 100644 > --- a/arch/powerpc/include/asm/sections.h > +++ b/arch/powerpc/include/asm/sections.h > @@ -77,7 +77,7 @@ static inline void *dereference_function_descriptor(void *ptr) > struct ppc64_opd_entry *desc = ptr; > void *p; > > - if (!get_kernel_nofault(p, (void *)&desc->funcaddr)) > + if (!get_kernel_nofault(p, (void *)&desc->addr)) > ptr = p; > return ptr; > } > diff --git a/arch/powerpc/kernel/module_64.c b/arch/powerpc/kernel/module_64.c > index 6baa676e7cb6..82908c9be627 100644 > --- a/arch/powerpc/kernel/module_64.c > +++ b/arch/powerpc/kernel/module_64.c > @@ -72,11 +72,11 @@ static func_desc_t func_desc(unsigned long addr) > } > static unsigned long func_addr(unsigned long addr) > { > - return func_desc(addr).funcaddr; > + return func_desc(addr).addr; > } > static unsigned long stub_func_addr(func_desc_t func) > { > - return func.funcaddr; > + return func.addr; > } > static unsigned int local_entry_offset(const Elf64_Sym *sym) > { > @@ -187,7 +187,7 @@ static int relacmp(const void *_x, const void *_y) > static unsigned long get_stubs_size(const Elf64_Ehdr *hdr, > const Elf64_Shdr *sechdrs) > { > - /* One extra reloc so it's always 0-funcaddr terminated */ > + /* One extra reloc so it's always 0-addr terminated */ > unsigned long relocs = 1; > unsigned i; > > -- > 2.31.1 > > >