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=-14.0 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=unavailable 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 DE10BC4361B for ; Tue, 8 Dec 2020 09:52:54 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (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 8E339233FA for ; Tue, 8 Dec 2020 09:52:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8E339233FA Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Type: Content-Transfer-Encoding:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:Message-ID:References:In-Reply-To:Subject:To:From: Date:MIME-Version:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=lq7YsO41nfIyhbIKAxRle0VHz+RJynv3Y/fV9fVFkEc=; b=kRp26doeLzGcutWABcmqJ5C1H yGOMAVUZbpPYPl8bzdjNnyQLiPZhZ/sPXDWU0zbwvOqrPuhRzSvifgej1lPs6E7H5xen5HcfeN8fu AJ8UPUjuYe24tQUUqzB7GIzUHlB1P2CdTfegePj2yMpAc1d0mPdNBe/IwTei/n+urkjC12Th36VpE 6dJl8PQKEMgJUoNOM46TvODE1Bbm+jhQ5lpCAOxiHiH45y4JvMJbxdpksPNO+IRpYPGuuAlv5w3N7 emLOXqMca5e760SulqvKIcyXIGjRTPFGHLZVtEc7j9e/Wqwt3hYgv295lvRC1xBGIMq8MRXRxtm5N 45YoFXNZQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmZeo-0004A0-Vz; Tue, 08 Dec 2020 09:51:43 +0000 Received: from mail.kernel.org ([198.145.29.99]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kmZej-00048e-JQ for linux-arm-kernel@lists.infradead.org; Tue, 08 Dec 2020 09:51:38 +0000 Received: from disco-boy.misterjones.org (disco-boy.misterjones.org [51.254.78.96]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C19F123A82; Tue, 8 Dec 2020 09:51:35 +0000 (UTC) Received: from disco-boy.misterjones.org ([51.254.78.96] helo=www.loen.fr) by disco-boy.misterjones.org with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94) (envelope-from ) id 1kmZef-00H37M-Iw; Tue, 08 Dec 2020 09:51:33 +0000 MIME-Version: 1.0 Date: Tue, 08 Dec 2020 09:51:33 +0000 From: Marc Zyngier To: Pingfan Liu Subject: Re: [PATCH] arm64/irq: report bug if NR_IPI greater than max SGI during compile time In-Reply-To: References: <1607419304-26140-1-git-send-email-kernelfans@gmail.com> <0f230af42ff4c6e4cf763b9145fb9487@kernel.org> User-Agent: Roundcube Webmail/1.4.9 Message-ID: <867be4df47247f8c56687cf2046ee7bb@kernel.org> X-Sender: maz@kernel.org X-SA-Exim-Connect-IP: 51.254.78.96 X-SA-Exim-Rcpt-To: kernelfans@gmail.com, linux-arm-kernel@lists.infradead.org, catalin.marinas@arm.com, will@kernel.org, tglx@linutronix.de, mark.rutland@arm.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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201208_045137_821457_6F3445FC X-CRM114-Status: GOOD ( 23.82 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Mark Rutland , Catalin Marinas , LKML , Thomas Gleixner , Will Deacon , linux-arm-kernel@lists.infradead.org Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="us-ascii"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On 2020-12-08 09:43, Pingfan Liu wrote: > On Tue, Dec 8, 2020 at 5:31 PM Marc Zyngier wrote: >> >> On 2020-12-08 09:21, Pingfan Liu wrote: >> > Although there is a runtime WARN_ON() when NR_IPR > max SGI, it had >> > better >> > do the check during built time, and associate these related code >> > together. >> > >> > Signed-off-by: Pingfan Liu >> > Cc: Catalin Marinas >> > Cc: Will Deacon >> > Cc: Thomas Gleixner >> > Cc: Jason Cooper >> > Cc: Marc Zyngier >> > Cc: Mark Rutland >> > To: linux-arm-kernel@lists.infradead.org >> > Cc: linux-kernel@vger.kernel.org >> > --- >> > arch/arm64/kernel/smp.c | 2 ++ >> > drivers/irqchip/irq-gic-v3.c | 2 +- >> > drivers/irqchip/irq-gic.c | 2 +- >> > include/linux/irqchip/arm-gic-common.h | 2 ++ >> > 4 files changed, 6 insertions(+), 2 deletions(-) >> > >> > diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c >> > index 18e9727..9fc383c 100644 >> > --- a/arch/arm64/kernel/smp.c >> > +++ b/arch/arm64/kernel/smp.c >> > @@ -33,6 +33,7 @@ >> > #include >> > #include >> > #include >> > +#include >> > >> > #include >> > #include >> > @@ -76,6 +77,7 @@ enum ipi_msg_type { >> > IPI_WAKEUP, >> > NR_IPI >> > }; >> > +static_assert(NR_IPI <= MAX_SGI_NUM); >> >> I am trying *very hard* to remove dependencies between the >> architecture >> code and random drivers, so this kind of check really is >> counter-productive. >> >> Driver code should not have to know the number of IPIs, because there >> is >> no requirement that all IPIs should map 1:1 to SGIs. Conflating the >> two > > Just curious about this. Is there an IPI which is not implemented by > SGI? Or mapping several IPIs to a single SGI, and scatter out due to a > global variable value? We currently have a single NS SGI left, and I'd like to move some of the non-critical IPIs over to dispatching mechanism (the two "CPU stop" IPIs definitely are candidate for merging). That's not implemented yet, but I don't see a need to add checks that would otherwise violate this IPI/SGI distinction. Thanks, M. -- Jazz is not dead. It just smells funny... _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel