Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp4180985rwl; Wed, 28 Dec 2022 00:00:00 -0800 (PST) X-Google-Smtp-Source: AMrXdXt2TmQ2sXhoF5bStKYZX6iLOCkXn6qehkvpD9L5CxuZuJP1cXuOu+qtlyhJ2BdhYGwvT7Ln X-Received: by 2002:a05:6a21:c017:b0:ac:3bb0:5346 with SMTP id bm23-20020a056a21c01700b000ac3bb05346mr31263011pzc.49.1672214399924; Tue, 27 Dec 2022 23:59:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672214399; cv=none; d=google.com; s=arc-20160816; b=YG74F6oIVPvC1WhoeXd5jctTUPqtC7uCBTPM2QHs8ePRFmHrnwTuHhcIsRPXKUci/l yS43aFi6675gMEAF8Jo6JrItucBsVL77W7yXS/eoXR9kzWTmUd14Fy7PM2TtnEJQLwh9 azgCi6WyzNvwh8ncJdXYkbdNGv5tCEBcYgdFEEiMzkVuhALTzRlc1tG2M/Qak/3t8tYw oQm5mjubA1+G1OwC2E6ufCIWZAQ5aHYExRG/P84XtT1luSMKFQJXeXYNO3Zj+qU4LwUC azQYhbVaBdC/EjtKu0oZyWWr+thaK+khh3Oat2O/zYUt81KXfLhEBZ2w8vvCIoXNYetB X3Og== 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=P1NskxbDqhvSBy+Q7d3GniEia5DopbMQ5j/u16eFo7QyqUBt/tRasr/TUmsT1RVukR NeLXmRtKsYq/IW5dxYyeQ+OdXNz3cE70h6PlkhmDkmDv0PC2pwv/ZmrTZYLPF8zyVRBP xjKkYXZbWSaNREeHdn0GyntN5Me2Ofkk/7/GVJwDJeVZvKpDN5JQTlCJxYwcU/L54v3U GT/OFSyCpPI6IHSieUq4xZFEB8zt1nVk2r7k/tIjuk0xgS6kAXsEDzerkqnPsM/q+HKB 9jn7Xl5leT4h9rcdXqDdqFjUw3jdKpGVm53um0AOjvrsIDkRlqhdKOSiKhJqzdGCLpS3 ykgQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@russell.cc header.s=fm3 header.b="J4MTx/6D"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=iC7cLEPb; 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 e6-20020a636906000000b004791b52757csi16447689pgc.136.2022.12.27.23.59.51; Tue, 27 Dec 2022 23:59:59 -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="J4MTx/6D"; dkim=pass header.i=@messagingengine.com header.s=fm2 header.b=iC7cLEPb; 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 S232587AbiL1Hat (ORCPT + 65 others); Wed, 28 Dec 2022 02:30:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58424 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232619AbiL1Hac (ORCPT ); Wed, 28 Dec 2022 02:30:32 -0500 Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 51945EA6 for ; Tue, 27 Dec 2022 23:30:31 -0800 (PST) Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 1F4963200902; Wed, 28 Dec 2022 02:30:30 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Wed, 28 Dec 2022 02:30:30 -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=1672212629; x=1672299029; bh=av aCv9mDt906Bh4sj41n++Uvq9fM0k+OtKCj4mLejVk=; b=J4MTx/6DSY86I1XPwH SXekn71UCI6T3R/aU6g6Y2eZoN/84Mdcb4RaW1vPUY63leUA3w6JqdUQLMe/AFJB IoOPqx+AaklEy4fSw5T8e6HP7Vl32AAauRe4zeNshFAlcj3AXc4F/jkk1ojTQ2A/ vSgE5I1WNK0Y9GIWLO4pvhe2Dap3FBy3rpDmfSqdR/IpljCfseNdZuYuUByME9Wx ZMk5qS3i7lybZrRaFG6CV9hONZtHWe2kRVX0cRXMHRNZrAclaEc4T1OhT+1+kTby JC2oI2wEhee5T5FUgPqUPmDvFhoCL6V5m+MzCDyp0vMKvFqvUbM0kRym0FVwSFk4 JjqA== 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=1672212629; x=1672299029; bh=avaCv9mDt906B h4sj41n++Uvq9fM0k+OtKCj4mLejVk=; b=iC7cLEPbfula0gN/zS5qUdjw70ZZp hVo9Dmhkf/OUiPVPDW3Tuupka+cPw6ONJ2Ya//dr4T1+R+UUrwDe7t69ZGLLycCy sA7HqJsBckVAx2HYJyJ+nYXnCgqtlvY3QYeq9ZbSl4eGFsRA9+umhYP2mnwHtvbM OwUa9jjsT5zcJhuk83ZPVFrsGqwNY156JN4tt7MRBoVnTHO3nYwrQ85V0JPEnZiN UL+oRsB4g8KuGUSVslzJtGd1YEp11h3QeI4T3PInDzZvPVHU5bYht894YYWxnjjE ETD+8zVT9bKNlM9vx0+za+xaf7sY5kp+lIgLl+2Hb5kPEruZ1zqd29Ciw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedriedugdduuddtucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdlfedtmdenucfjughrpefhvf evufffkffojghfggfgsedtkeertdertddtnecuhfhrohhmpeftuhhsshgvlhhlucevuhhr rhgvhicuoehruhhstghurhesrhhushhsvghllhdrtggtqeenucggtffrrghtthgvrhhnpe fhvdeugfdtvdeiieegffefffekieegvdfgiedtjeetffevfefhtdehjeffieeivdenucev lhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpehruhhstghurh esrhhushhsvghllhdrtggt X-ME-Proxy: Feedback-ID: i4421424f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 28 Dec 2022 02:30:26 -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 2/6] powerpc/secvar: WARN_ON_ONCE() if multiple secvar ops are set Date: Wed, 28 Dec 2022 18:29:39 +1100 Message-Id: <20221228072943.429266-3-ruscur@russell.cc> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221228072943.429266-1-ruscur@russell.cc> References: <20221228072943.429266-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,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