From patchwork Wed Aug 30 19:11:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Doug Anderson X-Patchwork-Id: 13370703 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 7FF89C83F15 for ; Wed, 30 Aug 2023 19:14:27 +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=CAhBF5nwmvSQDKc+UfECeQrZBxzO47qusvwhsXvAtDk=; b=WtJ48LxibpcwYM q5epZKjrwBIiRFFDHiO/0py2abgEyUTnmu7utsh1Q7cYnHm+5/vTPqNPXk6IvtZMxZpVXSI9d6xT8 N26x5iARVGGxmEhTgyqntEPdygzsnNTSAZzTjWI0YvX1hINLwPIx1ifYg8sCqo3aOuc0QZ2o9JCaQ Qz5t/YW2tRKoCReogb9exAatySHiGisRSmHkz0e7GDt1dEOYzsvpqgc6wDdWMW8nK8J8wTvXYEKot JXqfpp6gKE9pnegoWO+NFOFWxh8iHQCNFmT9hC6TywOf7HY2qz6vg9Sh92PbvSshF6DwQfbt7gAEf rMMB1RSwyJ6ZWsgmuVfQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qbQdg-00E3Fp-1U; Wed, 30 Aug 2023 19:14:04 +0000 Received: from mail-pl1-x62f.google.com ([2607:f8b0:4864:20::62f]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qbQdY-00E3Ba-2h for linux-arm-kernel@lists.infradead.org; Wed, 30 Aug 2023 19:13:58 +0000 Received: by mail-pl1-x62f.google.com with SMTP id d9443c01a7336-1bf7423ef3eso37291025ad.3 for ; Wed, 30 Aug 2023 12:13:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1693422833; x=1694027633; 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=lm34Kk+maPdNp9rFuwAAy5O1fZmlUwsB3d8wqfk31DQ=; b=ObzvKN350G2E6y+aW/KnztumYqdxpe4jr+c+G8K1kNgzkSWBG3D/akfaW4OAEf8lKs kDrvJY3pr06JOkd3FV1U/+tHi0wd/f73OhOKRQu3dauyXq7MKKfn/FA0KUVZaVpn5iak 3bG/DHY6MzgBrrmVKrY8gHRb4G/pveWXBdU3w= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1693422833; x=1694027633; 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=lm34Kk+maPdNp9rFuwAAy5O1fZmlUwsB3d8wqfk31DQ=; b=CUlD8OiMZr33wWYW73uMLRYPmZgOwk5sMKqb01UJtwVgblpwcmcVK2B6r3EIBRlTwN RugvDTmPE1GtXpt/3Uqqi8O7pGFCm4xHgD1KUbC8movbon+EV38sg8tg3KcjGpM52BiD 1nkLawTxbR0A7Q6edY4VZwP/+grVOXMb/913JxbL3Kn/Pamz3oEXUHUF6BjKAcezzUAT 7tMAmM491S0sQIk2+S4LaUhFRSIga+BbOIWETJere2bF8qyu91bt+TqKiUV5i4pybmYn qguAOtlkywUgsvYHWGFsJs2618g7ROuzTPSlmjeTFtW28cxd7XfmKRFiAVccHaGuAiU2 eJ7w== X-Gm-Message-State: AOJu0Yx7+21xqbiquYyk1/PkSG9y6kVkMB3HgpHMtOlRIBk3bp6kbrw2 Qj6aRGJr1dagWsYOatlaYDSdHkp/+YEOkZA5KDuY4H1U X-Google-Smtp-Source: AGHT+IEt4V9Q3kKv3ps387mUFelpzuS3AhZ1ooWe7nWHiUV3yMAAUWymDyit8Cg7nWN79LlkVQ4iHQ== X-Received: by 2002:a17:902:b18d:b0:1b5:1467:c4e8 with SMTP id s13-20020a170902b18d00b001b51467c4e8mr2658054plr.15.1693422833430; Wed, 30 Aug 2023 12:13:53 -0700 (PDT) Received: from tictac2.mtv.corp.google.com ([2620:15c:9d:2:e315:dec6:467c:83c5]) by smtp.gmail.com with ESMTPSA id c15-20020a170902d48f00b001bbdf32f011sm11338928plg.269.2023.08.30.12.13.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 30 Aug 2023 12:13:52 -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, Masayoshi Mizuma , "Rafael J . Wysocki" , Chen-Yu Tsai , Lecopzer Chen , Tomohiro Misono , Stephane Eranian , kgdb-bugreport@lists.sourceforge.net, Peter Zijlstra , Thomas Gleixner , Stephen Boyd , ito-yuichi@fujitsu.com, linux-perf-users@vger.kernel.org, Ard Biesheuvel , Douglas Anderson , D Scott Phillips , Josh Poimboeuf , Valentin Schneider , linux-kernel@vger.kernel.org Subject: [PATCH v12 7/7] arm64: smp: Mark IPI globals as __ro_after_init Date: Wed, 30 Aug 2023 12:11:28 -0700 Message-ID: <20230830121115.v12.7.I625d393afd71e1766ef73d3bfaac0b347a4afd19@changeid> X-Mailer: git-send-email 2.42.0.283.g2d96d420d3-goog In-Reply-To: <20230830191314.1618136-1-dianders@chromium.org> References: <20230830191314.1618136-1-dianders@chromium.org> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230830_121356_921129_69045C77 X-CRM114-Status: GOOD ( 15.38 ) 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 Signed-off-by: Douglas Anderson Acked-by: Mark Rutland --- 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 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);