Received: by 2002:a05:7412:98c1:b0:fa:551:50a7 with SMTP id kc1csp1456400rdb; Sun, 7 Jan 2024 22:22:07 -0800 (PST) X-Google-Smtp-Source: AGHT+IEYPoxEFjk+ZiMVQkL0SVb05vYVIWsGLg2wbzRg58TU8jrwMoi4nlT2JbHYTWjZu+zjBvBJ X-Received: by 2002:a17:906:5:b0:a26:f2d9:d2b8 with SMTP id 5-20020a170906000500b00a26f2d9d2b8mr1091421eja.79.1704694927232; Sun, 07 Jan 2024 22:22:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1704694927; cv=none; d=google.com; s=arc-20160816; b=AOa3XKe7ZRQ1MdSr4VaNiMKo30z0JlDl1j/qDxNOqdBDGxAMAe/BSNbhWJzYFDYVIb Qv/AoNsWlBc+1hGOQC2HOT7L837dGlKLxNf+LuYkHLzrNMum8glXYtQg7LnL5IWAtKcP BzO6a73NsuAz5YpmYLm3OGIHcSb7T1/lsAPkJP0ZVCPgczz/ypv2gqfBCN9Hai+Hj0Fi MWFh6wC+0YJY9QcN4MhVXXnL7eczgv4nSe8EnuMs3KRMMez9jdDxMmF5EL6syjFHVR8W y5svtDp33QJ6/i8ypDsEIGlzo6QBTWjIRJMigia6E+rEPEtRDkmaQlfoOS/H+fY5V5Tu dhlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=cc:to:content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:from :dkim-signature; bh=IgN1RtSHS+JihbyfrF8H+rWapyEwSGcmrp8GqdU1aGQ=; fh=e1JlwtUWRFbXk6Wk02UhhK0dSnd5ZqIT5IDANNgKwN8=; b=s2PaDLnao5fGxZs9gmqYtEmNIQVKKV1Rnrj5PlJmiRl9VllAtN2tJax+3bIfKawUQy MBJQChjP3JUhA7o/2xa42V8fL84uOFK+S6nrlJPbTYy4ZsA/k+m9lsEAjqVqQ+Fyhvch Z/V8lbdrcIYu7iCk7AzKJuw/2J9xS80yrraydTQIiq7tFOXuf0QKOQNGRVffCq1xjtwM LwQ/dfk3R/TUVOzKLkg86JR4hguygTkNfMjzE2VuYLUB5B0RyMd5dQcQT8drl65zMBFo mmNLgMzmd2UPQwRRXFnjEtMaMvra9g4acCxdDWyInaqviwgeTgH58MHEV2TeWubdanor zO2A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=2DN7ekIG; spf=pass (google.com: domain of linux-kernel+bounces-19097-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19097-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id w18-20020a170906131200b00a26b4f3f5b9si2959232ejb.298.2024.01.07.22.22.07 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jan 2024 22:22:07 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-19097-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=2DN7ekIG; spf=pass (google.com: domain of linux-kernel+bounces-19097-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-19097-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id E454B1F217D1 for ; Mon, 8 Jan 2024 06:22:06 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DF1698C01; Mon, 8 Jan 2024 06:21:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b="2DN7ekIG" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-ot1-f48.google.com (mail-ot1-f48.google.com [209.85.210.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F156E79E0 for ; Mon, 8 Jan 2024 06:21:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=rivosinc.com Received: by mail-ot1-f48.google.com with SMTP id 46e09a7af769-6dc759c8ddbso1028484a34.0 for ; Sun, 07 Jan 2024 22:21:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1704694910; x=1705299710; 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=IgN1RtSHS+JihbyfrF8H+rWapyEwSGcmrp8GqdU1aGQ=; b=2DN7ekIGK1/yLPY1pxIflUzigmiH8i56/hivs7ATSg9Rj7YB4rOQOGV6N63042ryQk v7vTvibrGwafN5khBakC3nytLO+qBJ0mIkvNEsAbIWhhG1u/sImHGbH/jkgdEeQN1ccp KKA3+rMfbwRqMWUCfqLdupX88ahs4laXFQZe3SXcupyfb1s9wJ7pvCCY7i9xLRPESqkk QbYFxi55kYFxuKXxAqrWK8Ri0BvbhKw/v43VdKOzJMAxt00VltsCuvMKyYC3YONejfGF ncRGChFwuWh7KpVJnBBwxpSmj1oB7q+reBVOlzX2hJQ2ONjnTNvPLTvCrOkAjS9rIQ42 I6Qw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1704694910; x=1705299710; 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=IgN1RtSHS+JihbyfrF8H+rWapyEwSGcmrp8GqdU1aGQ=; b=FU5j2K3H19LqIoxnj51vQGALU0dFslo9iw+HWLYASEwZScFr5zVUJRLJHHl9x/AU6R e8OsT0atEZhpYJtaFIZIR3f58eZBhwlynuY8gxm/djC7dCQ9YmWhiaXJmL62OCbInxN8 OBvoF683tAI6Hv5q83TBt23Qur2gp6YB1/WJJsZ2mQsMenVkAdj489i74/j/Pw/3+SE6 uWoiGHQhd/np+rxrVkMr5OSi5fFOb9u9cMYPFL6WcaSWnaye9pzxQrf/8ldxcH8NI7Pp CY9QerQJRFzty0awkQ6bK9y2mPBrkEUfURjf7Im1SVN2hYI/PVESYG60R4uZcCDh3eR2 BuXA== X-Gm-Message-State: AOJu0Yx1+IwV0bYhOI27bqIgmnYiBcRg8QjB3CYtOPmeJdEHqy8VSR0x lKSx9bUudgwHRi4ZE0FT7jM2C2fcACZdaWmXsX59TmwFk0g= X-Received: by 2002:a9d:6558:0:b0:6dc:c4:c97 with SMTP id q24-20020a9d6558000000b006dc00c40c97mr1594886otl.11.1704694910008; Sun, 07 Jan 2024 22:21:50 -0800 (PST) Received: from charlie.ba.rivosinc.com ([64.71.180.162]) by smtp.gmail.com with ESMTPSA id i12-20020a9d53cc000000b006dba99e1835sm1274322oth.4.2024.01.07.22.21.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 07 Jan 2024 22:21:49 -0800 (PST) From: Charlie Jenkins Subject: [PATCH v4 0/2] riscv: Create and document PR_RISCV_SET_ICACHE_FLUSH_CTX prctl Date: Sun, 07 Jan 2024 22:21:44 -0800 Message-Id: <20240107-fencei-v4-0-d4cf2fb905d3@rivosinc.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-B4-Tracking: v=1; b=H4sIAHiUm2UC/23NTQ7CIBCG4as0rMUwQ/905T2Mi0IHOwtbA4Zom t5d2mg1xuU34XkZRSDPFMQ+G4WnyIGHPo18kwnbNf2ZJLdpC1SoAaCSjnpLLN3Olaqt6tw1SqT HV0+O70voeEq743Ab/GPpRpivrwTiOxFBKmnIqhrAGgQ8eI5D4N5u7XARcyXil9RqlZgkWlOib gwYcH+k/kgEvUo9/1kVUNSoazLVj5ym6QletJnOEwEAAA== To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Jonathan Corbet , Conor Dooley , =?utf-8?q?Cl=C3=A9ment_L=C3=A9ger?= , Atish Patra 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=1704694908; l=1657; i=charlie@rivosinc.com; s=20231120; h=from:subject:message-id; bh=kIreaapBsnIOgafnWutqHg5bxWxo+ONImq2ZU3lLm5E=; b=ei81+ovlZsn5ye8bHDG1IeVHaGGTtLEg4XHJVKc6XwI/8Hr00OB2m23YatRSjeq1jM5jcTeS4 8vIYF4k9/t2DQEpEQw+fNFyeJBf43MRFboveLsDiG4vGL6Z22QJo4pd X-Developer-Key: i=charlie@rivosinc.com; a=ed25519; pk=t4RSWpMV1q5lf/NWIeR9z58bcje60/dbtxxmoSfBEcs= 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 v4: - Add OFF flag to disallow fence.i in userspace (Atish) - Fix documentation issues (Atish) - Link to v3: https://lore.kernel.org/r/20231213-fencei-v3-0-b75158238eb7@rivosinc.com Changes in v3: - Check if value force_icache_flush set on thread, rather than in mm twice (Clément) - Link to v2: https://lore.kernel.org/r/20231130-fencei-v2-0-2cb623ab1b1f@rivosinc.com 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 | 88 ++++++++++++++++++++++++++++++++++++++ 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 | 56 ++++++++++++++++++++++++ arch/riscv/mm/context.c | 8 ++-- include/uapi/linux/prctl.h | 4 ++ kernel/sys.c | 6 +++ 8 files changed, 168 insertions(+), 3 deletions(-) --- base-commit: b85ea95d086471afb4ad062012a4d73cd328fa86 change-id: 20231117-fencei-f9f60d784fa0 -- - Charlie