Received: by 2002:ab2:23c8:0:b0:1f2:fdbc:cb93 with SMTP id a8csp125559lqe; Wed, 27 Mar 2024 00:17:27 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCV2MN605xupDP+2TNBwQXYtvh/ciPqcdc8DfLvKoxpNcr4xyyE3PB4ZU0ZAx11Rsh6ktWNbIN0Lcs/TLh1EuEqUKQxZ9beAZJKWI1yZxQ== X-Google-Smtp-Source: AGHT+IEIhWRiFXSzj2/8h6FvbUfqx5CBHLaBMkBGerzdvhe064I6p2nkGyCyZGjGPO1ICnjezEGC X-Received: by 2002:a17:906:2553:b0:a46:c8d5:84c8 with SMTP id j19-20020a170906255300b00a46c8d584c8mr227357ejb.38.1711523847618; Wed, 27 Mar 2024 00:17:27 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1711523847; cv=pass; d=google.com; s=arc-20160816; b=zUsVbkhJ8SNpnHaDko76PA0hWTmazG2I1KSFrZdsE0QPr1PHOiHz6oKX/n2yp9NeuS sqXLe0zHyVlZ6ya/CvLuc4WgYTg/3igcbncGPjbzWkSPOlypYDkRvrrzmmF5wMudvSAv 0yEpENowp1hmLzJTR84FmtzHdcpzWm+kQw2RtnZtdWlpQue9XG/NP/Ae5tge0VM6tR+n 9UivTuaA9YHzpKqNlkk4oneHFAHdBIucYK8hwE86jghSySbGplezDokHVklCRw5htqn9 jRJsZ6V6hVxkNRM1TgpFHaZZUvQPQtuwOe0qITCcOknZy6jlkAqYicsys/KaRyUkLmLS eaeA== ARC-Message-Signature: i=2; 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=wasXlFnOoDCaGyBDJ5aGbzrVcdWuHSXM/PxhLQd1kZ8=; fh=Wh6MJDRk8UXNQARwsn18SeW8FdarN8e6wcUtgiCwPss=; b=kBaWFWOJKbc+ebjb5pUHkN1pWix+O0I27aKuRgLW+8xRs319rw/hDqUwSS3Z+TCR+v VmINETv5uqZn4IjG/QpJ/D8F3pZEdpoeUBr0HQpYD/7QVeFArZIFJQ1V+rG5hukVkGMB wis8hjRVaKudjxLvo9LPJNJWilN4cSsIdAVYkocT7qsih7wqQbI5wXDHb+CbC1K6iqlp /akBgkoqy96wA52+QYPjSCYb2yxyQu12TaIdHqOEilrIHjoJai37AH6A5y99+TKWRYnK D+krHPZtpdtOvjytZq0U7Wa8EQns4EKoDxUJz/g0zj7nzi8cwbDDWCdEj4JPtwt/oPMS 9jxg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DprLV1YL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-120415-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120415-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id i13-20020a170906698d00b00a474ef20156si3476328ejr.251.2024.03.27.00.17.27 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 27 Mar 2024 00:17:27 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-120415-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=DprLV1YL; arc=pass (i=1 dkim=pass dkdomain=kernel.org); spf=pass (google.com: domain of linux-kernel+bounces-120415-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-120415-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 am.mirrors.kernel.org (Postfix) with ESMTPS id 588B31F256D1 for ; Wed, 27 Mar 2024 07:17:27 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 4EC1928DAE; Wed, 27 Mar 2024 07:17:22 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="DprLV1YL" 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 76AA72561B for ; Wed, 27 Mar 2024 07:17:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711523841; cv=none; b=C4omFIpquAkU/BWuOH0ShawV7GAa79Cpi+y2sLS9VjtgcxQQG30FU+Y8Y7bcD4kNrt2nQLRy0S5e6KClGP7/aNWIoHM0ksUpwI3u2uFV5kdA6o+nxPFJsMbuXWDjJgTAB/2QJelfKSRW+z4gldYtmkekf9lyZPFrfa1dA4bmpnQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1711523841; c=relaxed/simple; bh=xyQ3ZK+hiMYuRYnTpsz6pSIKbB4/60zOWfr6MnQ/X8I=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Wo+ovUXsuaYtFrniDrp1MwImMM9nDJ/w3oQ53zmGxdF/mGxzNwM8Ut7EXpBDKUq/5sIZrW4b3WBwDxztxvnQuWN0mVws1iX4Zif9LR9bmGzr2IqTSgXB0uz0qADfQeksPVTAsSVe5G63tgtsiG6mo9H1iUrT01uw1tFFjyqFmLA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=DprLV1YL; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id DABC6C433F1; Wed, 27 Mar 2024 07:17:19 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1711523841; bh=xyQ3ZK+hiMYuRYnTpsz6pSIKbB4/60zOWfr6MnQ/X8I=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=DprLV1YLawP0EOlRt7GxEvJwPKI3F0zNLQGKZDH7o2CYgPJm+l1Hs9/w3pEgga0Oq bcmEtWTLQsQIrHiFEv4Gvuvs2aN/Yc2OrriUFNzDRqlCYx6c4Ns431RPsFiSfTgchL DzXStZ1t86IcWM816wNw9G6K0XeXcqMwn2J1kb5E+3Ah53Ks+AfZ+UL5Ptl4AgAbe/ rPsiOpCGcdNNUTzEOBl/AXnObjgiHlxclOatbS3I5Z6cRGu5gj694fIJIyZAX9d2Z9 y7fC9OPF/XaIWENxEyLrqu57LbbVcRDhuSOD+aqhhFUjY2Dbg8BfVGz8eH80/RgM9B lGnpP8HcyZy7A== Date: Wed, 27 Mar 2024 15:04:05 +0800 From: Jisheng Zhang To: Samuel Holland Cc: Palmer Dabbelt , linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 1/4] riscv: Fix TASK_SIZE on 64-bit NOMMU Message-ID: References: <20240227003630.3634533-1-samuel.holland@sifive.com> <20240227003630.3634533-2-samuel.holland@sifive.com> 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=utf-8 Content-Disposition: inline In-Reply-To: <20240227003630.3634533-2-samuel.holland@sifive.com> On Mon, Feb 26, 2024 at 04:34:46PM -0800, Samuel Holland wrote: > On NOMMU, userspace memory can come from anywhere in physical RAM. The > current definition of TASK_SIZE is wrong if any RAM exists above 4G, > causing spurious failures in the userspace access routines. > > Fixes: 6bd33e1ece52 ("riscv: add nommu support") > Fixes: c3f896dcf1e4 ("mm: switch the test_vmalloc module to use __vmalloc_node") > Signed-off-by: Samuel Holland Reviewed-by: Jisheng Zhang > --- > > arch/riscv/include/asm/pgtable.h | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/arch/riscv/include/asm/pgtable.h b/arch/riscv/include/asm/pgtable.h > index 0c94260b5d0c..a564a39e5676 100644 > --- a/arch/riscv/include/asm/pgtable.h > +++ b/arch/riscv/include/asm/pgtable.h > @@ -882,7 +882,7 @@ static inline pte_t pte_swp_clear_exclusive(pte_t pte) > #define PAGE_SHARED __pgprot(0) > #define PAGE_KERNEL __pgprot(0) > #define swapper_pg_dir NULL > -#define TASK_SIZE 0xffffffffUL > +#define TASK_SIZE _AC(-1, UL) > #define VMALLOC_START _AC(0, UL) > #define VMALLOC_END TASK_SIZE > > -- > 2.43.0 > > > _______________________________________________ > linux-riscv mailing list > linux-riscv@lists.infradead.org > http://lists.infradead.org/mailman/listinfo/linux-riscv