Received: by 2002:a05:7412:3784:b0:e2:908c:2ebd with SMTP id jk4csp228108rdb; Sat, 30 Sep 2023 02:02:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IG6izcOosT5oBeNS2gHeKSOR+cwzpxgEQcNxxdbOpu27fEYL4hxS717oPOmywfyAmPdwiqN X-Received: by 2002:a17:90a:8d81:b0:263:5d25:150c with SMTP id d1-20020a17090a8d8100b002635d25150cmr5611242pjo.29.1696064572415; Sat, 30 Sep 2023 02:02:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696064572; cv=none; d=google.com; s=arc-20160816; b=hmbqsSUgjTxTAMOb+pU5yi/c8gjtRe++blaz+ttiiEZiBlg+wUXbbs+MgYRMT75sWE JCVAGkUqoASXE7D3d8wRiLYkOuvg3fNteppvacTADU5GPEE26w4d3hJ3BmUKtX6r4ivV D1P7zSXj9+2m6+weAhGqpA+xQXejGJu6Ft44LDMOqi7Osf/UETY2odn90WrXFwj7BGWK Wib1bjYrUJLrY2Qws/Q9KNXftWQAf+I3skLtCSFeeJQaY5wjTgUQTuUJMiPV5ufaKfZW SKARlcEj0WSqOhqwX8ny/Lxs0owtHMXR/YD0+8tqssQ6XsZZlHoCQ4R6GJ9ej3TGqT6C 5sZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=5Hj3SDA4i5ujuhnD+ihHWMmaFdeVK2Wg74hLkXlUuKM=; fh=Na8LHJyujUhEO8h2QQpR1+1JCQ2uWE2bZuZNvrnlfzA=; b=vQhIODJzNKNYbA6H82f/6mIDuVVjoNXPyT3JgDOyuY6f2konX3N7OM8wUFIbD5BfqG 3qkDSF45d8hBqDxsdzoXrPvPdXDY4b8hRhS29xKAw21RfNQCzuJNfxwvSF5MKXXcINev FXVi5x4SRsMTWXPzmKmF9bcazDMZKkQm2K62RuMskVUvHnFlK0l0KKR3dq73zE85OoKT BKi3TzvxXwzrLNJA2wkWnA6D4F2tLPXLDWvCPYFQXGzwj5njp1978amZuT6rC8evr2MV 699o6H42gt1+3P14m2gMjJ60tZ/LIcnpV4+oB5tjxk33E5GnGoMKHNyjT1akzDIh8NDn kwlg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LKxqJIH2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id j8-20020a17090a734800b0026822221502si3139179pjs.163.2023.09.30.02.02.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Sep 2023 02:02:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=LKxqJIH2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id 14D2C8157DEE; Sat, 30 Sep 2023 02:02:50 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229645AbjI3JCn (ORCPT + 99 others); Sat, 30 Sep 2023 05:02:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41276 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229447AbjI3JCm (ORCPT ); Sat, 30 Sep 2023 05:02:42 -0400 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E1D31A4 for ; Sat, 30 Sep 2023 02:02:40 -0700 (PDT) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C5B1EC433C8; Sat, 30 Sep 2023 09:02:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1696064559; bh=qq5LGrB9piI/ALapVoHarnO97Km28K9Nxg5/t/eX3io=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=LKxqJIH2gitAORyRjRTVUOwJedMlXeBfjfYhSaPvC9muinRajK8LMTESWiHvpKguv 2himUzCHPxi9e2BUWe6lTa1DAV/gPbrHcHGPHIv0BxugJyQ9h+XavqGxZ0EB5n9CLD bEFrYwuDLu8c7wt+are2vfq1QwixbaLk8k6ZqYz9+5TJArSwW3T/0ACshg+pZOUdx1 ZHZx0U5AXWGiOIEI1zJJ3gHp1GOTymhXXuwaBYcu2AiUXf6LQvtKG5kGOltn+XG7+f iJvzhQxhYf+2WAbH/lA6aicPsVoJB27UPTb53VWd2w9FqchqEJNqj4wu49rX1QcvUs WZNjI10qgI5Fw== Date: Sat, 30 Sep 2023 10:02:35 +0100 From: Conor Dooley To: Sami Tolvanen Cc: Kees Cook , Paul Walmsley , Palmer Dabbelt , Albert Ou , Andrew Morton , linux-mm@kvack.org, linux-riscv@lists.infradead.org, llvm@lists.linux.dev, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/2] riscv: mm: Update mmap_rnd_bits_max Message-ID: <20230930-emporium-share-2bbdf7074e54@spud> References: <20230929211155.3910949-4-samitolvanen@google.com> <20230929211155.3910949-6-samitolvanen@google.com> <202309291452.66ED9B4D83@keescook> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ZyDAWSEjMDJNp7Wh" Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Sat, 30 Sep 2023 02:02:50 -0700 (PDT) --ZyDAWSEjMDJNp7Wh Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Fri, Sep 29, 2023 at 03:52:22PM -0700, Sami Tolvanen wrote: > On Fri, Sep 29, 2023 at 2:54=E2=80=AFPM Kees Cook = wrote: > > > > On Fri, Sep 29, 2023 at 09:11:58PM +0000, Sami Tolvanen wrote: > > > ARCH_MMAP_RND_BITS_MAX is based on Sv39, which leaves a few > > > potential bits of mmap randomness on the table if we end up enabling > > > 4/5-level paging. Update mmap_rnd_bits_max to take the final address > > > space size into account. This increases mmap_rnd_bits_max from 24 to > > > 33 with Sv48/57. > > > > > > Signed-off-by: Sami Tolvanen > > > > I like this. Is RISCV the only arch where the paging level can be chosen > > at boot time? >=20 > I haven't seen this elsewhere, but I also haven't looked at all the > other architectures that closely. arm64 does something interesting > with ARM64_VA_BITS_52, but I think we can still handle that in > Kconfig. AFAIU, x86-64 can do this also: no4lvl [RISCV] Disable 4-level and 5-level paging modes. Forces kernel to use 3-level paging instead. no5lvl [X86-64,RISCV] Disable 5-level paging mode. Forces kernel to use 4-level paging instead. --ZyDAWSEjMDJNp7Wh Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZRfkKwAKCRB4tDGHoIJi 0sckAP96xMeKJdlGIablTffmHoXBsU3nIZz+lu2Vm/HAnLMEKAD+Nxq+WTdOPyHE Tx+O88xAJtz6dMJb3se92VlCB2vHCQA= =/vk6 -----END PGP SIGNATURE----- --ZyDAWSEjMDJNp7Wh--