Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp415603ybs; Sun, 24 May 2020 09:11:53 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz5FxPcvLupoeR4k98yCbygLwInTrBjUshyIGPRmbjXKjpntMA7gKCxfEvOG90UjWTI3apI X-Received: by 2002:a17:906:bc55:: with SMTP id s21mr15440325ejv.21.1590336713125; Sun, 24 May 2020 09:11:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590336713; cv=none; d=google.com; s=arc-20160816; b=J/Jzpo9RTQPNlCCWTb2iTNvIl9Gf0jC0psO8Tni5UDUtpyAGvd/FnkEBILDOimUH4Y 6eeCrwxPW9YtII9fRI7wK0e5GN1WaBhvMQ4ejuhPWQgo/M1xfpraEyDMp9n3f97ADB6D Rx0HYQ1llGpCNpkf3EBuJ/+sWeVGLA3obe/0lZh/bJKNNeyxvFhG4UTnCHBQOJJHO6tf Udeft/kNL5fhNL6mR8/dSCFNKkrIHvhV2wxtT0f+hcHMsRZvHefWbx3ym6giN8N3cI35 IesIldTxpE8ohfmu7StiMeHl2pXKPdHPctDXm8tK0bm6rS0JHGNSyLOPx8h6EUBO6QbI e6yw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:user-agent :in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:dkim-signature; bh=VrRTacLmooTPY3eyWm8dmZd32zNc1S4D4Kvev1+y7PM=; b=0b+V9To0kxoBJXemtc+k1gwQXNA0ahhHr6lvRW1OrsY3Pzij0FvWGOgEaVbmSHEvAF FAnvDXmxGqvTLi6IBMOW0Kf8///evkPa21eianGPkHjUV7EICrhhVi+YzSHKJl/drdxR nGyMTTnGICaMuVnf8dZxAhB/c4O8UBW+DMZ862YK+FVLn4t93ieQNA0OJfvOwR+LMKdR 0d0VU3F817U++8GZ3LB9voipY5Xeucps+RkKaLk2hxfWy30MVtjmjEOUPfHME1yB5Sc0 A8kdUUqtrMJSK7X7Ea7+4o5PtDuC0o3WshC46HCumOWbxgTK3HV0KtbK0lKppTsAOj/W nyMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=CdXI2jfw; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id a9si7266337edt.564.2020.05.24.09.11.29; Sun, 24 May 2020 09:11:53 -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; dkim=pass header.i=@gmx.net header.s=badeba3b8450 header.b=CdXI2jfw; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728870AbgEXQHB (ORCPT + 99 others); Sun, 24 May 2020 12:07:01 -0400 Received: from mout.gmx.net ([212.227.17.22]:60241 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728696AbgEXQHA (ORCPT ); Sun, 24 May 2020 12:07:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=badeba3b8450; t=1590336398; bh=+nFXZkgBoRhnqmTS84jk7w6behECRnCIt5FlWN27unw=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=CdXI2jfwxkxHhkjYgEZDKBvLOInjJrIbNkTKhgpf9K51CAhgoBkwcEjwoit4E3SEA qYnPC8odvgHGPTBHYqe8ayYulpNZvBuXH0LzZ3TB9mK++veVJ9tngwqKKCk2D4xBvr FT3PkQA8DEm457CugrV4LQhgUpxkm1RYx38wACkA= X-UI-Sender-Class: 01bb95c1-4bf8-414a-932a-4f6e2808ef9c Received: from ubuntu ([83.52.229.196]) by mail.gmx.com (mrgmx105 [212.227.17.174]) with ESMTPSA (Nemesis) id 1Mirng-1j92Ve1ULE-00eusD; Sun, 24 May 2020 18:06:38 +0200 Date: Sun, 24 May 2020 18:06:26 +0200 From: Oscar Carter To: Marc Zyngier Cc: Oscar Carter , Kees Cook , Thomas Gleixner , Jason Cooper , kernel-hardening@lists.openwall.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH] drivers/irqchip: Remove function callback casts Message-ID: <20200524160626.GA30346@ubuntu> References: <20200524080910.13087-1-oscar.carter@gmx.com> <20200524124634.113203f6@why> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200524124634.113203f6@why> User-Agent: Mutt/1.10.1 (2018-07-13) X-Provags-ID: V03:K1:Rq3XbNZH4RgeTsRXWMEwPYjA3ioEEfsOiDigB7WhoZAsaaG0ZOu A9vTfGTRB8dbo96G6XNMN8kjNxfS739adOZlT3CZnIcCDasr1No/RJno1ctMLqodUVP1Bgk SgFVFy05cn/+NpRhj5PefHdt2Bqj7RYoNJiyw8LU8LYhicbq7/Vkndafu+HwdguQkL9R4Iw Fl1vzIb5IxWltG6cC69KA== X-Spam-Flag: NO X-UI-Out-Filterresults: notjunk:1;V03:K0:Ms6icXGKjqo=:aAJKyt7ZHWgYEjxcsva6bg TfGGDta8SylgAZlC0e8Fm5yeggoLM5ycxrzGDYbdY935is+0uwCG2J7tTOJB1gRhUIgKQTpvX IMZ+NEINwayiDLuOOyOjGs0qwNdMN3l2MYQ3lUstgJfwLxk7vv70ix6uZI5PpwSQqS70o0Xhr cofEv7HLyLwbkit9LHcQqE9tvK/mAitODAgaZP7lyahyYTE199ny5RcvoSVpyGiZWXAuWFER1 ucMWbN0XZiDQPuND4xrjmX0fOpe8MFzDpEOL0oYN47cGtdy8JzV5AUMKlGZUXO0o9pV1XF0Sm K7eqPRvt83gEFU7efYssBIfYAng3XA6fX1/Kc9G1Mxi9PxohX7LDskYL8WpB2avUTH0d8TdbT XOPsfhO46FqL9/1ip0PwgxVGYt1EZt1+xitrqRWWcCyg1lDkupmQz3hGX8f/zYOWUEc6aniAe tfTAqL8Y1kCldbuWNS58yjFXSrZo/LUhWbTIP7VdxC6ixk1R1n7Lg332zuNus6Qh7PZK+xfy1 6aRbzgQm2KLRxIs0E82qQP3KOsl+CXp8gr17mM2mX3xq339528I+z6JxzvW4I+tpjSx6x6IYX iicsKKZXW372r/J8zWN4lI9y+thcWCGTyCHfNVkDhJAbyoFjxfimHw/MzAgh0XqIpAQe5TWIR T5a6PjT3A4+nw5F7PxXgDbDo4NssG7OzM9CNtEGH7W8Vcts5JB33tZCW1jqw/eUEpKFU+jtQA Nc8M1uG3coH8Xw0/tlC3YNNkL4Hfq60or54Vzqlu+cXjCG3VhUiEZJpMGRq69zqy12mOHxsfQ rNP3jht0YH3I9/K3HJjrzmsITBLVibjzGipbZx3FQ6ZaMqI55PqVeGiiiXMQurF9n4fUMteWa URnaNDxdO5oAvzYOfCRGXZ9mHtjYPMkNxsqHkSnLa6PgXImSffKkYl7vHGQPOLS8cRWRkGwbV pCi+eQ0Kus03a4RaDmDNAjGIqJ36VhZuxUbEKtYdjiRaRSCPwSE3bEz2em6cXEuWMH7Zc1Afs GiBggc6JLNZrhHbYUx5aid5e/1maq8WfREz6VTeU2OcQhB0R0xp42xqH18f5DSuGogOqcKb3W Ejq6ptOajNhOXzywYNb5twLeNG5WmNSa01J7f5R4OkblHIEZpS63caeAKwa96ewKNzbN2hJO8 +dG9rj19LOUREcxThLRexH9O5qfvgWtm5SFPvvPp1HKXxfi26npXUgO6ybWe25zjZsNE9Y6p3 R4DopH9eWK6ZDTrSG Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Marc, On Sun, May 24, 2020 at 12:46:34PM +0100, Marc Zyngier wrote: > On Sun, 24 May 2020 10:09:10 +0200 > Oscar Carter wrote: > > Hi Oscar, > > Thanks for this. Comments below. > > > In an effort to enable -Wcast-function-type in the top-level Makefile = to > > support Control Flow Integrity builds, remove all the function callbac= k > > casts. > > > > To do this, modify the IRQCHIP_ACPI_DECLARE macro initializing the > > acpi_probe_entry struct directly instead of use the existent macro > > ACPI_DECLARE_PROBE_ENTRY. > > > > In this new initialization use the probe_subtbl field instead of the > > probe_table field use in the ACPI_DECLARE_PROBE_ENTRY macro. > > Please add *why* this is a valid transformation (probe_table and > probe_subtbl are part of a union). Ok, I will add a more detailed explanation. > > Signed-off-by: Oscar Carter > > --- > > include/linux/irqchip.h | 10 ++++++++-- > > 1 file changed, 8 insertions(+), 2 deletions(-) > > > > diff --git a/include/linux/irqchip.h b/include/linux/irqchip.h > > index 950e4b2458f0..1f464fd10df0 100644 > > --- a/include/linux/irqchip.h > > +++ b/include/linux/irqchip.h > > @@ -39,8 +39,14 @@ > > * @fn: initialization function > > */ > > #define IRQCHIP_ACPI_DECLARE(name, subtable, validate, data, fn) \ > > - ACPI_DECLARE_PROBE_ENTRY(irqchip, name, ACPI_SIG_MADT, \ > > - subtable, validate, data, fn) > > + static const struct acpi_probe_entry __acpi_probe_##name \ > > + __used __section(__irqchip_acpi_probe_table) =3D { \ > > + .id =3D ACPI_SIG_MADT, \ > > + .type =3D subtable, \ > > + .subtable_valid =3D validate, \ > > + .probe_subtbl =3D (acpi_tbl_entry_handler)fn, \ > > + .driver_data =3D data, \ > > + } > > > > I'd rather you add an ACPI_DECLARE_SUBTABLE_PROBE_ENTRY to acpi.h, and > use that here so that we can keep the ACPI gunk in a single place. Ok, I will do the changes you suggested and I will resend a new version. Later, I will also send a series to clean up the checkpatch warnings and errors for the acpi.h header. > > #ifdef CONFIG_IRQCHIP > > void irqchip_init(void); > > -- > > 2.20.1 > > > > > > Thanks, > > M. > -- > Jazz is not dead. It just smells funny... Thanks, Oscar Carter