Received: by 2002:a05:6358:700f:b0:131:369:b2a3 with SMTP id 15csp3099533rwo; Thu, 3 Aug 2023 22:21:36 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFxzcgnBhYNwgjvg0U4/HtWEGPhrrg9E3itumyywYCFX9aMHH/hDmIEqE8PXfqasDQYaZPK X-Received: by 2002:a17:90a:be16:b0:262:d661:2963 with SMTP id a22-20020a17090abe1600b00262d6612963mr604440pjs.39.1691126496041; Thu, 03 Aug 2023 22:21:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691126496; cv=none; d=google.com; s=arc-20160816; b=lb3mk2S35GzWyULV6vCMOX1zCsuTg0zrt3ZSO2FFnPWKi1Hs4w+/lLCcYIJPiw6ga/ qBZ9MrwTdsrfOyKZDICykadoTG4ka3nUemlnBVYCnT3G3tlc1kc79RHK5sNBPKDInE6t 6vMxxQyBuszFpQd82XthEluGhW5QKDBPT5e4kbrrDP0ubC07JWC1Ha/QAKVbQfsOvUGh AdS+aCqArJ+T5ByB9SycQ0n3kGzfRUSmcJwqYHXIUwYYHewB5VrfI5Uym7mwxBBm4Fsn jth3IYibQGVvuzc+XAVvyIqrfRBKGIxqcZwTLwLwMopAbH48YviR05cfr6lXQGQD2nDm wuXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=78WVpSFpmXIbenrd24m7JltYbyEgqWinokwRiqNn9QQ=; fh=kMP2mvqIfRlmAQk7phFOSUQpNKNjeiiG/ZGVGxxa6iI=; b=kGRWLyxwzDEMyeJrN5SZCsEeX1W4opw/m6LfMIvw6RMFrqF4jPBjnNDUeqOiQq82MR JmS9+XNgGPnfW2/WaDNPrTCFqr2MnMO5BFem9vABeyYDmFUsvkX3gIK+fQcNJJ5XIPj/ ePwER9/qWOPibEm3qapYtSe9J2h2MYc6ivHhpsmG8EXcNDYXCKM8Jql6zCznT71Tbsqh wzZYR+LsBlBUPJBkisJD8XpXo1TpvU9+H/TbraB22ztBl7ZGc48Dni9FRTkh9Ll8uzL6 pjxuqWViDmT8KMi1fN9SAKq7e487dsaY37YktWjqjdPyEY29CO5qXUuejPrc/clbaeDw CceQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20221208 header.b="E/jDfIK2"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k2-20020a6555c2000000b0055b618c77f1si1165174pgs.194.2023.08.03.22.21.23; Thu, 03 Aug 2023 22:21:36 -0700 (PDT) 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=@gmail.com header.s=20221208 header.b="E/jDfIK2"; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231905AbjHDARN (ORCPT + 99 others); Thu, 3 Aug 2023 20:17:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229659AbjHDARM (ORCPT ); Thu, 3 Aug 2023 20:17:12 -0400 Received: from mail-ej1-x636.google.com (mail-ej1-x636.google.com [IPv6:2a00:1450:4864:20::636]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 873183AAF for ; Thu, 3 Aug 2023 17:17:06 -0700 (PDT) Received: by mail-ej1-x636.google.com with SMTP id a640c23a62f3a-99bed101b70so205633166b.3 for ; Thu, 03 Aug 2023 17:17:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1691108225; x=1691713025; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=78WVpSFpmXIbenrd24m7JltYbyEgqWinokwRiqNn9QQ=; b=E/jDfIK2P7ezXzkHxMjGuX+UXJ25ZnGTJfHravOriqzEKVZuGwR5WHHZntMJ+3qi3X 39pSODl09eX5RxwlK1rpY7wmFWVmZ/RKoC4E6ozOqYwFi+Kt4o3LThVRyNXSFC93SteX GR41mxvguKLqiMd4E4m/JR5oyQNEBFTDKYWldraPle/wraXYV0weMeJmybgmsTP3p59m j3/hQhbpSFsrg0prGYnmFfORmDCI9NNcs98ql5kQtklo5y5vFjLQAxOFlLydYm+0L6po /PO5fyg80tWctmW8TT6H+JgPFO3u7BAAgx/Bk/BCIUny71pNKVpuVHg9QPydoyFuLWsj u8DA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1691108225; x=1691713025; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=78WVpSFpmXIbenrd24m7JltYbyEgqWinokwRiqNn9QQ=; b=NR9m+xp2HSdUvN33hZl//ToDehdXqFbmSWeaYYPEMsfanp4wFKrkUbZxqJvIvon917 rf6HSejqBw91LP22ujELQe9xEnc56sTHTodrtN4YGYbetcRf/X1ItD4QhV3qxEZxmaKY 3jT4mDRGweV52fQ6cgf9WsZlTJe5x3CgWvAPUD4n2y7goE277kecS9hiERKQLFFvRaSs ZqVvAiYKOpY35cy4r+D2QvQuIJh8jlDw6pa7j3kSuGi3NkYM7ErMsOynVIQ0n626VWWQ 2ce3cj4U41swXiwkFJ+3X+ze+B2ZB13BL4zD9XZ2u6MJeR2fAJ0PR81vU9jxkDUbplGC BAMg== X-Gm-Message-State: AOJu0Yx7V7DusxTQoFwDQkbNFAZQ9bZ09hdjBwvCny/Y4WWlYEHJoBeZ 82rKDO6sVV20Pmx3Ec74zHQ= X-Received: by 2002:a17:906:8a5a:b0:969:93f2:259a with SMTP id gx26-20020a1709068a5a00b0096993f2259amr130217ejc.73.1691108224562; Thu, 03 Aug 2023 17:17:04 -0700 (PDT) Received: from andrea (host-82-57-177-142.retail.telecomitalia.it. [82.57.177.142]) by smtp.gmail.com with ESMTPSA id r23-20020a17090638d700b0099bc8db97bcsm477089ejd.131.2023.08.03.17.17.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Aug 2023 17:17:03 -0700 (PDT) Date: Fri, 4 Aug 2023 02:16:59 +0200 From: Andrea Parri To: Mathieu Desnoyers Cc: paulmck@kernel.org, paul.walmsley@sifive.com, palmer@dabbelt.com, aou@eecs.berkeley.edu, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, mmaas@google.com, hboehm@google.com, striker@us.ibm.com Subject: Re: [RFC PATCH] membarrier: riscv: Provide core serializing command Message-ID: References: <20230803040111.5101-1-parri.andrea@gmail.com> <4bf79f06-4593-134a-04dd-b8f89e96a1b8@efficios.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <4bf79f06-4593-134a-04dd-b8f89e96a1b8@efficios.com> X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 > Can you double-check that riscv switch_mm() implies a fence.i or equivalent > on the CPU doing the switch_mm ? AFAICT, (riscv) switch_mm() does not guarantee that. > AFAIR membarrier use of sync_core_before_usermode relies on switch_mm > issuing a core serializing instruction. I see. Thanks for the clarification. BTW, the comment in __schedule() suggests that membarrier also relies on switch_mm() issuing a full memory barrier: I don't think this holds. Removing the "deferred icache flush" logic in switch_mm() - in favour of a "plain" MB; FENCE.I - would meet both of these requirements. Other ideas? Andrea