Received: by 2002:ab2:620c:0:b0:1ef:ffd0:ce49 with SMTP id o12csp841875lqt; Tue, 19 Mar 2024 05:48:51 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV3WllnY5LcG3ILKWT97bWQdtNJ0WjW+c6iOtgtpFPPjyROlVXXMRfUSX6cp8IzbfreKkYaouiqgtHibm8d/jkVDFBAq3ufum/Jza8TfA== X-Google-Smtp-Source: AGHT+IFebQ/y25TeYhyZmQcJEOaPbc8MScB9wEykyjAwoMfNCqCQXsOu6hlDMyS7z7Gws2f1esSJ X-Received: by 2002:a5d:4cc5:0:b0:33e:88b4:6586 with SMTP id c5-20020a5d4cc5000000b0033e88b46586mr7075418wrt.71.1710852531126; Tue, 19 Mar 2024 05:48:51 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1710852531; cv=pass; d=google.com; s=arc-20160816; b=zkUsKAZK3zubOP6l++VGrA3XQfFx7Psdo6d61oNlCFy+7n9esGdNsAW8gd4i+2b3aM rVIhRKQWI1S5OUFwOvijWBkmsqh5JyZc3QXKTWV65DV9TUI/vRkYXRtRIw7v/yM6NjoR 9Kr8V2q3KxjgK6MqRuE2tVS+uCXTMQfycqbH8J+ez48S2TU4WhMLA+HB5jSkMnOcpVBq thoMpRvW5HawehdMSoslSVHYj+uqN8Niyb2KGnzAPC46b0xJbS/07/s1uEgqMQZLKM6I sa1fSS+/efUgbHvmyZyMnGN9VIwFXI7r/ua7DVncAsAEIR3MUZFkbLKzwHajXVWZbEEj 5G7g== 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; bh=ZjFlucG/7ReHlamZsfgMlz5s4zyEVuuDc5OqVCUT0R0=; fh=KX7Ue5TbyGtQbCP8/bVSpnxaob2LAQjsMwveeMekQF0=; b=MaJ5yW1fTTWrhPeD9SLgEf2ZOxHUnyqYLJ0V/YkWpMH/oQMeqScupMZEXWmoyWbwwJ p5w4DOjO5A6iCq/zVoZAFYEzowfnWkoQyxLzhuRQUN3SLbpxT/Y/357K2PrwcQSgK9kP rh0oQpcZfweifnIgeIC1DjYz4AkxBDa8FMz7XgkRyeurDBzIeizPvUqU4cfuHlMu0L5k LtjWfcRKC2f3DtqxZzdkPWK0ACQkIAzfGHfmR6Hqsi8gHH/F4xy1xMRB2vFGdhVbZbf3 jaqAnGBdAcBXr3jeaR7t9wtH0vy2bwWi2ypOrkEC43E/AkT26mCstYFZo/AxnLkaCP7E 2nBg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=ghiti.fr); spf=pass (google.com: domain of linux-kernel+bounces-107535-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107535-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id nc24-20020a1709071c1800b00a46bbbaa055si2176608ejc.251.2024.03.19.05.48.51 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Mar 2024 05:48:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-107535-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=ghiti.fr); spf=pass (google.com: domain of linux-kernel+bounces-107535-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-107535-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 D622B1F21CB5 for ; Tue, 19 Mar 2024 12:48:50 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id E6D0A40BE5; Tue, 19 Mar 2024 12:48:44 +0000 (UTC) Received: from relay7-d.mail.gandi.net (relay7-d.mail.gandi.net [217.70.183.200]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5DC0740842 for ; Tue, 19 Mar 2024 12:48:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=217.70.183.200 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710852522; cv=none; b=DJCTHEVM3pgTvamVoXOMN4xQIdzr7xgUsRLIVzphIPouxyAl5RmNhX5CpXCe8TXfzoL1rYNo+9MBqO8IeqD2o1OCMhUZQvkxWZ74cGG3MiF+5pT0Yx+zWYw3awT34M88yYJviun2iJJFbmOH3uA5mXJoYAtR3LYtxqqEfb5SXJk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1710852522; c=relaxed/simple; bh=eaVhfJvGv/hDmpx/njYgkJ4X//xScrjZU2TF4zYPJAg=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=ky8cjz+E8Os8sdy/pJuftJ3B5owQLN3p7kw+Tqhhbjq+IhvAGhJpIfir3In3DYMsnS8DtPLDmU7s4S5+tmdzo2cilBr9PCWaMSL37VlxrPWZPMPVQJ+6xmmPWWiAsuvaoH0cuFXvbsoCtxGftgKSmM79+IojLSPhEhjVORV36vg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ghiti.fr; spf=pass smtp.mailfrom=ghiti.fr; arc=none smtp.client-ip=217.70.183.200 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ghiti.fr Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ghiti.fr Received: by mail.gandi.net (Postfix) with ESMTPSA id E316920004; Tue, 19 Mar 2024 12:48:12 +0000 (UTC) Message-ID: <5c900e62-2101-4862-93cf-06292deccabf@ghiti.fr> Date: Tue, 19 Mar 2024 13:48:12 +0100 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] riscv: mm: Fix prototype to avoid discarding const Content-Language: en-US To: Samuel Holland , linux-riscv@lists.infradead.org Cc: Albert Ou , Alexandre Ghiti , Andrew Jones , Anup Patel , Dylan Jhong , Jisheng Zhang , Palmer Dabbelt , Paul Walmsley , Sergey Matyukevich , linux-kernel@vger.kernel.org References: <20240301201837.2826172-1-samuel.holland@sifive.com> From: Alexandre Ghiti In-Reply-To: <20240301201837.2826172-1-samuel.holland@sifive.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-GND-Sasl: alex@ghiti.fr Hi Samuel, On 01/03/2024 21:18, Samuel Holland wrote: > __flush_tlb_range() does not modify the provided cpumask, so its cmask > parameter can be pointer-to-const. This avoids the unsafe cast of > cpu_online_mask. > > Fixes: 54d7431af73e ("riscv: Add support for BATCHED_UNMAP_TLB_FLUSH") > Signed-off-by: Samuel Holland > --- > > arch/riscv/mm/tlbflush.c | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/arch/riscv/mm/tlbflush.c b/arch/riscv/mm/tlbflush.c > index 893566e004b7..07d743f87b3f 100644 > --- a/arch/riscv/mm/tlbflush.c > +++ b/arch/riscv/mm/tlbflush.c > @@ -99,7 +99,7 @@ static void __ipi_flush_tlb_range_asid(void *info) > local_flush_tlb_range_asid(d->start, d->size, d->stride, d->asid); > } > > -static void __flush_tlb_range(struct cpumask *cmask, unsigned long asid, > +static void __flush_tlb_range(const struct cpumask *cmask, unsigned long asid, > unsigned long start, unsigned long size, > unsigned long stride) > { > @@ -200,7 +200,7 @@ void flush_tlb_range(struct vm_area_struct *vma, unsigned long start, > > void flush_tlb_kernel_range(unsigned long start, unsigned long end) > { > - __flush_tlb_range((struct cpumask *)cpu_online_mask, FLUSH_TLB_NO_ASID, > + __flush_tlb_range(cpu_online_mask, FLUSH_TLB_NO_ASID, > start, end - start, PAGE_SIZE); > } > Reviewed-by: Alexandre Ghiti Thanks, Alex