Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp1195701rdb; Fri, 22 Dec 2023 19:40:11 -0800 (PST) X-Google-Smtp-Source: AGHT+IF9giCoX4dFKEJymO0Z3HuOgz/9nPhfuKbMK3qGt6y2tx8uSYVhX9iCxgTnmW0fnAo2e5WB X-Received: by 2002:a05:6a00:be1:b0:6ce:2731:47c3 with SMTP id x33-20020a056a000be100b006ce273147c3mr1942464pfu.35.1703302810857; Fri, 22 Dec 2023 19:40:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703302810; cv=none; d=google.com; s=arc-20160816; b=FyKkClVfGyD7mPwbH1UhI3bpSt/LlYhbDRnQjTlSZJZz3t+wawA2zqq/N7ZMD7qjlX YoKUiwrnhFz0h6tAC5hYz7h2PcPM6QHZsz2jVI9EwaweFNbIXy1gwXcn9wO1kuj8HaMS faaKm1cyHfaWJMXKrEGe6VHLaGAtynEmrSrNvYie/47cD+XYbLZ2ErngfDRlkWkxKl4n 6ZUnlb/ejCiVZtnq0CntN+jTd9HnzrlwxEZ5OxbqadK0WZG1xSzlesDIfrm5ZV4Ax0T8 m/dinWwtJqNzT6zgJCkM0p8Cdppls6Il3KR50cFZVTpRVg839mkW8IkUVsFZw8gIUsLg NUlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=vwj8L7hiOAWlB8RKprTbYnCxIbCpgFGamvNe/uB4uQU=; fh=Ms/17H8Ofx+QJi+2haboXOnUgky5Ga0ZayrsxupxldA=; b=xTVb7Vtjn4yokpd50ByxEp3ZlVgp0b68aSgiGw2Qnu8NY+f5keIBahfRMH16wTt04B AHeUR0Ri806PjzKBmRba578QlJC7hVW01bkmAkcQFRVU5tiESDI5hg8I0hTCO2kmKlzT y6rp7tGNNgNSuO7htP3TvR2PI7bSCqx5QnQu2aM+AjU0IXrt2pwp/+cIbH8YKwEUadpB xh4zwCBEFFsXTLcOBAIot/l22rjz1alD+2vvChw29YIeKFLoLawWf3Kwu7OCq19RDJeb Aqih3J0wffV9y3TD1NF0k/memOpU7CI+3icFreneQP0qwPA3Mav1qr9KMq8M34Gs8nML 4UNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=TGJrTWzc; spf=pass (google.com: domain of linux-kernel+bounces-10269-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10269-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id a21-20020a62e215000000b006d28370354esi4265566pfi.262.2023.12.22.19.40.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 19:40:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-10269-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20230601.gappssmtp.com header.s=20230601 header.b=TGJrTWzc; spf=pass (google.com: domain of linux-kernel+bounces-10269-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-10269-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id AC7A4B20C6E for ; Sat, 23 Dec 2023 03:39:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id B108015BD; Sat, 23 Dec 2023 03:39:14 +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="TGJrTWzc" X-Original-To: linux-kernel@vger.kernel.org Received: from mail-oi1-f172.google.com (mail-oi1-f172.google.com [209.85.167.172]) (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 7240AEC7 for ; Sat, 23 Dec 2023 03:39:12 +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-oi1-f172.google.com with SMTP id 5614622812f47-3b9fd7b14cdso1481595b6e.0 for ; Fri, 22 Dec 2023 19:39:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20230601.gappssmtp.com; s=20230601; t=1703302751; x=1703907551; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=vwj8L7hiOAWlB8RKprTbYnCxIbCpgFGamvNe/uB4uQU=; b=TGJrTWzcYlaYtgwCVvS6ZXZWV2sovvpmjccxFqv/pHj90WQurTLDUETF1vUBpuSRG0 BEIAUY8R1kOb3xgdf2UtU5YYBiP1FzPmqXDsLlkSoIO6n0ERcgUoV5WC+uN81qmnRvx9 93zxleI7Qr03y+iiMUEFQUfVuKncMUbL5hdQHQ86Sn763r0gnUQKAmT4DTEVjGpSEYZ3 FNqzXZRBdLav0Ym4it5rrHz+WSKWVpdxgqDNoN61A8+mQJoUA8M7r/TVzonwvvRqITnZ rpGbiB8Lm6KV0ULeyRPQp6h+v0Rt+N71fi5t3VgryR/mfiezbMrkgf8VUeNbY+8qvjBN Kacg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703302751; x=1703907551; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=vwj8L7hiOAWlB8RKprTbYnCxIbCpgFGamvNe/uB4uQU=; b=BxEPx449A3im5S/2HhCmcg11sa3oxnWm3QXvT6s4SmdKluf2Gbf+c/UTCnpNKIrHi5 cH0QOvxDKVoN69vHy30LlMAGYYxzcgBzj0jbRlkLBgPy6IMzRDW8orASGAXwq7xN/0ui hCkyg7X/BCT1JjtfSMK1wO0Xq0sfkPj/hN1zQaTh7/vPUSmXYjwifd1mkkvmwsWj2AbR vtyCQvGJm/al7UqnOfHR/GQZiMdx7D57y84zOqpg/tV7I85BlHSrFTGV7tdbKLqrAcnp LN8+x+AN4eksdDUs3X4vepMiByxZyShg66bFFg225ic1futXf4uGZq48CWy0ocESu3a6 w+BQ== X-Gm-Message-State: AOJu0YyYQmRfYQnvUisNYQIjctCBffXVfMkh7HbV8mpy+NI5t8WHlXEx 9BVvvq8ZC9ay/dcHE5LNJ3oyIIBf6VyupA== X-Received: by 2002:a05:6808:1441:b0:3b8:b607:13dd with SMTP id x1-20020a056808144100b003b8b60713ddmr1470549oiv.50.1703302751505; Fri, 22 Dec 2023 19:39:11 -0800 (PST) Received: from ghost ([156.39.10.100]) by smtp.gmail.com with ESMTPSA id de7-20020a05687075c700b00203af6ff47esm1235776oab.42.2023.12.22.19.39.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 19:39:11 -0800 (PST) Date: Fri, 22 Dec 2023 19:39:07 -0800 From: Charlie Jenkins To: Leonardo Bras Cc: guoren@kernel.org, linux-kernel@vger.kernel.org, paul.walmsley@sifive.com, palmer@dabbelt.com, alexghiti@rivosinc.com, xiao.w.wang@intel.com, david@redhat.com, panqinglin2020@iscas.ac.cn, rick.p.edgecombe@intel.com, willy@infradead.org, bjorn@rivosinc.com, conor.dooley@microchip.com, cleger@rivosinc.com, linux-riscv@lists.infradead.org, Guo Ren , stable@vger.kernel.org Subject: Re: [PATCH V3 2/4] riscv: mm: Fixup compat arch_get_mmap_end Message-ID: References: <20231222115703.2404036-1-guoren@kernel.org> <20231222115703.2404036-3-guoren@kernel.org> 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=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Dec 22, 2023 at 11:51:48PM -0300, Leonardo Bras wrote: > On Fri, Dec 22, 2023 at 06:57:01AM -0500, guoren@kernel.org wrote: > > From: Guo Ren > > > > When the task is in COMPAT mode, the arch_get_mmap_end should be 2GB, > > not TASK_SIZE_64. The TASK_SIZE has contained is_compat_mode() > > detection, so change the definition of STACK_TOP_MAX to TASK_SIZE > > directly. > > > > Cc: stable@vger.kernel.org > > Fixes: add2cc6b6515 ("RISC-V: mm: Restrict address space for sv39,sv48,sv57") > > Signed-off-by: Guo Ren > > Signed-off-by: Guo Ren > > --- > > arch/riscv/include/asm/processor.h | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/arch/riscv/include/asm/processor.h b/arch/riscv/include/asm/processor.h > > index f19f861cda54..e1944ff0757a 100644 > > --- a/arch/riscv/include/asm/processor.h > > +++ b/arch/riscv/include/asm/processor.h > > @@ -16,7 +16,7 @@ > > > > #ifdef CONFIG_64BIT > > #define DEFAULT_MAP_WINDOW (UL(1) << (MMAP_VA_BITS - 1)) > > -#define STACK_TOP_MAX TASK_SIZE_64 > > +#define STACK_TOP_MAX TASK_SIZE > > > > #define arch_get_mmap_end(addr, len, flags) \ > > ({ \ > > -- > > 2.40.1 > > > > > LGTM. > > FWIW: > Reviewed-by: Leonardo Bras Reviewed-by: Charlie Jenkins >