Received: by 2002:a05:7412:5112:b0:fa:6e18:a558 with SMTP id fm18csp472594rdb; Tue, 23 Jan 2024 05:32:30 -0800 (PST) X-Google-Smtp-Source: AGHT+IGPzO4OSNPAnrhSfJob4qL8PCIqw8qRtDlnXbQPyYMjtrvwIKSIfxQR6tM3xK20EcVFihvT X-Received: by 2002:a37:c247:0:b0:781:5be1:c9b5 with SMTP id j7-20020a37c247000000b007815be1c9b5mr7439443qkm.145.1706016750347; Tue, 23 Jan 2024 05:32:30 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706016750; cv=pass; d=google.com; s=arc-20160816; b=dNbyX3ZmzFL5YrCUOOtCsR3iBgOdhiDJVjoUxQ6YzF2Rhsa3E+rbQ7XJQstnBm3sAK 91ZcBuKf93o9HzPc1G+wOXRU8ayC0ra1DEcj52KRxwqi5TEPhAkkMLno56PlHAjPQljE Wxprj2Yo1wbfTSL+zd8qsW9jHwv+okG3iRBxdLJLh8JC0nSAsn5/T2BXjsgV/jqh9l0J rZhu/Voe+Q05eKR4lFw30FdzCPcKrZJdFECZ7Ce842likch3UOXbsQ3qtpv5MAPekd1/ Duwh2pp1TwcSIUgjnzhnee//K3seGdxyOV3zr7YR+mm4RNEcH+bsTEx6wsIJBMRNeNWT eClw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:to:from :dkim-signature; bh=QL2GFdOO+kItFWYTRtC2kovPV4Gzg0BKVM2d6mHAVeo=; fh=NrjMs0aYR5IF7dvqePuBVNsalAeqbe1S5cej13CAHWs=; b=lvJouMlLzqWY9O8868yjlVq1Az0Hd/u68YAGSJ77cxcKNV/ybo+AyK4lsErndzrW4y VoQlpT1/DeGqsExPW/k19N+G2YeK8+YRe0fIT1zgFPZ/umHUjocRrEth4EcP2hir/+UH 6dL0bItXlU8OC9GwYWvSPwG32c0MqKvUEb9ISmQQB8UXhHU+5TPIWFCTHp0U6WeNZlEP JVa/uD+emBzCkNV3N8q5YvAxxL5Hv0xYJxjFGvnWC76qjuuDSq8nGDlmVN9laPxYH1y+ QKVYFueM6XpMLYqZwT1oaVxSQM97JALYl8Dw3fVCct2K5m0AuLa/urLXasz+uwfZqXrE ImfQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=GRgDkmS8; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-35386-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35386-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from ny.mirrors.kernel.org (ny.mirrors.kernel.org. [2604:1380:45d1:ec00::1]) by mx.google.com with ESMTPS id v25-20020a05620a0a9900b0078172064464si7981288qkg.180.2024.01.23.05.32.30 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 05:32:30 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-35386-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) client-ip=2604:1380:45d1:ec00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=GRgDkmS8; arc=pass (i=1 spf=pass spfdomain=rivosinc.com dkim=pass dkdomain=rivosinc-com.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-35386-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45d1:ec00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-35386-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 ny.mirrors.kernel.org (Postfix) with ESMTPS id 2C75F1C284CC for ; Tue, 23 Jan 2024 13:31:21 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id CD91E5FEFF; Tue, 23 Jan 2024 13:27:37 +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="GRgDkmS8" Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.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 F08B65F852 for ; Tue, 23 Jan 2024 13:27:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.221.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706016456; cv=none; b=XRvjsxrWmJtEhrINWp9KYNJbazTqTM0ciI+C74l8iaN7IAPNUNSFG4p0JQJXFjChDENGHPpYRH33yGQ9DEyA7h6jtMLXkHvqAFRyRqNV/7PbUFdPqugTQn6S2xnaXSMxrUPwaJwcEAwOt4bqnvYrN1bRnFhABHaj6NE7tRg7MZo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706016456; c=relaxed/simple; bh=4951Xxv7xemiO5DxAc/QzmfbApiZAuyJPUfXzXCYCGY=; h=From:To:Subject:Date:Message-Id:MIME-Version; b=CDB6gANGf8DnW7jWgN9LX55afMkI1O1P+r/oS+mjVSS5X+3+tvpSiMnL+ueXjuKDwoZoPkCwgMHzVXk077tVVIBATNcQN2I1vTkc6Izs7LLU47rXF/3eqoRKvHFnCI1ZlsQqC22wrqzsCOAY1TNAhXQyV5SBfex/ncf7NmfcaxA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=rivosinc.com; spf=pass smtp.mailfrom=rivosinc.com; dkim=pass (2048-bit key) header.d=rivosinc-com.20230601.gappssmtp.com header.i=@rivosinc-com.20230601.gappssmtp.com header.b=GRgDkmS8; arc=none smtp.client-ip=209.85.221.48 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-wr1-f48.google.com with SMTP id ffacd0b85a97d-337cf4eabc9so3508868f8f.3 for ; Tue, 23 Jan 2024 05:27:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1706016453; x=1706621253; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:from:to:cc:subject:date:message-id:reply-to; bh=QL2GFdOO+kItFWYTRtC2kovPV4Gzg0BKVM2d6mHAVeo=; b=GRgDkmS8NaEUUGQ27WwftwFamvOLeYxW9JNsMYBQMVA5rUnbzZmrInO19CUy/twy8b 2WvWIMct80Hinv16gHnrQduEf7wbRTV++/AlaqVKSanFTdRT58SUn0vzw3mKKEjLw7V/ 7glPp9eqf1zhp+yFxTJnq29w/iddfDoPf7ig0GDaUExx1EDKAhUXJ8YDB3ndIdCRenw6 pltxeaPvyE2jQWIFQ+9uT0KdDILsknxb9VyGLjxzsLwHUTTSBZpqJqQYXUv/ZyoGgnQN Ayskg/ZZza1GyUWJpukJRuSUP8Ua085IbgVvL2vOLt8hlOQ7ViwpJGgeHBpFcH9G1cfW xfmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1706016453; x=1706621253; h=content-transfer-encoding:mime-version:message-id:date:subject:to :from:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=QL2GFdOO+kItFWYTRtC2kovPV4Gzg0BKVM2d6mHAVeo=; b=FfT2poUp09NkU3zDYXbfsh//69/DN1Tz2JIosowx4kHN+DH0qy5e8I3xsEzjeQ09dR aYuA4kq8mq4j6Aer8KqWimOJEF3dXND3zT8FaBWbv+OnoxHR6icdDpljXndk+qW+Es1X 4/s5v/oBnKqQoLaiD/AxnLrmvfX/1exLUYTU0WCOheTmj7q3bEKbd76Sd3MdB9Y7EURU hL42DPQR0zi2R6YFJJBZBnSBEaeSP4EGTWwDc8Nb1BBeXxGJmq8f8p0upksE62Z0zCpM XzbP4mHLTykK/EB0GW5EFRs6R40eUFmgnzT8mVo1BZ5HMIxY92frN+R/vhO0t+aghtTm FKlw== X-Gm-Message-State: AOJu0YzA7iOw4BMAkl6jgjidxtxqiHwoDNcUym9STp4+Gvq2qHDi2j5R KfPuXextcFZMDYwdU0K8T9rLzkoqhTJc01NeMErlcX5y77VtOq3/khfwvQbvyp/qHa9tvYCGkq4 p X-Received: by 2002:adf:fdc7:0:b0:337:70cd:a02f with SMTP id i7-20020adffdc7000000b0033770cda02fmr3005386wrs.9.1706016452996; Tue, 23 Jan 2024 05:27:32 -0800 (PST) Received: from alex-rivos.ba.rivosinc.com (amontpellier-656-1-456-62.w92-145.abo.wanadoo.fr. [92.145.124.62]) by smtp.gmail.com with ESMTPSA id y6-20020a5d6146000000b003392f625adcsm6652270wrt.36.2024.01.23.05.27.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 23 Jan 2024 05:27:32 -0800 (PST) From: Alexandre Ghiti To: Paul Walmsley , Palmer Dabbelt , Albert Ou , Geert Uytterhoeven , Alexandre Ghiti , Dennis Zhou , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] riscv: Fix wrong size passed to local_flush_tlb_range_asid() Date: Tue, 23 Jan 2024 14:27:30 +0100 Message-Id: <20240123132730.2297719-1-alexghiti@rivosinc.com> X-Mailer: git-send-email 2.39.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit local_flush_tlb_range_asid() takes the size as argument, not the end of the range to flush, so fix this by computing the size from the end and the start of the range. Fixes: 7a92fc8b4d20 ("mm: Introduce flush_cache_vmap_early()") Signed-off-by: Alexandre Ghiti --- arch/riscv/mm/tlbflush.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/riscv/mm/tlbflush.c b/arch/riscv/mm/tlbflush.c index 8d12b26f5ac3..9619965f6501 100644 --- a/arch/riscv/mm/tlbflush.c +++ b/arch/riscv/mm/tlbflush.c @@ -68,7 +68,7 @@ static inline void local_flush_tlb_range_asid(unsigned long start, void local_flush_tlb_kernel_range(unsigned long start, unsigned long end) { - local_flush_tlb_range_asid(start, end, PAGE_SIZE, FLUSH_TLB_NO_ASID); + local_flush_tlb_range_asid(start, end - start, PAGE_SIZE, FLUSH_TLB_NO_ASID); } static void __ipi_flush_tlb_all(void *info) -- 2.39.2