Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp6776752rwl; Thu, 29 Dec 2022 20:38:58 -0800 (PST) X-Google-Smtp-Source: AMrXdXvUFC9jkHHxp5FDJb2RMdbf7GZfL98nUs+GRigSzccpuOsIAC7acYvAOJLEgypusGu4CidM X-Received: by 2002:a17:90a:ea0a:b0:219:211f:e2ae with SMTP id w10-20020a17090aea0a00b00219211fe2aemr32586672pjy.49.1672375138713; Thu, 29 Dec 2022 20:38:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672375138; cv=none; d=google.com; s=arc-20160816; b=gWfeb4Vdnfpa8F6Pfe/sMFqUrPsC6mMU34V4ChQaPqAjTvCtSeUqFUaBEYeHzw41Y3 Z/9CTR62EtDvSLUhuMPI13CVW0v2ijusJiuZ8aGlGHN9d82ToBlYM9HDbVEVx74Dr6Oc 5erZ5EiK+YfjtMfwKIbLJYb/Na0lDeOfVdTSuoisgA5N69M3OrCvr7S0A1DaP7D9B8bx pOPBWHDJBz4dStCF6bw6LtYPKlORBDNPNs8yGW355y+aP9oVy3fPIBKkl8HWDHONiSGj 2rZe9OtoZB5q5/oNb6sfPveJ/PMzAlydB8tyQdDoKitOoJMVwvWdCM/9v1TbeS3Ytea3 XDwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :feedback-id:dkim-signature:dkim-signature; bh=avaCv9mDt906Bh4sj41n++Uvq9fM0k+OtKCj4mLejVk=; b=Wr3ip+NP2P8FCoiYyYLw6uFCtfFqAdV6YwJf+OCaWiSvoiGA9rLVG+Iwe2ZhSTRUoe FQGWejprtK9FAX/6VgODieoHWhFOBjR/CjFTG9Rci1N6KKhnPGqoLXuWEREVhWBm/tln 0hKySukFkMLoWuSl/mCbIxYMteGtIHapdy1/1b5rhTojVdHOtdQ3kPy1g8zuH9ke/YgZ NRH64buhyuCPglgDQo+9wkWLR7NllM9yuegmustIRI7QU11fDzGVg4r4Bz6xNeFU4B/R ZDgeut7BDs6dWafbsQDFG1VI3Cc/7vR0EWGoOuL5ceFSnqdDKaBvh1uXfDBseaWIHPy5 cg2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@russell.cc header.s=fm3 header.b=AdfnUSDc; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=ZbpGheFs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id pi16-20020a17090b1e5000b00219d1f4b86fsi6112805pjb.117.2022.12.29.20.38.35; Thu, 29 Dec 2022 20:38:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@russell.cc header.s=fm3 header.b=AdfnUSDc; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=ZbpGheFs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234412AbiL3EVd (ORCPT + 64 others); Thu, 29 Dec 2022 23:21:33 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234024AbiL3EVO (ORCPT ); Thu, 29 Dec 2022 23:21:14 -0500 Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C00F10FD for ; Thu, 29 Dec 2022 20:21:13 -0800 (PST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id E5B9C5C034B; Thu, 29 Dec 2022 23:21:12 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Thu, 29 Dec 2022 23:21:12 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=russell.cc; h=cc :cc:content-transfer-encoding:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1672374072; x=1672460472; bh=av aCv9mDt906Bh4sj41n++Uvq9fM0k+OtKCj4mLejVk=; b=AdfnUSDcvhkNMT5qCO AGnXPlAaZOOHNImBd5bJ/NIwV2xgkd+58jc1AoriH5xNS6O3fRcoE6SNRuqLlxaC cK3q7xPoVNJ/o5hpxB1azDqdGxLQgPNxThdDaRbb+DyUP/DynwEuZEMKYpdsAAG5 PYMMGjVpK4SeMEkHZ9Sw7s30jbdUZOiJUuUNGaeD8PvSv8kNtDis/XU7D7endoJF BO0lhG9sD2t3Zj6TpS//5ramOMbnDMAoxhPBXe6aJHOTmSE/78l6fHrJAhnlIRqX iqq0GwF330APEiWRq5gb2p9SsJl46Ntwuwp04/9bm3vpH8hyKfwIOnvM84rx4ahx 2Ucg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding:date:date :feedback-id:feedback-id:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm2; t=1672374072; x=1672460472; bh=avaCv9mDt906B h4sj41n++Uvq9fM0k+OtKCj4mLejVk=; b=ZbpGheFs815c1clpgDCXEJB+Kvsq2 78bKBhR5qE0TTh0YcJGHAK43gEupTOcCfHdBwBxzEEq+9VQ1Ff+HNH7Zzv6Ro7wT jlOXwTxq7aWnVRCGlQ5hsH53iHaPdHApDrqR5LKkAbGJTbKbkjZJHsILoECooYuf T3LbJe06dlYXy1k9J2UCo8FCjJbTVSYRfK659IuDx7/vKVEJEz2Pj8eR6NYsQQ0y MGu3U5OrfayvY4YNSknH2QIhe4AL37llflnp8sxXgPFggduMkGv5lDrM+8i3NYMV 2vVTNpBcYNTZEQZjiX7jI+zAS5cxAMpjnxa4LcRigjwF1CUg/BqOOw5eA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrieehgdejtdcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecufghrlhcuvffnffculdeftddmnecujfgurhephffvve fufffkofgjfhgggfestdekredtredttdenucfhrhhomheptfhushhsvghllhcuvehurhhr vgihuceorhhushgtuhhrsehruhhsshgvlhhlrdgttgeqnecuggftrfgrthhtvghrnhephf dvuefgtddvieeigefffeffkeeigedvgfeitdejteffveefhfdtheejffeiiedvnecuvehl uhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprhhushgtuhhrse hruhhsshgvlhhlrdgttg X-ME-Proxy: Feedback-ID: i4421424f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 29 Dec 2022 23:21:09 -0500 (EST) From: Russell Currey To: linuxppc-dev@lists.ozlabs.org Cc: gregkh@linuxfoundation.org, gcwilson@linux.ibm.com, linux-kernel@vger.kernel.org, nayna@linux.ibm.com, ajd@linux.ibm.com, zohar@linux.ibm.com, mpe@ellerman.id.au, Russell Currey Subject: [PATCH v2 2/7] powerpc/secvar: WARN_ON_ONCE() if multiple secvar ops are set Date: Fri, 30 Dec 2022 15:20:09 +1100 Message-Id: <20221230042014.154483-3-ruscur@russell.cc> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221230042014.154483-1-ruscur@russell.cc> References: <20221230042014.154483-1-ruscur@russell.cc> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The secvar code only supports one consumer at a time. Multiple consumers aren't possible at this point in time, but we'd want it to be obvious if it ever could happen. Signed-off-by: Russell Currey --- arch/powerpc/kernel/secvar-ops.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/arch/powerpc/kernel/secvar-ops.c b/arch/powerpc/kernel/secvar-ops.c index 6a29777d6a2d..aa1b2adc2710 100644 --- a/arch/powerpc/kernel/secvar-ops.c +++ b/arch/powerpc/kernel/secvar-ops.c @@ -8,10 +8,12 @@ #include #include +#include -const struct secvar_operations *secvar_ops __ro_after_init; +const struct secvar_operations *secvar_ops __ro_after_init = NULL; void set_secvar_ops(const struct secvar_operations *ops) { + WARN_ON_ONCE(secvar_ops); secvar_ops = ops; } -- 2.38.1