Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp2935047rdh; Mon, 27 Nov 2023 02:46:20 -0800 (PST) X-Google-Smtp-Source: AGHT+IGkDQ/pNNzfIOjeSfVKKPQhyMh8tSiHgF2zbsjJsFna1pQZBFCiVOah9H7PfIM0eoDosCtM X-Received: by 2002:a9d:6c91:0:b0:6bc:63c9:7946 with SMTP id c17-20020a9d6c91000000b006bc63c97946mr12410945otr.14.1701081980268; Mon, 27 Nov 2023 02:46:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701081980; cv=none; d=google.com; s=arc-20160816; b=gpvtkcn2AUCwx3bp9ys9rveR1bHXOtsJUOWVCggEcgYjolmGDzAfnBtZeBF05OC+xp 6vDSPe3SJHxB0GR1G2uRLg1IAglc/kxnJ5hKvDyPhAyeL3hhSOG+JNBwV9eCNJzDWg35 mQgpbTvFe5vd0kGOTyxWV3xb/AfkpgS8ep7z57TwIiqWBbY4s3Ymuy/Hu4V5XA1zPTNI O6tMv5g0M/5c+JbSS4xUrJyxrdK7I+grwzPzywozqhvGO1wxcFVJjv0sPHUU9h6epORU RAH7WgsB135IUaN6ythbZVsZfDHj8LHFnxqEYiMoBO/agaJhhx3+aZMyDZxRoKOzqsQK 4ryA== 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=gJa1FyWF7p4Zri7NQ7Occzsc+hpIuACqmrTtDjYJjPY=; fh=pl8hPg/G/bsgBmFwUtLISgHBg1MkxUYPWWrcwlTkRfk=; b=gQUoHx9W73oK4BHGDbDvBt5rjDgMcTMVwjOR1iBAh/xK0EaacCShOkE728/nEdWAo7 kV8CHcxALxlVbEAf62WHkxFeR32aIfFJ790R905sUaZ0MH+JMNq1khp09qKRV0wSZ1bl XTvUvZ4IOuf+CE0XGRvSndkM+iMg4ByuRS0kyt7B6EkY8X7mZ3Q4p/md/pcPfO7zgYEI 2fv+xoCP4lSu0AqCOYC2Msa+sJQ/mtZ/Mn4kJh7heVqGNWsOQFKiIdMyuqKBPL3qrHCQ PfU9g1V1Tfl5OEPKjFTefkxtT4pxva2oKHjpkjxiWf+i16owFGIYOPFsy7f4PvftC4iP fOtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=qh760psJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id f23-20020a63f117000000b0059cc8d682dfsi9669801pgi.814.2023.11.27.02.46.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Nov 2023 02:46:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@microchip.com header.s=mchp header.b=qh760psJ; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=microchip.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id F0BF5807C542; Mon, 27 Nov 2023 02:45:49 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233060AbjK0Kpf (ORCPT + 99 others); Mon, 27 Nov 2023 05:45:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54816 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233099AbjK0Kpa (ORCPT ); Mon, 27 Nov 2023 05:45:30 -0500 Received: from esa.microchip.iphmx.com (esa.microchip.iphmx.com [68.232.154.123]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0BD5118A; Mon, 27 Nov 2023 02:45:37 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1701081936; x=1732617936; h=date:from:to:cc:subject:message-id:references: mime-version:in-reply-to; bh=XsgutPECrC8l5gZt5+iuVfsFhO1Zmfqw++3pChr2uHc=; b=qh760psJeXKP2+K+/updKoyvsVNsQqTxVuyc+xozoKNJqV7GCR82tPl1 0YWvvoUEUsmPT4pMX8msClqbxzbtoq8BnLUE4ibM8jRfp3ezqkCBx+kVo iYzgJ8HStCRd85srYfSaZeaya5ojdJBEo7egvdHUbBPoTROf5dA2iLhQb DSP68PIsWMSwZ8ZLp0awIfpJFFjTwF9DdAu2qKn13WVC6qx7UKrl/hql3 G+ShpPzB7iBzljGvtmoo5XCB+kA2RgidWLwy6bBPu/kKT8zJV1VFwidHY iL33dv50fTaT4M8JxO+z1JPL9PrT3HBhF3E0XU30mIeKUqc8I/jwGXj/t Q==; X-CSE-ConnectionGUID: rYZD7AvDRIS8Nns1pfsCSg== X-CSE-MsgGUID: ITAVCmDsQuKHnJuT89msKA== X-ThreatScanner-Verdict: Negative X-IronPort-AV: E=Sophos;i="6.04,230,1695711600"; d="asc'?scan'208";a="12250830" X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN Received: from unknown (HELO email.microchip.com) ([170.129.1.10]) by esa4.microchip.iphmx.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 27 Nov 2023 03:45:31 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21; Mon, 27 Nov 2023 03:45:25 -0700 Received: from wendy (10.10.85.11) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.21 via Frontend Transport; Mon, 27 Nov 2023 03:45:23 -0700 Date: Mon, 27 Nov 2023 10:44:54 +0000 From: Conor Dooley To: Charlie Jenkins CC: Paul Walmsley , Palmer Dabbelt , Albert Ou , Jonathan Corbet , , , Subject: Re: [PATCH 1/2] riscv: Include riscv_set_icache_flush_ctx prctl Message-ID: <20231127-epilogue-frying-4d5ba926617c@wendy> References: <20231122-fencei-v1-0-bec0811cb212@rivosinc.com> <20231122-fencei-v1-1-bec0811cb212@rivosinc.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="2dabZgh7yH7Wi+77" Content-Disposition: inline In-Reply-To: <20231122-fencei-v1-1-bec0811cb212@rivosinc.com> X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Mon, 27 Nov 2023 02:45:50 -0800 (PST) --2dabZgh7yH7Wi+77 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Nov 22, 2023 at 05:03:20PM -0800, Charlie Jenkins wrote: > + > +/** > + * Enable userspace to emit icache flushing instructions. > + * > + * When in per-process context, there may be multiple threads using the same mm. > + * Therefore, the icache can never be assumed clean when. Multiple threads in > + * the process may modify instructions in the mm concurrently. > + * > + * In per-thread context, it can be assumed that all modifications to > + * instructions in memory will be performed by this thread. When the thread is > + * migrated the icache will be flushed. > + * > + * @arg arg: Sets the type of context > + * - PR_RISCV_CTX_SW_FENCEI: Allow fence.i in userspace. Another fence.i will > + * emitted on thread/process migration. > + * @arg per_thread: When set to 0, will use the default behavior of setting the > + * icache flush context per process. When set to 1, will use a per thread > + * context. > + */ FYI, this is not valid kerneldoc and breaks allmodconfig builds: arch/riscv/mm/cacheflush.c:159: warning: This comment starts with '/**', but isn't a kernel-doc comment. Refer Documentation/doc-guide/kernel-doc.rst > +int riscv_set_icache_flush_ctx(unsigned long ctx, unsigned long per_thread) Cheers, Conor. --2dabZgh7yH7Wi+77 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZWRzJgAKCRB4tDGHoIJi 0oqZAP44BpqU7jjixzWH8EBV8qfD5EEkTbqtGTccnCfX4BmMOgEA+me3rwJrd9e/ 7h830aetbBTs0XpjcvFkekSOcjjKfwg= =GeQD -----END PGP SIGNATURE----- --2dabZgh7yH7Wi+77--