Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3037202pxu; Tue, 8 Dec 2020 01:36:03 -0800 (PST) X-Google-Smtp-Source: ABdhPJzX9P/lbUzmCrh2ZFmkH9tv0wdEQ+JyZ4TvTahgdmTSL8btwIIrWmbTGTBizpWiwZs65nde X-Received: by 2002:a17:906:268c:: with SMTP id t12mr22090480ejc.91.1607420163057; Tue, 08 Dec 2020 01:36:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607420163; cv=none; d=google.com; s=arc-20160816; b=0ahhQQ6Eevmx7curoPuuZL/jHnWyouGVo2f2lSVIz9wy+k4LVn3pxTJNKiVNB1lleK AUtH63VRdmKSh/uxs6F9BKvk11JQNNfaTCd+dqtWSQ3IK5vDqPgzIvwne2RdIS/T6np+ Vage6IZTQFg9vKJaw9orJsD4z3n1ePwYBRtKbTnDvnv+Kxubp2cqmVAGbpuXM+lFD20i 6wCgSPYZ0QqCS+3syGSQTyOvsqAHpesZocwwZPl2EoEtG1d3gERMVQUvVlwE+9Ysp9JC QhTAeOmPF83JslLeSK5tOS94zoPtgZIahff34wcki/f/MZdPvCha4JpptN7cteEAMEtg 46nA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:user-agent:references:in-reply-to :subject:cc:to:from:date:content-transfer-encoding:mime-version; bh=iv8IGnASae8xQdEZiBZPcfNYHVyHOEXxQtQhHF/7Gmg=; b=BdAzZfKV9URjgzUYwq8hnmdlPaphMIuavT0J2x5byKBal60CdNsl95b4Ha9n2/Jd1a VQFf/4MFfHv6Slw9C1m43NAELKH1JRZ/EXXFBl2lQ0jz6TsMfxeH6IqU2S8pSzEqy75M t5qfoD/6lF7NkI65Mw/R67H5ldMJkls0XQQzfVvJ9fSJP93b/GXbudOA/AdKO1FPP+Zi DUgxZP8BeN873NXpla+pXQjeG7IuLR0+cSAR11zztghtYwN+j/g31f3HEo0GjfEXM/9K miO2f+LozRrxtm8erPukbzM5+o7tvlJmtIGtmJ6UKcWljivGHe/jDFr2dL/2gH8xrntA eT0g== ARC-Authentication-Results: i=1; mx.google.com; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ce21si4656155edb.418.2020.12.08.01.35.40; Tue, 08 Dec 2020 01:36:03 -0800 (PST) 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; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728771AbgLHJbx (ORCPT + 99 others); Tue, 8 Dec 2020 04:31:53 -0500 Received: from mail.kernel.org ([198.145.29.99]:42282 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728294AbgLHJbx (ORCPT ); Tue, 8 Dec 2020 04:31:53 -0500 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 6CB8723A7E; Tue, 8 Dec 2020 09:31:12 +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 1kmZKv-00H2jk-RO; Tue, 08 Dec 2020 09:31:10 +0000 MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 08 Dec 2020 09:31:09 +0000 From: Marc Zyngier To: Pingfan Liu Cc: linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , Thomas Gleixner , Jason Cooper , Mark Rutland , linux-kernel@vger.kernel.org Subject: Re: [PATCH] arm64/irq: report bug if NR_IPI greater than max SGI during compile time In-Reply-To: <1607419304-26140-1-git-send-email-kernelfans@gmail.com> References: <1607419304-26140-1-git-send-email-kernelfans@gmail.com> User-Agent: Roundcube Webmail/1.4.9 Message-ID: <0f230af42ff4c6e4cf763b9145fb9487@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, jason@lakedaemon.net, 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 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 is already wrong, and I really don't want to add more of that. Thanks, M. -- Jazz is not dead. It just smells funny...