Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp850413rdb; Thu, 30 Nov 2023 23:22:00 -0800 (PST) X-Google-Smtp-Source: AGHT+IFvD5HY9aU70rGc5gWsHlM+hDwMpgF/gKT9eeoACF0NWUo8wwJJnqYIafRx0QkxMfgJI3Rs X-Received: by 2002:a17:90b:1bcf:b0:286:568e:a489 with SMTP id oa15-20020a17090b1bcf00b00286568ea489mr1464246pjb.11.1701415319898; Thu, 30 Nov 2023 23:21:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701415319; cv=none; d=google.com; s=arc-20160816; b=K0jytusioEWrVdK3UwUutpD1/i2W+QehsvKML/WTZXXgiD4h4iyicvphyA+4Qt+k74 McPWZHzbD+u9MmTTvn98rLEDdRu7sk1Lr1gCd0Vw7wP7+2Wyks3Q8/ZCMq9oGWK3stcp Nj+dYVNX0SHOh1PzTlY+AY+ZN538QsBndnpKsKQontVFRM6KanvjpcaNzdJyy/0c0TvJ lxB3wcs6FhcKv0ybhC5LcGC1nVSIT6pY1z/PL4UwmS1/RgnN2wh80wbe2cFh/tKdyNOO 2rpC4l4+sHpk/lcsGLmNqbblEQzcE8OSvpuAk/gTcN4e1gWPfiVU+EVJuyc0qyEdbiZn IQig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:content-transfer-encoding:mime-version :message-id:date:subject:from:dkim-signature; bh=tya0TWa3RItcX8nqIYUWWzzHkzOVOpUqH7JgJB50qPo=; fh=eRK/vgshHLrkAEF1956meC+IMygpVH0xWMj1ryZyvTw=; b=IPagP60dddzcdq/YTI1pnzBvKEuxJMXiDKZrFktrUtR69ZuKt9AhzL7BLNWXVRxMMb qWk99HYyswqTf9+KtsgLeUnkVmt1Sc7hov4ANpRVxD/EBDikRF27py7AuyySXbcJ590L T4Ssrg89MeMtvzO/E9j1AgPzv7n8kxZ/qThfyVtX1bIeb/vfawNWu4xDb8b97QVcCzar s4aOpPkvQTYWsoLosbLEIUxZMFZaMbk98p0NgxOZ/Ap2zMdjROYPDcLjkdVRHYqw8jsQ 6tG+fGV0bpkdh0Fur9bzrfPzV7EEiBeD+NzaYZdUwmIjq5NjomX0GI1Og1MCUbRzJ/kd uDgw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=pprgWGcP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id nh9-20020a17090b364900b002865ae767cesi543346pjb.172.2023.11.30.23.21.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 23:21:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=pprgWGcP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id 99ED08099268; Thu, 30 Nov 2023 23:21:55 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232259AbjLAHVi (ORCPT + 99 others); Fri, 1 Dec 2023 02:21:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46790 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229768AbjLAHVg (ORCPT ); Fri, 1 Dec 2023 02:21:36 -0500 Received: from mail-ot1-x329.google.com (mail-ot1-x329.google.com [IPv6:2607:f8b0:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 320C9103 for ; Thu, 30 Nov 2023 23:21:42 -0800 (PST) Received: by mail-ot1-x329.google.com with SMTP id 46e09a7af769-6d8481094f9so140640a34.3 for ; Thu, 30 Nov 2023 23:21:42 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1701415301; x=1702020101; darn=vger.kernel.org; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:from:to:cc:subject:date:message-id:reply-to; bh=tya0TWa3RItcX8nqIYUWWzzHkzOVOpUqH7JgJB50qPo=; b=pprgWGcPM/3T9jfq/bJZT/rESzI2nYsXQPD+XwefIc8nfm8J1p2BgxayUsWqv0sRNS J7Rzw3fWZIyEvcoL1VpoN+edE1UsXxGvZH8H7tzmJFsSAcOSajlHjHHfuZi+5hmpHwmd pm0yxDpKxly0var0U6vTtPbncZeUnD6Rxu9ZcW58D7df1nxOCxy0aGRfXxjQCt0FDzU3 KXz2W8+fKdLSNNPkeA/PI0s1o+Ho6FmiadQY06LYFeFcaXncrRLQb0YZAkI5wXANUMSh zY+O7x8L7mukF2C6S3/T0BSRCOHaPvq839GPrhmfSrhIaw5dz5PilWjhHyUlzXDcLiBG jEUQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1701415301; x=1702020101; h=cc:to:content-transfer-encoding:mime-version:message-id:date :subject:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=tya0TWa3RItcX8nqIYUWWzzHkzOVOpUqH7JgJB50qPo=; b=oMl5gF6xQEHDnJpm4eN2OJMe/lBnFggFYWZZ8Xe3R8wWmYABYkaE6bG6/AgB3c3neq XOKXBGUmPKF8c7HpomFLai3ximDhuj4SwKS6+Bei9kRDER1MG6IA9lxx4CwOqK1lSUON tN85Vkqa5Gr3YFhjvcmJj8j/LoWR1/2AfTFZQqH8JwiIMjDRldkY8dZUO+awu0QjOzD2 eAgGDkKkJJQZDybL4BY54TVx2QXha2z+HwLJx78sV1LIoRjRHFZGJywprf03SRA7wx7k OHWzr6e1TpJX32STAtijChGDLdvxVQbiu4lbletV2at2tloPI78H3ifqdGXPgGV/dyj/ 7LTg== X-Gm-Message-State: AOJu0YyKVl16diy/1Xo68Ams/F3BDUlEnmREQfMfm1wRiVV5x+Na05G0 lmi9QKiRINd1CFnOoYGIR0v/7Q== X-Received: by 2002:a05:6830:2099:b0:6bb:1629:ab44 with SMTP id y25-20020a056830209900b006bb1629ab44mr2124999otq.7.1701415301509; Thu, 30 Nov 2023 23:21:41 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id v23-20020a0568301bd700b006d7f8da1b57sm412662ota.62.2023.11.30.23.21.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 30 Nov 2023 23:21:41 -0800 (PST) From: Charlie Jenkins Subject: [PATCH v2 0/2] riscv: Create and document PR_RISCV_SET_ICACHE_FLUSH_CTX prctl Date: Thu, 30 Nov 2023 23:21:34 -0800 Message-Id: <20231130-fencei-v2-0-2cb623ab1b1f@rivosinc.com> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit X-B4-Tracking: v=1; b=H4sIAH6JaWUC/zXMQQrCMBCF4auUWRvJjGKrq95DuminEzsLE0kkK CV3NxZd/o/Ht0KSqJLg0qwQJWvS4GvQrgFeRn8To3NtIEsHRGyNE8+ixp3dyc5td3SjhXp+RHH 62qDrUHvR9AzxvbkZv+uPIPoTGY01k7DtEHkipD5qDkk97zncYSilfACkqQconwAAAA== To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Jonathan Corbet , Conor Dooley Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Charlie Jenkins X-Mailer: b4 0.12.3 X-Developer-Signature: v=1; a=ed25519-sha256; t=1701415300; l=1252; i=charlie@rivosinc.com; s=20231120; h=from:subject:message-id; bh=b2zSSjTaQJ7sjFJuqSSx5uHyDjW7oZfa+GC3felkcT4=; b=QuTLw6KTUXYWFveyBXw4+Jiy8hHpNSCmoo5bYnYjdnPJekg5cZnQ28amZhiK1f6m2FMyTRDKt iANhxEXAhkjDM80OIdzE4k9cK34yLk4RYHWS8/zrvh0/ZkK+pMYkZ1q X-Developer-Key: i=charlie@rivosinc.com; a=ed25519; pk=t4RSWpMV1q5lf/NWIeR9z58bcje60/dbtxxmoSfBEcs= X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, 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 morse.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 (morse.vger.email [0.0.0.0]); Thu, 30 Nov 2023 23:21:55 -0800 (PST) Improve the performance of icache flushing by creating a new prctl flag PR_RISCV_SET_ICACHE_FLUSH_CTX. The interface is left generic to allow for future expansions such as with the proposed J extension [1]. Documentation is also provided to explain the use case. [1] https://github.com/riscv/riscv-j-extension Signed-off-by: Charlie Jenkins --- Changes in v2: - Fix kernel-doc comment (Conor) - Link to v1: https://lore.kernel.org/r/20231122-fencei-v1-0-bec0811cb212@rivosinc.com --- Charlie Jenkins (2): riscv: Include riscv_set_icache_flush_ctx prctl documentation: Document PR_RISCV_SET_ICACHE_FLUSH_CTX prctl Documentation/arch/riscv/cmodx.rst | 98 ++++++++++++++++++++++++++++++++++++++ Documentation/arch/riscv/index.rst | 1 + arch/riscv/include/asm/mmu.h | 2 + arch/riscv/include/asm/processor.h | 6 +++ arch/riscv/mm/cacheflush.c | 37 ++++++++++++++ arch/riscv/mm/context.c | 8 ++-- include/uapi/linux/prctl.h | 3 ++ kernel/sys.c | 6 +++ 8 files changed, 158 insertions(+), 3 deletions(-) --- base-commit: b85ea95d086471afb4ad062012a4d73cd328fa86 change-id: 20231117-fencei-f9f60d784fa0 -- - Charlie