Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp864373pxb; Tue, 1 Feb 2022 12:02:16 -0800 (PST) X-Google-Smtp-Source: ABdhPJyZ6hEOax10eQ+4zQjaVB3KH8+znyr3uT4iid2wafQ421hS3CXZPEy7LxXKhY9nJ6cyXFBP X-Received: by 2002:a17:903:2446:: with SMTP id l6mr28087889pls.48.1643745736551; Tue, 01 Feb 2022 12:02:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643745736; cv=none; d=google.com; s=arc-20160816; b=NTPFISlQa7vaEbgjZT/cxCmOsORndPp19eYv5+2xQrC6r/Wdj/MmZyjdkeMmxvnxtM dbFBEhj6KwAFLBpYYEAcSUejedZZuw5bTMcmBGdvYM/PapDF0hyRRys132UGql1egi0f Qduq/Nda5qSHIRuDFjrtJjy3xyr7KoT3hAWZs3PV+8oFZ6/bKzIFvxDHlaJBIQZXggST xcRIC0+XXvhXkQa/1shmunFZi7MkmZ195eu+/sqdB7VvBIPQRsMo7Z1P3tuSuKS8TQq7 XY7hu+T3M23R1D5w6fSZ1Yhsw27mrTpJ5wfGYxRIR/M2xKndP5urBD6Yt4oUfGqzqtCU iycg== 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 :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=dSY6r/U2eOW+PnPJdIXDfDnGtJRGunfMcHm71Idf+Go=; b=hVe0s0+bmBAlJUl0dpedKkPWtX7kXWR2LeQAUs1LPQwDxrUyieBra/XHVHJuTy0eJa zdX7t/SA81sKvbr2MpvVlEV+1xK1PW69DiK+rvARBnboXpdyN+ABRYha9MlEA2/iVzB8 m67O+L8VFRpuAlDAVFKRlSworLZJe7vMxhVlzR4Qx+yTzfUIt2WHql00AnOHFFcKSil0 BVTC63B6NgoDxVvhfT7qDHBp5NTG3oVA45zR1eDjMk6jq/VtdBKCFCklhY1w7t1fDpdR SAZE4mZaJcJtkRdcKgqKOEyi3LHPnpQaRgxIqTR0QhXsx+kNSUOH1FfGZcKKvkLZOSkh qKng== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qzvc0p+o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id l71si16182200pge.724.2022.02.01.12.02.03; Tue, 01 Feb 2022 12:02:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=qzvc0p+o; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1359637AbiAaLO4 (ORCPT + 99 others); Mon, 31 Jan 2022 06:14:56 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349210AbiAaLGv (ORCPT ); Mon, 31 Jan 2022 06:06:51 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 334DBC061394; Mon, 31 Jan 2022 03:04:49 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id E2D22B82A59; Mon, 31 Jan 2022 11:04:47 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3979FC340E8; Mon, 31 Jan 2022 11:04:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1643627086; bh=A87i1zJgpgfpgVNLS/bYqudetWowmmB8GJRnlDrhw9M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=qzvc0p+oQf2nZqzS5n6jfCvaioZK6f0IDsX+/uyRehccWYf+s+Nb4iNphDVlcb0Un 3ysgIzOJfmliAxEMgR5c0q6LbmXN5eAjGS0rmhn8/LN6YWht2Qq728U7P3V50T6kBU Hnyxc0ZoHrtUSulKriZPH8YjxTZIuydrpFVOc0h4= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mathieu Desnoyers , "Peter Zijlstra (Intel)" Subject: [PATCH 5.10 037/100] sched/membarrier: Fix membarrier-rseq fence command missing from query bitmask Date: Mon, 31 Jan 2022 11:55:58 +0100 Message-Id: <20220131105221.694727913@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220131105220.424085452@linuxfoundation.org> References: <20220131105220.424085452@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Mathieu Desnoyers commit 809232619f5b15e31fb3563985e705454f32621f upstream. The membarrier command MEMBARRIER_CMD_QUERY allows querying the available membarrier commands. When the membarrier-rseq fence commands were added, a new MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ_BITMASK was introduced with the intent to expose them with the MEMBARRIER_CMD_QUERY command, the but it was never added to MEMBARRIER_CMD_BITMASK. The membarrier-rseq fence commands are therefore not wired up with the query command. Rename MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ_BITMASK to MEMBARRIER_PRIVATE_EXPEDITED_RSEQ_BITMASK (the bitmask is not a command per-se), and change the erroneous MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ_BITMASK (which does not actually exist) to MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ. Wire up MEMBARRIER_PRIVATE_EXPEDITED_RSEQ_BITMASK in MEMBARRIER_CMD_BITMASK. Fixing this allows discovering availability of the membarrier-rseq fence feature. Fixes: 2a36ab717e8f ("rseq/membarrier: Add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ") Signed-off-by: Mathieu Desnoyers Signed-off-by: Peter Zijlstra (Intel) Cc: # 5.10+ Link: https://lkml.kernel.org/r/20220117203010.30129-1-mathieu.desnoyers@efficios.com Signed-off-by: Greg Kroah-Hartman --- kernel/sched/membarrier.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) --- a/kernel/sched/membarrier.c +++ b/kernel/sched/membarrier.c @@ -19,11 +19,11 @@ #endif #ifdef CONFIG_RSEQ -#define MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ_BITMASK \ +#define MEMBARRIER_PRIVATE_EXPEDITED_RSEQ_BITMASK \ (MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ \ - | MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ_BITMASK) + | MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED_RSEQ) #else -#define MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ_BITMASK 0 +#define MEMBARRIER_PRIVATE_EXPEDITED_RSEQ_BITMASK 0 #endif #define MEMBARRIER_CMD_BITMASK \ @@ -31,7 +31,8 @@ | MEMBARRIER_CMD_REGISTER_GLOBAL_EXPEDITED \ | MEMBARRIER_CMD_PRIVATE_EXPEDITED \ | MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED \ - | MEMBARRIER_PRIVATE_EXPEDITED_SYNC_CORE_BITMASK) + | MEMBARRIER_PRIVATE_EXPEDITED_SYNC_CORE_BITMASK \ + | MEMBARRIER_PRIVATE_EXPEDITED_RSEQ_BITMASK) static void ipi_mb(void *info) {