Received: by 2002:a05:7412:b995:b0:f9:9502:5bb8 with SMTP id it21csp666372rdb; Fri, 22 Dec 2023 01:00:19 -0800 (PST) X-Google-Smtp-Source: AGHT+IHcZYUMtbIkwwkKG2ANdsRo3IjBSIxI4m+wRgP3Sa3svKW4OWafNOw1WDgZZF5Q0cn3BsaY X-Received: by 2002:a17:902:ce84:b0:1d0:b1a0:8a0e with SMTP id f4-20020a170902ce8400b001d0b1a08a0emr1148726plg.40.1703235619667; Fri, 22 Dec 2023 01:00:19 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1703235619; cv=none; d=google.com; s=arc-20160816; b=iNAHaDX4aojMicg/dpOMpk1y0DGBBYiBx6bM3Sff1zzKIDYKsFyu1lajf3rvc0gH1I wvD8iaWTX7060G8PVPpw7Nzx+AHFN4UL+be8bjjSon6xzpMW4NUVsTYTEGApnyi57DH+ A/VWi+UaAAzcfeZwtIyiZtN9IpqoldcFnkgFUUPqmhG9rpp4LpRVclmK7d8bRhk1Edzl x1S75csJXMwV4krjE8vDyg7UQ9SikFaeUKVqt89yerpbNG1pTidM736RdEjRr13VVmq7 wH/jAVJ6+YAt4dH4kcN1sOYWz4X7FbS0vNjKN/x9YMO+PJkbTWH8HuJOFpGkAzITsBWY 7xgw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:content-language:mime-version :list-unsubscribe:list-subscribe:list-id:precedence:accept-language :in-reply-to:references:message-id:date:thread-index:thread-topic :subject:cc:to:from; bh=BULKFbam4ZxO7dRwpNubzsY5Ba+eLKvPHNGHarybSgs=; fh=nfRV1q0wU+eVMtCbvDeqZHSRTujFPJWqpZRbrCazuAo=; b=r5mUxAWjaEi7qJ/5ybxHc1wHg5nx1gLbQrmCcdbeByEbiD+7Cm6gAjO0Ri1dKq2q4w gYrMj8CwEpuzPsHWELJP/SlwWAkI3xE+INo4D4BLqorSPZNt7vyJZOrDRoZdWZ6AwcUk S5w0S6g1cVtMSHHx0A2nw5YACUJyHUj0Iu93798EFuPSSj72ZqY7x2VpyVbbcky/QbW7 I+IZfvJs8tnvufUptude7tU/leLvS/3Y3yv7QC9ggtFXKJfusrwnr+0kZr3kHe2TRhYz VIlp4ipx16ROuJyZO4yz38dIi76JvJLn2lQeE9eOh62Cy4LW0XynKW6XZD1rJXjejmz1 0UqA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-9527-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9527-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id y21-20020a170902ed5500b001d04dd7cd12si2906947plb.194.2023.12.22.01.00.19 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 22 Dec 2023 01:00:19 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-9527-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel+bounces-9527-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-9527-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=aculab.com 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 D2A19B237E5 for ; Fri, 22 Dec 2023 09:00:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3B5FFD50B; Fri, 22 Dec 2023 09:00:08 +0000 (UTC) X-Original-To: linux-kernel@vger.kernel.org Received: from eu-smtp-delivery-151.mimecast.com (eu-smtp-delivery-151.mimecast.com [185.58.86.151]) (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 1D676DDAE for ; Fri, 22 Dec 2023 09:00:05 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=ACULAB.COM Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=aculab.com Received: from AcuMS.aculab.com (156.67.243.121 [156.67.243.121]) by relay.mimecast.com with ESMTP with both STARTTLS and AUTH (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id uk-mta-33-OhDEaeKjMoSgrizogtDWdA-1; Fri, 22 Dec 2023 09:00:02 +0000 X-MC-Unique: OhDEaeKjMoSgrizogtDWdA-1 Received: from AcuMS.Aculab.com (10.202.163.6) by AcuMS.aculab.com (10.202.163.6) with Microsoft SMTP Server (TLS) id 15.0.1497.48; Fri, 22 Dec 2023 08:59:47 +0000 Received: from AcuMS.Aculab.com ([::1]) by AcuMS.aculab.com ([::1]) with mapi id 15.00.1497.048; Fri, 22 Dec 2023 08:59:47 +0000 From: David Laight To: "'guoren@kernel.org'" , "linux-kernel@vger.kernel.org" , "paul.walmsley@sifive.com" , "palmer@dabbelt.com" , "alexghiti@rivosinc.com" , "charlie@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" , "leobras@redhat.com" CC: "linux-riscv@lists.infradead.org" , "Guo Ren" , "stable@vger.kernel.org" Subject: RE: [PATCH V2 2/4] riscv: mm: Fixup compat arch_get_mmap_end Thread-Topic: [PATCH V2 2/4] riscv: mm: Fixup compat arch_get_mmap_end Thread-Index: AQHaNCUDLOr76Y7kz0WYFR/4SG7VuLC1ATgA Date: Fri, 22 Dec 2023 08:59:47 +0000 Message-ID: <367b05acb90d4a6e898dd34e4254b697@AcuMS.aculab.com> References: <20231221154702.2267684-1-guoren@kernel.org> <20231221154702.2267684-3-guoren@kernel.org> In-Reply-To: <20231221154702.2267684-3-guoren@kernel.org> Accept-Language: en-GB, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-exchange-transport-fromentityheader: Hosted Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: aculab.com Content-Language: en-US Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable From: guoren@kernel.org > Sent: 21 December 2023 15:47 >=20 > From: Guo Ren >=20 > 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. Why 2G ? IIRC for 32-bit native x86 the limit is 3G, but in compat mode it is (just under) 4G. There is a special mmap option (for programs like wine) to limit mmap() to 2G. =09David - Registered Address Lakeside, Bramley Road, Mount Farm, Milton Keynes, MK1 1= PT, UK Registration No: 1397386 (Wales)