From patchwork Wed Sep 6 16:03:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 13375782 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E4C0FEE14AC for ; Wed, 6 Sep 2023 16:06:49 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-ID:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=HHjVhr62eZkF9K4QzOS/TzMyf4kV4y5hs4JzX6NVwnY=; b=WV0DZVYWEnSMQ6 FxxnxvcD+AFUg6F+B3X8zbJ8DJ4hIvOI+E4Fc7AZYHdUKgqRdK+QDX5680jOdZaqme3e56NKjxBbg hVj8iXFuPP1T93d6gmFSeYxOaG3QlCeOhNUuji0MIjKHPZHpnWCMGLa0bjVaGBd1SjUXMDNQneumf jMxMUtHG55yf55CP0guDPbYpz7r6zDOtJ6YirhFRDvuqSARK1QrYp+e9FzpTOaadGpvgXw7twN0Ip Ict841CGq3HXH9ANHKegHczYFHgKcGEOj2kKVkbIFtkNMGJ7pw9gk/y7R6dUlgaHb1iK136LTMxSK 8iY4FbByTSoT+STD7ehQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qdv2v-00AThq-1h; Wed, 06 Sep 2023 16:06:25 +0000 Received: from mail-pl1-x635.google.com ([2607:f8b0:4864:20::635]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qdv2s-00ATev-2S for linux-arm-kernel@lists.infradead.org; Wed, 06 Sep 2023 16:06:24 +0000 Received: by mail-pl1-x635.google.com with SMTP id d9443c01a7336-1c0c6d4d650so30493285ad.0 for ; Wed, 06 Sep 2023 09:06:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1694016380; x=1694621180; darn=lists.infradead.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=/7sZUrbu7G8VVQgLzNpnSnYE3JCJ+QM4RpfgS9EDo7w=; b=V328qFoCTBPmz8W0wUAH0aK9/x1GlYvw8HBp+oASnBTUqfDADjeTBvu+PxuTDEWM9W VaWm0OSOMHgWYwpU0n0XkzaLdcPcC9/SZe8B35BfRuJQU0vbt2AGYq6G9osDyqORhH+C 0lIkS5RrBmLgy4mqivut2/T3ekUSuVBc6nkyA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1694016380; x=1694621180; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=/7sZUrbu7G8VVQgLzNpnSnYE3JCJ+QM4RpfgS9EDo7w=; b=FT+DNfu36FT/0A7DN3AVXZDYY9kYib0a7Nwdn94u0bpHmGkq5SY6ELnc2okOB2pN6c lsIwvx/+gCflE+osoWNgNfK7kVSHQ6q6Av5rLl+70THaqtJRGeHY3iNH2vA+a+V8HtlL V7GEdgD1rzWGoOrnf6Opx+v9Qo7q8Qb6jkStjPXhnYV71PH4UD/+aSNkMqNGGlMk1WvK NPm0LKMUjncG8cSWNEcotIM1AqJaAU+YL38dymNEr2LibkyEIAQ9OWiK8awG6eCQGl1W y1CNlTSQ5y6CghUGaP8H9nHvhjSJiU153HcUJroEHw3D3aulHyO5QxmxGj37dzRPRy3k eLog== X-Gm-Message-State: AOJu0YyBddZ8EfjSkiV1AX+VWRv5Dsr9Te3fw/6JXJ+qAmpmY5VdMUzk eKxp98c7jrHpKS9UmZGn9veWsA== X-Google-Smtp-Source: AGHT+IE0tkbtilqmUzzNEAhkV7dwTH/WxCurwss0zjvA7YEgARbTqJ+cA+mwAwgj3wZJVcvv0hbP1A== X-Received: by 2002:a17:90a:ec02:b0:267:f1d0:ca70 with SMTP id l2-20020a17090aec0200b00267f1d0ca70mr16136072pjy.47.1694016379780; Wed, 06 Sep 2023 09:06:19 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:4a07:e00a:fdae:750b]) by smtp.gmail.com with ESMTPSA id ju19-20020a170903429300b001b8c689060dsm11338859plb.28.2023.09.06.09.06.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Sep 2023 09:06:19 -0700 (PDT) From: Douglas Anderson To: Mark Rutland , Catalin Marinas , Will Deacon , Sumit Garg , Daniel Thompson , Marc Zyngier Cc: linux-arm-kernel@lists.infradead.org, "Rafael J . Wysocki" , Lecopzer Chen , Chen-Yu Tsai , Tomohiro Misono , Peter Zijlstra , Masayoshi Mizuma , Stephane Eranian , Ard Biesheuvel , kgdb-bugreport@lists.sourceforge.net, Stephen Boyd , linux-perf-users@vger.kernel.org, Thomas Gleixner , ito-yuichi@fujitsu.com, Douglas Anderson , Chen-Yu Tsai , jpoimboe@kernel.org, linux-kernel@vger.kernel.org, scott@os.amperecomputing.com, vschneid@redhat.com Subject: [PATCH v13 7/7] arm64: smp: Mark IPI globals as __ro_after_init Date: Wed, 6 Sep 2023 09:03:02 -0700 Message-ID: <20230906090246.v13.7.I625d393afd71e1766ef73d3bfaac0b347a4afd19@changeid> X-Mailer: git-send-email 2.42.0.283.g2d96d420d3-goog In-Reply-To: <20230906160505.2431857-1-dianders@chromium.org> References: <20230906160505.2431857-1-dianders@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230906_090622_852580_FE10E7F6 X-CRM114-Status: GOOD ( 15.14 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Mark the three IPI-related globals in smp.c as "__ro_after_init" since they are only ever set in set_smp_ipi_range(), which is marked "__init". This is a better and more secure marking than the old "__read_mostly". Suggested-by: Stephen Boyd Acked-by: Mark Rutland Tested-by: Chen-Yu Tsai Signed-off-by: Douglas Anderson Reviewed-by: Stephen Boyd --- This patch is almost completely unrelated to the rest of the series other than the fact that it would cause a merge conflict with the series if sent separately. I tacked it on to this series in response to Stephen's feedback on v11 of this series [1]. If someone hates it (not sure why they would), it could be dropped. If someone loves it, it could be promoted to the start of the series and/or land on its own (resolving merge conflicts). [1] https://lore.kernel.org/r/CAE-0n52iVDgZa8XT8KTMj12c_ESSJt7f7A0fuZ_oAMMqpGcSzA@mail.gmail.com (no changes since v12) Changes in v12: - ("arm64: smp: Mark IPI globals as __ro_after_init") new for v12. arch/arm64/kernel/smp.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/arch/arm64/kernel/smp.c b/arch/arm64/kernel/smp.c index 1a53e57c81d0..814d9aa93b21 100644 --- a/arch/arm64/kernel/smp.c +++ b/arch/arm64/kernel/smp.c @@ -84,9 +84,9 @@ enum ipi_msg_type { MAX_IPI }; -static int ipi_irq_base __read_mostly; -static int nr_ipi __read_mostly = NR_IPI; -static struct irq_desc *ipi_desc[MAX_IPI] __read_mostly; +static int ipi_irq_base __ro_after_init; +static int nr_ipi __ro_after_init = NR_IPI; +static struct irq_desc *ipi_desc[MAX_IPI] __ro_after_init; static void ipi_setup(int cpu);