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 DCEA3C433FE for ; Mon, 18 Oct 2021 06:30:06 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 91EF5610C7 for ; Mon, 18 Oct 2021 06:30:06 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 91EF5610C7 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 300F36B006C; Mon, 18 Oct 2021 02:30:06 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2B0816B0071; Mon, 18 Oct 2021 02:30:06 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 19F576B0072; Mon, 18 Oct 2021 02:30:06 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0028.hostedemail.com [216.40.44.28]) by kanga.kvack.org (Postfix) with ESMTP id 0B8066B006C for ; Mon, 18 Oct 2021 02:30:06 -0400 (EDT) Received: from smtpin33.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id A7FDC8249980 for ; Mon, 18 Oct 2021 06:30:05 +0000 (UTC) X-FDA: 78708583170.33.9ECB098 Received: from mail-pg1-f169.google.com (mail-pg1-f169.google.com [209.85.215.169]) by imf22.hostedemail.com (Postfix) with ESMTP id 8A6441905 for ; Mon, 18 Oct 2021 06:30:04 +0000 (UTC) Received: by mail-pg1-f169.google.com with SMTP id s136so11828649pgs.4 for ; Sun, 17 Oct 2021 23:30:05 -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=SrZhhuie2LYb+DH8DnKTrW/zbTOuYNfpSWs+Jg+B7ZI=; b=EaHY4+nxzBbXnw4re2cGF5gs8wOdjWhvwRQb3eDdLNljCkNp8D3Cdglit6b/DEdvI2 ey56INCUK8p9wnePBtmhufxokbGfkq/bNQtz2eGE9C1+N1+IZcLiivrjaHi+fbFyw9Sm CIG7/CN1JQ+NPRu8XrkCHXO75w/J8IzbZLZsXNgIgGrssc22eKmoEH650zN1aNt6fb/E RQyug5mhR8JxjCa8hxG/oKYeTCXUcl0CnsOg/Ox97LP7sL0xsADVjLigIWesCf7KolDZ X9a2zF1I9AHYK6mcfZmGIOyZknnbra8wW42jtGvX7ZmhL6HnsRn8jCA4kg5Bq6CKLMz9 Bq+w== 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=SrZhhuie2LYb+DH8DnKTrW/zbTOuYNfpSWs+Jg+B7ZI=; b=dIYyrke0Je5Ytd7o+12lQRryf76n+zRV+sRo5iIW/QrKhIOVJuyZEzivuDhTaHOoOA wh/Yy3BV70xNmP+jNomKFbLrkQdScMm0frPPffqyfWQZH4+10pxpQlfo/76b44N69zG5 4cIMJcECooeG7GOm3q00OWtZaFkTv+SaHTY29fLcbXvji5u5OnJTUfXcswXk0OKQ0cXN QR2QJ9KEZPPKLtYdGowv41ECzonW5VfPKxlMzrKnbWIMMErJcmdtDNqiCa8FwgkNJRBU 43wldv1Yvpr4GuRz9y1QQ79JmpoUzZzZglgwhC418NeSoF5H29esqgBnxYe/VRq7yi+R VWow== X-Gm-Message-State: AOAM533wK/f9oGsXdeiz2pv8fyARu8kn+e8r2Y8LtSm4aLfKPzk48rjg 7wYeGo+TzHASyS+GaaR+zL0= X-Google-Smtp-Source: ABdhPJzH86hY+t32jbrJWE1dxVltQNRhTT8NQFAijIbO8sR0zCmyZjDW9Fs93D5vJD/a+7+qImFigg== X-Received: by 2002:aa7:86d9:0:b0:44d:a354:b803 with SMTP id h25-20020aa786d9000000b0044da354b803mr15773350pfo.21.1634538604529; Sun, 17 Oct 2021 23:30:04 -0700 (PDT) Received: from localhost ([1.128.244.1]) by smtp.gmail.com with ESMTPSA id a12sm18027761pjq.16.2021.10.17.23.30.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 17 Oct 2021 23:30:04 -0700 (PDT) Date: Mon, 18 Oct 2021 16:29:57 +1000 From: Nicholas Piggin Subject: Re: [PATCH v3 07/12] asm-generic: Define 'func_desc_t' to commonly describe function descriptors 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: In-Reply-To: MIME-Version: 1.0 Message-Id: <1634538449.eah9b31bbz.astroid@bobo.none> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 8A6441905 X-Stat-Signature: ep7onuc8m1xnoiupjqc3t3ximbor5xiy Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=EaHY4+nx; spf=pass (imf22.hostedemail.com: domain of npiggin@gmail.com designates 209.85.215.169 as permitted sender) smtp.mailfrom=npiggin@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-HE-Tag: 1634538604-123820 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Excerpts from Christophe Leroy's message of October 17, 2021 10:38 pm: > We have three architectures using function descriptors, each with its > own type and name. >=20 > Add a common typedef that can be used in generic code. >=20 > Also add a stub typedef for architecture without function descriptors, > to avoid a forest of #ifdefs. >=20 > It replaces the similar 'func_desc_t' previously defined in > arch/powerpc/kernel/module_64.c >=20 > Reviewed-by: Kees Cook > Acked-by: Arnd Bergmann > Signed-off-by: Christophe Leroy > --- [...] > diff --git a/include/asm-generic/sections.h b/include/asm-generic/section= s.h > index a918388d9bf6..33b51efe3a24 100644 > --- a/include/asm-generic/sections.h > +++ b/include/asm-generic/sections.h > @@ -63,6 +63,9 @@ extern __visible const void __nosave_begin, __nosave_en= d; > #else > #define dereference_function_descriptor(p) ((void *)(p)) > #define dereference_kernel_function_descriptor(p) ((void *)(p)) > +typedef struct { > + unsigned long addr; > +} func_desc_t; > #endif > =20 I think that deserves a comment. If it's just to allow ifdef to be=20 avoided, I guess that's okay with a comment. Would be nice if you could=20 cause it to generate a link time error if it was ever used like undefined functions, but I guess you can't. It's not a necessity though. Thanks, Nick