Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754783AbbHXPHq (ORCPT ); Mon, 24 Aug 2015 11:07:46 -0400 Received: from www.linutronix.de ([62.245.132.108]:47129 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753820AbbHXPHp (ORCPT ); Mon, 24 Aug 2015 11:07:45 -0400 Date: Mon, 24 Aug 2015 17:07:13 +0200 (CEST) From: Thomas Gleixner To: Qais Yousef cc: Marc Zyngier , "alsa-devel@alsa-project.org" , Jason Cooper , "linux-kernel@vger.kernel.org" , "linux-mips@linux-mips.org" Subject: Re: [PATCH 01/10] irqchip: irq-mips-gic: export gic_send_ipi In-Reply-To: <55DB29B5.3010202@imgtec.com> Message-ID: References: <1440419959-14315-1-git-send-email-qais.yousef@imgtec.com> <1440419959-14315-2-git-send-email-qais.yousef@imgtec.com> <55DB15EB.3090109@imgtec.com> <55DB1CD2.5030300@arm.com> <55DB29B5.3010202@imgtec.com> User-Agent: Alpine 2.11 (DEB 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2094 Lines: 50 On Mon, 24 Aug 2015, Qais Yousef wrote: > On 08/24/2015 02:32 PM, Marc Zyngier wrote: > > I'd rather see something more "architected" than this blind export, or > > at least some level of filtering (the idea random drivers can access > > such a low-level function doesn't make me feel very good). > > I don't know how to architect this better or how to perform the filtering, > but I'm happy to hear suggestions and try them out. > Keep in mind that detecting GIC and writing your own gic_send_ipi() is very > simple. I have done this when the driver was out of tree. So restricting it by > not exporting it will not prevent someone from really accessing the > functionality, it's just they have to do it their own way. Keep in mind that we are not talking about out of tree hackery. We talk about a kernel code submission and I doubt, that you will get away with a GIC detection/fiddling burried in your driver code. Keep in mind that just slapping an export to some random function is not much better than doing a GIC hack in the driver. Marcs concerns about blindly exposing IPI functionality to drivers is well justified and that kind of coprocessor stuff is not unique to your particular SoC. We're going to see such things more frequently in the not so distant future, so we better think now about proper solutions to that problem. There are a couple of issues to solve: 1) How is the IPI which is received by the coprocessor reserved in the system? 2) How is it associated to a particular driver? 3) How do we ensure that a driver cannot issue random IPIs and can only send the associated ones? None of these issues are handled by your export. So we need a core infrastructure which allows us to do that. The requirements are pretty clear from the above and Marc might have some further restrictions in mind. Thanks, tglx -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/