Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp7608194rwi; Mon, 24 Oct 2022 17:34:27 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5p+pXHUrNJQITrVd4vq7EYMzEhz7f9dkyrUaXh9vTnraPN1yJ3HYHjdqCzTNtAHmSih6ws X-Received: by 2002:a05:6a00:1a4d:b0:563:a7c4:f521 with SMTP id h13-20020a056a001a4d00b00563a7c4f521mr36242332pfv.61.1666658067614; Mon, 24 Oct 2022 17:34:27 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666658067; cv=none; d=google.com; s=arc-20160816; b=c1CFbCsF+frfOvwmd2HByJyRB864lTQRLXxI3oWxsAFYdnEQxrv9C4TMeIBtTgyjoa f1Hxe6KL589BjgCJfOv2i8U2yvfDK088qxN2orSChUfs8PCtEEdkedaHnxGKfElZG9bk Wl+l8E2418E2tSO3dnjLi3raKRuwD3GIs4HZ8Uxa2ppF3L7AWN0R0JqIJJf2XoAPKkdS NluC54ctK5KMJVfe+ONxh215nxEyspEo1KEFoSL/it0z6PdnoSjfTh3jW9REb/GkDcsE w06tqd6hu9WL6uUPnB1Vku4zVO2mM7tN2T9i9ln1AOobW0e1XKf3tQ0Q9f1CL8f5rNCx Q8lQ== 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 :dkim-signature; bh=zd0UdwukHOVtwRwki6PrGgmZEnO5hdVYT3KEZp4+4q0=; b=md38hd09IRX8NStTb67cN/46GGoaigd+SwfqEqiG9NjvB7xL29fGAABzMtU6rbX+od Du/EuAHXvbJ2yBlBWak1wGd85v9AVpIcus1nAPHnNrE/zNsFaETwr6PFF2egkrqbO3pI 9abu/6eeIaJl64hxc2MCMxI1WteA86LQ4za9OUDZ9B21cm/eLPD3shBz+dtHxdqN7d/l LrWODfwQ9FnuHPt7c844JALr76H4d0LuEQiP7YAM7vHT3Gr96dekZ6Yc5tm0RFZ/Vnel uMcZkcDkXBJIT7kWJykdTpNYrLsGmTWDy8ARpdE++rlwui4sz9RRX7DfB6vCCe3WCnwo II9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=aQxgHaZd; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id io20-20020a17090312d400b00176db49b734si984193plb.283.2022.10.24.17.34.19; Mon, 24 Oct 2022 17:34:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-wireless-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=@intel.com header.s=Intel header.b=aQxgHaZd; spf=pass (google.com: domain of linux-wireless-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-wireless-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230280AbiJYAds (ORCPT + 65 others); Mon, 24 Oct 2022 20:33:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229945AbiJYAdS (ORCPT ); Mon, 24 Oct 2022 20:33:18 -0400 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B07D757BE4; Mon, 24 Oct 2022 15:58:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1666652294; x=1698188294; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=t3bv2MkjydtsyaQXVR2HQj9d69MKIx3tGIYCICf7vKY=; b=aQxgHaZdJNYAbonuzsqyEAE9Y4sl0jDSCJoSSfd5mL4a+CYBr/TDVdIE 4Az5nQ1kMpKjb4OUs+oJmIBzCckUDRbjHGOgOfaj2p1GoKictzIwzjFYG rtpRDL+oQ4OuEZMhwPGepkk70uma5xwUC4umyvF3gUrDKZ2PbPN5NzVl6 C9zbm8RZSDHBQTBny8HvbVb0JVFcrfgbINLvC7Skevtu0PApU62z3csDe jNSE0QgacAvr6Q70noiv6IB47K1Gd6pzeYaIRCif9mAU6jPZRREeouNGi sa2ujiCWAVOwBvKQLsZ9IXTrlSw2/UckrIa74+wXOaiCa3iz+NT6T9vTM g==; X-IronPort-AV: E=McAfee;i="6500,9779,10510"; a="308633274" X-IronPort-AV: E=Sophos;i="5.95,210,1661842800"; d="scan'208";a="308633274" Received: from orsmga006.jf.intel.com ([10.7.209.51]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2022 15:57:56 -0700 X-IronPort-AV: E=McAfee;i="6500,9779,10510"; a="609363403" X-IronPort-AV: E=Sophos;i="5.95,210,1661842800"; d="scan'208";a="609363403" Received: from pkearns-mobl1.amr.corp.intel.com (HELO guptapa-desk.intel.com) ([10.252.131.64]) by orsmga006-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 24 Oct 2022 15:57:56 -0700 From: Pawan Gupta To: scott.d.constable@intel.com, daniel.sneddon@linux.intel.com, Jakub Kicinski , dave.hansen@intel.com, Johannes Berg , Paolo Abeni , antonio.gomez.iglesias@linux.intel.com, "David S. Miller" , Eric Dumazet Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, x86@kernel.org, gregkh@linuxfoundation.org, netdev@vger.kernel.org Subject: [RFC PATCH 1/2] nospec: Add a generic barrier_nospec() Date: Mon, 24 Oct 2022 15:57:46 -0700 Message-Id: X-Mailer: git-send-email 2.37.3 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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-wireless@vger.kernel.org barrier_nospec() is a speculation barrier with an arch dependent implementation. Architectures that don't need a speculation barrier shouldn't have to define an arch specific version. To be able to use barrier_nospec() in non-architecture code add a generic version that does nothing. Architectures needing speculation barrier can override the generic version in their asm/barrier.h. Signed-off-by: Pawan Gupta --- include/linux/nospec.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/linux/nospec.h b/include/linux/nospec.h index c1e79f72cd89..60e040a5df27 100644 --- a/include/linux/nospec.h +++ b/include/linux/nospec.h @@ -60,6 +60,10 @@ static inline unsigned long array_index_mask_nospec(unsigned long index, (typeof(_i)) (_i & _mask); \ }) +#ifndef barrier_nospec +#define barrier_nospec() do { } while (0) +#endif + /* Speculation control prctl */ int arch_prctl_spec_ctrl_get(struct task_struct *task, unsigned long which); int arch_prctl_spec_ctrl_set(struct task_struct *task, unsigned long which, -- 2.37.3