Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp3043512pxu; Tue, 8 Dec 2020 01:49:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJxcxMR0FmqPEO+ncAXFDEkueCpLqHOPvuCXXlrczLMFt476UJYHQrywt3aKv+OUaId637ao X-Received: by 2002:a17:906:3553:: with SMTP id s19mr2511185eja.95.1607420951395; Tue, 08 Dec 2020 01:49:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1607420951; cv=none; d=google.com; s=arc-20160816; b=ndlK3n6zTKO2ypRAeNNc5oVsg8dMZp+FpQLBI6U+R98rPxqydfjFs5iovJlUtvfmWK w7xvjepgFiTrSD6USrgT7MPUrWFb0dAIfgSTTNAKooPmqaZqoNbZzbyen+4U85/hs2qb yk7RMyNm4LSctp2m/dRQgxhVdNXWkZtKAb9iqEqJIlQf0WW7XRNgiwz02sLrSl9tcm6P cMTYzFaldHRjxFew9UgxrNMYZZ/8TxXhb3PXScFDky976tLuGXNwDuCpjkrE47yeLYOv letHmANSMih1edyQG4gb5VBuSTx8GmK1JfbRnYX9rxo37BnhkXeW3dsWIjgBxWkiRFuj 8OtA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=zOfSXZUZHFJ0/IMjArCSIU3fFYQ+AgSZyhk4SA6mvo8=; b=R5ISRmUHQ3yJ8NwlgciZgfmtPOHzroH7JkSXWljGCZaq04qkMfzitWWFI34Iwi4xq2 LS/0pjSUaroAK+QY567a4S50vzRKO9crm9NuOHq4kNpW61RvU5+1lSyP4DRoroSxvlMN q25zlPpP06muZRM1XzRaEzcYdCAU3E6xbZ/gDKUF7R+SZLlTcittdnUgftUDla9iuIWI pd8WHsTwIlMzXyGIBwZSFTc7838eMYeukT7SPbqmf13GdkjGyk+4MsOZK1fn+eh5FAMX /9zpWHmbyfKxTxUk4ryUeBbFp5v7t9GetDdjCYHzgxkvNi1Q+qjnE7BDdSS7WX9FuoD+ sN3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TURij3fo; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id eb9si9908446edb.436.2020.12.08.01.48.49; Tue, 08 Dec 2020 01:49:11 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=TURij3fo; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728829AbgLHJoX (ORCPT + 99 others); Tue, 8 Dec 2020 04:44:23 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49820 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727961AbgLHJoX (ORCPT ); Tue, 8 Dec 2020 04:44:23 -0500 Received: from mail-io1-xd44.google.com (mail-io1-xd44.google.com [IPv6:2607:f8b0:4864:20::d44]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5EF85C0613D6 for ; Tue, 8 Dec 2020 01:43:37 -0800 (PST) Received: by mail-io1-xd44.google.com with SMTP id q137so16291814iod.9 for ; Tue, 08 Dec 2020 01:43:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=zOfSXZUZHFJ0/IMjArCSIU3fFYQ+AgSZyhk4SA6mvo8=; b=TURij3foAEti0mrje6JLTCEE3aN72QYT63E09q6MeQ1zqxm3dsKZao3Ot6C0mRnuKR f8Xg8CNH/AdX05HE1SF3OUZIYkbn8GRFyAYgaKrJziOyJRGu+my5MKdzw3ueT3yAdS84 a9QKCvlrroKrK0tdC35re585Rgl3XVqUfas8ayW5qO76FjHfUzx0eVTI0D9Ha6AOE+Lr C5xypVLohQ9OyKRzRMZTUIZzn8EJABqz3I+P1CPDN4TQrAtTI1UU1qAEDDBf70CFaDrf 1mJnX/RCZl44lixvN1KlX5vuGELgix8pCppYtXR0Y8wdLhwm2hRQcOlSAh7aQ8s8t5eQ F5mg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=zOfSXZUZHFJ0/IMjArCSIU3fFYQ+AgSZyhk4SA6mvo8=; b=r5LZ8aN94Hgibi6seVvq6vofDoA8lXfKfaRLNQUC/qYJquq0EeD1WBgg4/eL14hd9A HXaS6PhHtuIyfAJ+iPBVi95YS5uX/UtfqpaD2n3nCS9e14uMN5GOmxkKmblKUKuDaEjj tJqi00fXwr9W9l1eDAEJPK122NaDeqKWyJZbLMLxxBx6j7rq/usCIJ+DCGHnXwbQXfAk rcoBKqzvRVDMAI+ABaLyzm8E28BwCJNh/ZFX13NWklq12yylCGyQgCYO41c28adrcDUu Fju3G6NYCNA/xFrQOs3/OkdmzgXuydlAEppRkP6uh9787uKwC4MiHRJPXP9cnLGF6NRR A6rg== X-Gm-Message-State: AOAM533ygjUUYLW+N18WBRonv1t4aiyCnB0+gSIlXVIWG11kAJAFS8TX 5hwwoioEwOV524ymCvNTaOjwfBORokb8CgYZPA== X-Received: by 2002:a5e:c609:: with SMTP id f9mr23831527iok.41.1607420616820; Tue, 08 Dec 2020 01:43:36 -0800 (PST) MIME-Version: 1.0 References: <1607419304-26140-1-git-send-email-kernelfans@gmail.com> <0f230af42ff4c6e4cf763b9145fb9487@kernel.org> In-Reply-To: <0f230af42ff4c6e4cf763b9145fb9487@kernel.org> From: Pingfan Liu Date: Tue, 8 Dec 2020 17:43:25 +0800 Message-ID: Subject: Re: [PATCH] arm64/irq: report bug if NR_IPI greater than max SGI during compile time To: Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org, Catalin Marinas , Will Deacon , Thomas Gleixner , Jason Cooper , Mark Rutland , LKML Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? Thanks, Pingfan > is already wrong, and I really don't want to add more of that. > > Thanks, > > M. > -- > Jazz is not dead. It just smells funny...