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 X-Spam-Level: X-Spam-Status: No, score=-7.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B860FC433E2 for ; Tue, 26 May 2020 19:51:51 +0000 (UTC) Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.kernel.org (Postfix) with SMTP id 1949F207D8 for ; Tue, 26 May 2020 19:51:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Cnt67Dt2" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1949F207D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kernel-hardening-return-18877-kernel-hardening=archiver.kernel.org@lists.openwall.com Received: (qmail 16194 invoked by uid 550); 26 May 2020 19:51:44 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Received: (qmail 16150 invoked from network); 26 May 2020 19:51:43 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1590522690; bh=ojp6/YpHEc1NW2ePcbFEVlErml7dvQ+2552G/h+0Ss4=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Cnt67Dt2wLXOxwpUvPU/At41OYlrB9eXq7uQQvCL07XpgX5MFuMc5h5hvOEQfaDN2 JKi8I23q0M8jv+IaPdhSIkuHfjwGNdmfxNILnDXv1VZ2yhHJ66/ch/jRyXIplwTCW5 Sh7daajd/aAVa9IgYUOtwQ7sCi64sYamhulyYmWE= Date: Tue, 26 May 2020 20:51:27 +0100 Message-ID: <87sgfmzd8g.wl-maz@kernel.org> From: Marc Zyngier To: Oscar Carter Cc: Kees Cook , Thomas Gleixner , Jason Cooper , kernel-hardening@lists.openwall.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2] drivers/irqchip: Remove function callback casts In-Reply-To: <20200526172527.GA3465@ubuntu> References: <20200524162220.10186-1-oscar.carter@gmx.com> <87tv04z3kq.wl-maz@kernel.org> <20200526172527.GA3465@ubuntu> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI-EPG/1.14.7 (Harue) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 EasyPG/1.0.0 Emacs/26 (x86_64-pc-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI-EPG 1.14.7 - "Harue") Content-Type: text/plain; charset=US-ASCII X-SA-Exim-Connect-IP: 62.31.163.78 X-SA-Exim-Rcpt-To: oscar.carter@gmx.com, keescook@chromium.org, tglx@linutronix.de, jason@lakedaemon.net, kernel-hardening@lists.openwall.com, linux-kernel@vger.kernel.org X-SA-Exim-Mail-From: maz@kernel.org X-SA-Exim-Scanned: No (on disco-boy.misterjones.org); SAEximRunCond expanded to false On Tue, 26 May 2020 18:25:27 +0100, Oscar Carter wrote: > > On Mon, May 25, 2020 at 11:55:33AM +0100, Marc Zyngier wrote: > > On Sun, 24 May 2020 17:22:20 +0100, > > Oscar Carter wrote: > > > > > > include/linux/acpi.h | 11 +++++++++++ > > > > You now need to Cc the ACPI maintainers. > > Sorry for forgetting. No worries. In general, use scripts/get_maintainers.pl to find out who to Cc. > > > > include/linux/irqchip.h | 5 +++-- > > > 2 files changed, 14 insertions(+), 2 deletions(-) > > > > > > diff --git a/include/linux/acpi.h b/include/linux/acpi.h > > > index d661cd0ee64d..fed49b276a90 100644 > > > --- a/include/linux/acpi.h > > > +++ b/include/linux/acpi.h > > > @@ -1154,6 +1154,17 @@ struct acpi_probe_entry { > > > .driver_data = data, \ > > > } > > > > > > +#define ACPI_DECLARE_SUBTABLE_PROBE_ENTRY(table, name, table_id, \ > > > + subtable, valid, data, fn) \ > > > + static const struct acpi_probe_entry __acpi_probe_##name \ > > > + __used __section(__##table##_acpi_probe_table) = { \ > > > + .id = table_id, \ > > > + .type = subtable, \ > > > + .subtable_valid = valid, \ > > > + .probe_subtbl = (acpi_tbl_entry_handler)fn, \ > > > > It strikes me that under the guise of removing function casts, you are > > actually adding one! And this cast is actually hiding all sorts of > > sins (remove it, and see things exploding). > > Yes, if I remove it I see things exploiding. I'm very sorry. No need to be sorry. We all learn from past mistakes. > > > I've fixed it with the patch below (ACPI is such a mess of data > > structure case...). > > > diff --git a/drivers/irqchip/irq-gic-v3.c b/drivers/irqchip/irq-gic-v3.c > > index d7006ef18a0d..3870e9d4d3a8 100644 > > --- a/drivers/irqchip/irq-gic-v3.c > > +++ b/drivers/irqchip/irq-gic-v3.c > > @@ -2117,7 +2117,7 @@ static void __init gic_acpi_setup_kvm_info(void) > > } > > > > static int __init > > -gic_acpi_init(struct acpi_subtable_header *header, const unsigned long end) > > +gic_acpi_init(union acpi_subtable_headers *header, const unsigned long end) > > { > > struct acpi_madt_generic_distributor *dist; > > struct fwnode_handle *domain_handle; > > diff --git a/drivers/irqchip/irq-gic.c b/drivers/irqchip/irq-gic.c > > index 30ab623343d3..fc431857ce90 100644 > > --- a/drivers/irqchip/irq-gic.c > > +++ b/drivers/irqchip/irq-gic.c > > @@ -1593,7 +1593,7 @@ static void __init gic_acpi_setup_kvm_info(void) > > gic_set_kvm_info(&gic_v2_kvm_info); > > } > > > > -static int __init gic_v2_acpi_init(struct acpi_subtable_header *header, > > +static int __init gic_v2_acpi_init(union acpi_subtable_headers *header, > > const unsigned long end) > > { > > struct acpi_madt_generic_distributor *dist; > > diff --git a/include/linux/acpi.h b/include/linux/acpi.h > > index fed49b276a90..4f4ddbfce3d3 100644 > > --- a/include/linux/acpi.h > > +++ b/include/linux/acpi.h > > @@ -1150,7 +1150,7 @@ struct acpi_probe_entry { > > .id = table_id, \ > > .type = subtable, \ > > .subtable_valid = valid, \ > > - .probe_table = (acpi_tbl_table_handler)fn, \ > > + .probe_table = fn, \ > > .driver_data = data, \ > > } > > > > @@ -1161,7 +1161,7 @@ struct acpi_probe_entry { > > .id = table_id, \ > > .type = subtable, \ > > .subtable_valid = valid, \ > > - .probe_subtbl = (acpi_tbl_entry_handler)fn, \ > > + .probe_subtbl = fn, \ > > .driver_data = data, \ > > } > > > > Thanks for your help with this patch. I will do all the necessary changes > and I will resend a new version. > > Do you mind if I add these two lines: > > Co-developed-by: Marc Zyngier > Signed-off-by: Marc Zyngier > > in the next version to give you credit? Sure, that's very kind of you to offer. Thanks, M. -- Without deviation from the norm, progress is not possible.