From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 11270EB64D9 for ; Tue, 27 Jun 2023 18:24:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230171AbjF0SY5 (ORCPT ); Tue, 27 Jun 2023 14:24:57 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52568 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231131AbjF0SYu (ORCPT ); Tue, 27 Jun 2023 14:24:50 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CDECB8; Tue, 27 Jun 2023 11:24:49 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id CF1E7611F1; Tue, 27 Jun 2023 18:24:48 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 59CB0C433C0; Tue, 27 Jun 2023 18:24:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1687890288; bh=U0Ae3RQ4h+5yMS5yiPM4dAg4Cs5OyI4YsmDbSn9P54M=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=iBWhHyi7OhQxiwwl1PoY0idtgffmlQUHdUCFfMJgHk+cdg8J3eNys3Slb4cxWnCof X/6NljQ13ZORuOfC5mtqQF6jL5eECEGZWYoycQr3WgWNv4WKTY8mD2Lm/vj5hB2H3U SH3tZN3MLf7ggPvxZ3/YEqEn+B4jcwq4n8Aav6fw81+NT39/M4dfBgxAqymEN+EYaE jqCtAr/PSn/OrT6HJSKM9PK8lixaCmT8U1O3zPdtth3oe3DQRC++0U9f92PFAFLpuV vfR4QLL1J5OWOYZkPMCc1oK33pI/kTdwJEhdoK4B7AseSVcECzgV7/0UJ9rtaRsiat Mk3Z0hx1E77QA== Date: Tue, 27 Jun 2023 19:24:39 +0100 From: Conor Dooley To: Charlie Jenkins Cc: Jonathan Corbet , Paul Walmsley , Palmer Dabbelt , Albert Ou , Eric Biederman , Kees Cook , Shuah Khan , Alexandre Ghiti , =?iso-8859-1?Q?Bj=F6rn_T=F6pel?= , Conor Dooley , Greentime Hu , Zong Li , Andrew Morton , Guo Ren , Andrew Jones , Sergey Matyukevich , David Hildenbrand , Mayuresh Chitale , Qinglin Pan , Anshuman Khandual , Huacai Chen , Brian Cain , "Russell King (Oracle)" , Geert Uytterhoeven , Stafford Horne , Kefeng Wang , Anup Patel , Sunil V L , Evan Green , Guillaume Tucker , Mark Brown , Nick Desaulniers , "open list:DOCUMENTATION" , "open list:RISC-V ARCHITECTURE" , open list , "open list:EXEC & BINFMT API" , "open list:KERNEL SELFTEST FRAMEWORK" Subject: Re: [PATCH 0/2] Restrict address space for sv39,sv48,sv57 Message-ID: <20230627-eternity-mulberry-e1f4babf06a1@spud> References: <20230626183611.40479-1-charlie@rivosinc.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="ZFVJLaa7EzBd/kk7" Content-Disposition: inline In-Reply-To: <20230626183611.40479-1-charlie@rivosinc.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --ZFVJLaa7EzBd/kk7 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hey Charlie, On Mon, Jun 26, 2023 at 11:36:02AM -0700, Charlie Jenkins wrote: > Make sv39 the default address space for mmap as some applications > currently depend on this assumption. The RISC-V specification enforces > that bits outside of the virtual address range are not used, so > restricting the size of the default address space as such should be > temporary. A hint address passed to mmap will cause the largest address > space that fits entirely into the hint to be used. If the hint is less > than or equal to 1<<38, a 39-bit address will be used. After an address > space is completely full, the next smallest address space will be used. >=20 > Documentation is also added to the RISC-V virtual memory section to expla= in > these changes. I don't know what went wrong here, but this never ended up in patchwork for some reason, although it has appeared on lore. That seems to be via the docs mailing list, rather than linux-riscv. Could you speak to Atish and see if he knows what went wrong? Cheers, Conor. >=20 > Charlie Jenkins (2): > RISC-V: mm: Restrict address space for sv39,sv48,sv57 > RISC-V: mm: Update documentation and include test >=20 > Documentation/riscv/vm-layout.rst | 20 ++++++++ > arch/riscv/include/asm/elf.h | 2 +- > arch/riscv/include/asm/pgtable.h | 21 ++++++-- > arch/riscv/include/asm/processor.h | 41 +++++++++++++--- > tools/testing/selftests/riscv/Makefile | 2 +- > tools/testing/selftests/riscv/mm/Makefile | 22 +++++++++ > .../selftests/riscv/mm/testcases/mmap.c | 49 +++++++++++++++++++ > 7 files changed, 144 insertions(+), 13 deletions(-) > create mode 100644 tools/testing/selftests/riscv/mm/Makefile > create mode 100644 tools/testing/selftests/riscv/mm/testcases/mmap.c >=20 >=20 > base-commit: eef509789cecdce895020682192d32e8bac790e8 > --=20 > 2.34.1 >=20 --ZFVJLaa7EzBd/kk7 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iHUEABYIAB0WIQRh246EGq/8RLhDjO14tDGHoIJi0gUCZJspZgAKCRB4tDGHoIJi 0ilsAQC1hx/GF+DR3SpYjaRTOUhL/owNo2aM6O7rh8R9fc3o4QD7Bln7maXQOnuM AlYliIy/ysDkNeLNH5z4t4XUqM/PLgI= =za3L -----END PGP SIGNATURE----- --ZFVJLaa7EzBd/kk7--