Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp743772rdb; Fri, 22 Dec 2023 03:58:45 -0800 (PST) X-Google-Smtp-Source: AGHT+IHb+hpYQg+ROzC/e5jitEW5UpLk2aDf2OS/ILzKJQoUL6qTkkKa2cFgDPRunzFmK8Y32plo X-Received: by 2002:a17:903:41c4:b0:1d0:5ac4:4959 with SMTP id u4-20020a17090341c400b001d05ac44959mr1399297ple.6.1703246324769; Fri, 22 Dec 2023 03:58:44 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703246324; cv=none; d=google.com; s=arc-20160816; b=yGcYnM7T5F1Yp3TTcCUlX+aVQszDj4eE8VgyHpIQyYCiXXa8VsFV3dMcaO28wVN1fc +EBMGEI5wwUU45NKJ9Owe8bNvgBnzDMNS2Lm0YP43wbjD1HeEGrIB8/nBgPPfpI6XuX+ wKtQLpch9M7LWkZxV0hm7jd7k2tzydcLF1+52h+NhC9Bya4b4YIhwO6PwsSUl0liH7rJ hrK5YJddMgVCPlu1V89OZhhIAcFDHiSxtIfTkwTUEjnpO31N55ojp1FxjomqP3khCz5b slwOp0ve+2hZs+LZL67YquG0d+URhKRsuAqZu32LjGf6768lbGPOBNftcUbaOG3P6WH6 B/cw== ARC-Message-Signature: i=1; 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:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=k0sScacABXMGFrKuN+NtMmOrYlksc/zZarQoVdLrsoY=; fh=3YQLS1cPsLhMKuGGotL7Ux7rpkwBoh7ZT2nN27VXc5c=; b=piTEbS+DWUFcCauvALQ82F9bjN0d+8TNooBfQ/+3l40dEMhmI8DZwBa3Ba+MWrGckd e2ZpXvZ6y8Xb1Xph//tVmC/JeNyBCWOqTu0BCm2KMvRxlPEEpWJdH0SuE1rKWNIqhNGr sy5/0zc3jem3+RUtht7OUC9SvshcyE+m88j387gP0c4C6moBJmnBIK6zdexEMrFksAoz dJhH4CGbd4e1hDZV18loxENdMD1PwyDGclVPWB/2ukDIgjA0Nf30Vvwbr5bev85Zk7EY 3lWADxTMBOlIQ4CUvNZ6BXNasHrF2WfMddjtMTpxV1RHcCqigjj3QgiMqOoVu0YGPRPK 929g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=k9NA+rgg; spf=pass (google.com: domain of linux-kernel+bounces-9680-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9680-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 e12-20020a17090301cc00b001d41999d9b6si1235055plh.541.2023.12.22.03.58.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 03:58:44 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9680-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=@kernel.org header.s=k20201202 header.b=k9NA+rgg; spf=pass (google.com: domain of linux-kernel+bounces-9680-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9680-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=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 709B3B22C4B for ; Fri, 22 Dec 2023 11:58:43 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 04D14208C4; Fri, 22 Dec 2023 11:57:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="k9NA+rgg" X-Original-To: linux-kernel@vger.kernel.org Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (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 33A1B1D53B; Fri, 22 Dec 2023 11:57:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 453B3C433C7; Fri, 22 Dec 2023 11:57:26 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1703246249; bh=/l6avMA7EU8OdaEPKAk6fYnGo8Aj3OZ74KZJkfMi7ro=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=k9NA+rgguh457yYzw8xXp5ZSYH8I1HoC3z7XcoXIbtLpB/D+HRAQ9UcNBjMluElnH 4RUzNAaKXXd53Sy2egoIyBSCVfN0GNLMKj7M3XGHOUXMNdjJ4SgJHjW2/Da9nSYvpj zNiQsEn2KI9bPrHx7VRY1NHyGJPOD5GZlnZDtD7oZZgXwJEma8EIbyEBlFYy+8fhpD lro6yLLsWb0bTPAf0kmFRnRgbyjo3069vahuhziEzw7kS4uw3mP4UL5mRq/gU06ncr pZ1tbjgYFuBjUUVxMg1xYLXYHriQeO06xrHkSHiRN/vO8PT1k96fZgxqxNvHtspWxk 3SKGxdrbqPVCA== From: guoren@kernel.org To: linux-kernel@vger.kernel.org, paul.walmsley@sifive.com, palmer@dabbelt.com, alexghiti@rivosinc.com, charlie@rivosinc.com, xiao.w.wang@intel.com, guoren@kernel.org, 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, leobras@redhat.com Cc: linux-riscv@lists.infradead.org, Guo Ren , stable@vger.kernel.org Subject: [PATCH V3 2/4] riscv: mm: Fixup compat arch_get_mmap_end Date: Fri, 22 Dec 2023 06:57:01 -0500 Message-Id: <20231222115703.2404036-3-guoren@kernel.org> X-Mailer: git-send-email 2.40.1 In-Reply-To: <20231222115703.2404036-1-guoren@kernel.org> References: <20231222115703.2404036-1-guoren@kernel.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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