Received: by 2002:ab2:710b:0:b0:1ef:a325:1205 with SMTP id z11csp1403255lql; Tue, 12 Mar 2024 16:56:58 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCX20iCHwtMLRuuTtU2TMEVNTZuKfFkrLI1iMTjLJ1aAC+if/UkjVxf94KmrwTQqpEOxI/tdxa20g6K51As68yD2lL/ogu3SDQfqL3M7pw== X-Google-Smtp-Source: AGHT+IEj2UThdXVftAYFc45tKxDE1noFGcGAhsXjN3avCXj1Zv/PeVJM/t/KqeZrliKT54gwftb/ X-Received: by 2002:a05:6102:906:b0:473:b738:1a00 with SMTP id x6-20020a056102090600b00473b7381a00mr3097121vsh.21.1710287818079; Tue, 12 Mar 2024 16:56:58 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710287818; cv=pass; d=google.com; s=arc-20160816; b=KQmy5q0SRbYxkNQtdFdzqDu3DE8HRfEThSd26wYnf6OetvkhOGq0OHchj09Rk7kVGx /QCIiDLlAJW6CyPOZhL/s4CFfMNv5XlAWJycwcz9RKrVUL/jwYnLa3Vn+/HPZPyeVfpW ZkppKZFxrTLSg6WdOFWv8t6it1ZvbjCVlRInjFt27yrVISsCFVk1jgHxykPzuhjgaPzt 7CPL+v1SX/RoiESdbsPW+PWWdQyMnVBr36r0BVL33dvGZzA5KN7IM/t3mBPXKFy4wwKo p3XkUwtgWBaIp79CzFnHtl/HPpq5b8phRs0XvR6gAn8v8E9v0wdi5W4E5vCXa7lzPtLY FbQA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=zl9PC7FMZlnjsGfkV0mu1AuaGsWjNCYzUqWD8hwrZds=; fh=pAs1Kwz6K07aFYd6GTm2tsH0Q+HLEJ/6iguFYvrCBj8=; b=H0RMPjbZs8Hyz6ymD4kr3miwZLc6YGjIdFqg8X3EQ4TNnHwfy2YmjIzBZzqRHo/niB UEd7tCN28tCZ2U1KQeABAEVQsSnYpJz/kByK88k9x6Q4GfJhIjgSm9+32JaI+ZrEgnuj TqdVN/jOR9HO4niZoASwhxA42LrVmAswZyN5RpQ7O7GRpcu0Oq4YgoQcjhFgyWP/xsk2 AwH19AgwdrZfTmxEVQciJersK8UWKc4n7BRTWlgJJX7k8mpjaYxsqvJezW2rKXKnuE0U GOu6aPOuyrSxz+YbG9Owa6Hlgv5x8ZgIgKDYltJuy7LYXmDlTMxc+com40Dbi9hhxOhj j8CQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=Usr2HyC0; arc=pass (i=1 spf=pass spfdomain=sifive.com dkim=pass dkdomain=sifive.com dmarc=pass fromdomain=sifive.com); spf=pass (google.com: domain of linux-kernel+bounces-100947-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100947-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [147.75.199.223]) by mx.google.com with ESMTPS id r20-20020a056214125400b00690c43b9dc0si8081249qvv.424.2024.03.12.16.56.57 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 12 Mar 2024 16:56:58 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-100947-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) client-ip=147.75.199.223; Authentication-Results: mx.google.com; dkim=pass header.i=@sifive.com header.s=google header.b=Usr2HyC0; arc=pass (i=1 spf=pass spfdomain=sifive.com dkim=pass dkdomain=sifive.com dmarc=pass fromdomain=sifive.com); spf=pass (google.com: domain of linux-kernel+bounces-100947-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.199.223 as permitted sender) smtp.mailfrom="linux-kernel+bounces-100947-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=sifive.com 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 ny.mirrors.kernel.org (Postfix) with ESMTPS id C6FE31C21451 for ; Tue, 12 Mar 2024 23:56:57 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4F2844AEC8; Tue, 12 Mar 2024 23:56:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="Usr2HyC0" Received: from mail-qt1-f173.google.com (mail-qt1-f173.google.com [209.85.160.173]) (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 DDD994643B for ; Tue, 12 Mar 2024 23:56:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.173 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710287812; cv=none; b=JXVCAA20hxTyGTU6gRcd1kj3Tt+YlTUDOGl/zl1dPEk8BK4URaYFgjUhY9kST5B7jECpFxIy1IyY3SvLjamXTbxU43FHjl7qTEF8EeklbkqcOMFuUM7tvpxnGU1icG7G0zi6xDlh7ktrnCNn0d3RQ9xSt/8o1MVDC/Uu5K4txRw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710287812; c=relaxed/simple; bh=093KVda26WqmqdJht4WhK6nR+8yU7yPh9WYzE3fzY7Q=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=unklYNXMy0WXltwlZnkANCtPpNrCMgcec4spgefR46UQFFJeqFPOcbBD9W68fhVu6EsTJxxQ0tqZBlFsQcgr9vIdv7YCMJbSiVRHwz/hGIySJsdadiGYS6C6Laz/mnbd0PIGtBp5E1S/czGp2NtuKML79r6QM6PD5uhaHFYDsXM= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=sifive.com; spf=pass smtp.mailfrom=sifive.com; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b=Usr2HyC0; arc=none smtp.client-ip=209.85.160.173 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=sifive.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=sifive.com Received: by mail-qt1-f173.google.com with SMTP id d75a77b69052e-42a029c8e62so38591821cf.1 for ; Tue, 12 Mar 2024 16:56:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; t=1710287810; x=1710892610; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=zl9PC7FMZlnjsGfkV0mu1AuaGsWjNCYzUqWD8hwrZds=; b=Usr2HyC0zap0I51WQ4AOjvcHDJ52/pGaqx0+9TN/K0M0JKXWbe2QJVqw3wpuySQljX HVk0CmWQBiTIYk+pjxvzsVSHvGke+VAbNcpelvvYKSj5suP/E9ZlJvDtwbbL6sMLQ1RB 5vdpT83NM7GeJB+I30Cio/M8vUl66kqGz1356YAS2RR62LBmFSGTNeJnd6KhZmgJCypv 6cb3wf1t4o5H80D5X7si/VliOnbldr/oZl9o+6EOQxF7j7f5QcVYYE9jsP6F3GNWDmu1 z4fwzlWuyszg68TmY0ObHfl6jfy1r1niEhXoJU1SHhrAgdeIzzfMO2rSj6Zjzdx0HGrU aFsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1710287810; x=1710892610; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=zl9PC7FMZlnjsGfkV0mu1AuaGsWjNCYzUqWD8hwrZds=; b=DA/hz9oJ/QX8YlzFydxe8bw981sfVolfRpJhQXHmvyH3TfNZPCXr7n3PZswDEeNMSS P96nHRgnqvhJlH9wtm4eacMKhMEc+yi4zcvGXLNMA8NhMQSFBcmFQtpwya5A4uK/n/zU rbOk0qMy4tMJuZqSynUVIvElegIpf24dfiJV6z9F+sVAH1FkDvyszfT3DADBRfysERMf sJeD905Z3tSCAI9kKFzcXf/nLkB1jlR6IeysCeDVr2DYrJQk9B5pWwJzKCZUhJHiJ5tM gsqQaWX3s14GNPDgvmjQ/cqL9vk0da9Jn1oR8cp3LKupuWcFs8U8ebqfj+NCCA77L4X5 AqoA== X-Forwarded-Encrypted: i=1; AJvYcCVacTppzMDjH7oD4m4JuF5K1iBrJmW45DdKltXk+bTTmVzB0WR5HgM4lVBIBzKqlKVNZlSJ2q+kpvM0/LyDIfIpZOXh4MfR6jHdoOos X-Gm-Message-State: AOJu0YxJaF06s7hzy4RNRU60IuBdRrgVMkvTPjhgca8BAUmx2pZg3Hxf nBR8yjo9JgG5V++GlQqA8V8uFkZgDZiJQA2njiDl0FdbZFe5Tqpdmdgl4xJO4wM= X-Received: by 2002:a0c:fc41:0:b0:690:7a4f:d670 with SMTP id w1-20020a0cfc41000000b006907a4fd670mr13082479qvp.8.1710287809872; Tue, 12 Mar 2024 16:56:49 -0700 (PDT) Received: from [100.64.0.1] ([170.85.8.176]) by smtp.gmail.com with ESMTPSA id r6-20020a0cf606000000b0069046d929a3sm4080243qvm.145.2024.03.12.16.56.47 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 12 Mar 2024 16:56:48 -0700 (PDT) Message-ID: <1c24d9d8-36dd-4bf1-a1b0-afd371fbb809@sifive.com> Date: Tue, 12 Mar 2024 18:56:47 -0500 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v13 2/4] riscv: Include riscv_set_icache_flush_ctx prctl Content-Language: en-US To: Charlie Jenkins Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, Atish Patra , Alexandre Ghiti , Paul Walmsley , Palmer Dabbelt , Albert Ou , Jonathan Corbet , Conor Dooley , =?UTF-8?B?Q2zDqW1lbnQgTMOpZ2Vy?= , Atish Patra , Randy Dunlap , Alexandre Ghiti References: <20240312-fencei-v13-0-4b6bdc2bbf32@rivosinc.com> <20240312-fencei-v13-2-4b6bdc2bbf32@rivosinc.com> From: Samuel Holland In-Reply-To: <20240312-fencei-v13-2-4b6bdc2bbf32@rivosinc.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 2024-03-12 6:53 PM, Charlie Jenkins wrote: > Support new prctl with key PR_RISCV_SET_ICACHE_FLUSH_CTX to enable > optimization of cross modifying code. This prctl enables userspace code > to use icache flushing instructions such as fence.i with the guarantee > that the icache will continue to be clean after thread migration. > > Signed-off-by: Charlie Jenkins > Reviewed-by: Atish Patra > Reviewed-by: Alexandre Ghiti > --- > arch/riscv/include/asm/mmu.h | 2 + > arch/riscv/include/asm/processor.h | 10 ++++ > arch/riscv/include/asm/switch_to.h | 23 ++++++++ > arch/riscv/mm/cacheflush.c | 111 +++++++++++++++++++++++++++++++++++++ > arch/riscv/mm/context.c | 19 ++++--- > include/uapi/linux/prctl.h | 6 ++ > kernel/sys.c | 6 ++ > 7 files changed, 169 insertions(+), 8 deletions(-) Thanks for the updates! Reviewed-by: Samuel Holland