Message ID | 20230705190002.384799-1-charlie@rivosinc.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9f45:0:b0:3ea:f831:8777 with SMTP id v5csp2074991vqx; Wed, 5 Jul 2023 12:02:30 -0700 (PDT) X-Google-Smtp-Source: APBJJlEbpxS01Wm7MGIMJbfVWHos8wAHn0ccqZqgQ7UeG50M7hhXH8fYimHlLH0GJEcPjifBuG/x X-Received: by 2002:a05:6a00:1ad1:b0:666:e42c:d5fb with SMTP id f17-20020a056a001ad100b00666e42cd5fbmr22724966pfv.32.1688583750189; Wed, 05 Jul 2023 12:02:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1688583750; cv=none; d=google.com; s=arc-20160816; b=Fkg7NPIdKgvU/jNI/GJtvxyxe3vMnjGemGUgFFnR2IVNO6YqLTSBRzUj7A9X0lASkA e3zolq+kau6Aad4bXlqvaZZeF1g/ohGWJ7kFiWdZm94spzwR3wt1Z8lyEsthjRvfNAaD DZ/GMwod1PM2vdkWwjs6SsYdUR+pOR6YxSmVQaVO5A0yeofz2k0HMkznX0xKAElYluK8 s59+Xr/m/cUCHYRuiFevstJMSWFmL08KFJYYTEePeMNru8HvxVY/H4h8SaYKpyjtQYjx DUxIsfdLvWXHfmQpApTrWlc7ztMY0JR6ftCg6KjM88lQeg1bjj6LbMDqMzuatVxYpXBc dk8w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=2aefKDjie+XpptlnykMS4cjK4bXnjT0kz0bBmi0t14U=; fh=B6InlnakgCOMhE0Jo7qCWVHZRq1xmzaWTN1j+WVFWWQ=; b=hq+QLbaqVmuX7bd+Romwl/a82W+X+8R+WaxPbkGMdfbBpa18NuEaSjoUKDSpLLi4JA n1AOcoca51Xd9ZhDvWlhlnWISAab/Zh9tGnvTpg5uaqMFgYelwvPAatbZYOHLVSIB/YK MZJwzhwRO2xlNmk+Ex9Z86r9ZDiVeytEBxxdZE0IzzElJpwTDsOtQz+uwUSdmZRhIDp4 zrxH7n3RAm7IEFtSfsB1pKU8LV4JEbqCnXaVKASn613ee14hMCJnB205euBT5KWdsvLr GKlh4MpcDBUGIawI8Dr/LSZnBmrfMxK0fEzm/qz9XJLeQkb3D+D2DP4Og+p2Tn0+J2IT m5uQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=bBeWNn4Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x36-20020a631724000000b0055ac5fed594si14285364pgl.366.2023.07.05.12.02.13; Wed, 05 Jul 2023 12:02:30 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@rivosinc-com.20221208.gappssmtp.com header.s=20221208 header.b=bBeWNn4Q; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233109AbjGETBF (ORCPT <rfc822;tebrre53rla2o@gmail.com> + 99 others); Wed, 5 Jul 2023 15:01:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40584 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232095AbjGETBD (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 5 Jul 2023 15:01:03 -0400 Received: from mail-pj1-x102a.google.com (mail-pj1-x102a.google.com [IPv6:2607:f8b0:4864:20::102a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6280319AD for <linux-kernel@vger.kernel.org>; Wed, 5 Jul 2023 12:00:42 -0700 (PDT) Received: by mail-pj1-x102a.google.com with SMTP id 98e67ed59e1d1-262e839647eso8026a91.2 for <linux-kernel@vger.kernel.org>; Wed, 05 Jul 2023 12:00:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rivosinc-com.20221208.gappssmtp.com; s=20221208; t=1688583641; x=1691175641; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=2aefKDjie+XpptlnykMS4cjK4bXnjT0kz0bBmi0t14U=; b=bBeWNn4QoiUU5WmJ9K/HMlqyJhTj+wXsBHEvd0uGz2MQnsimK3tohAPlu74IT/69YY U7WseCSzhKFXSkVwIpubzNpMLDTJN4v79Fx5s3gsOq1P7dcO2RrtNAb6T867Gd4UoNny 04u0Wz0miji0CvK5q3GwOmrS0V9Fbpna8xqVWSEWEw+BxRGFqickCZHCgI0ncSPfQfxt BgwAWyARnAYVtjU2Hd4O1PADwr78MAV8z4dcbJ6AMs8u0C9xp7QSy3/zWRLuqoXixr9b sz/jlM52lXgAREg7lI63e4ZMxx2LteDx9lHj9eJtFEiBiD2E/+cX+vM3rOdsOKXsIIrh cb8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688583641; x=1691175641; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=2aefKDjie+XpptlnykMS4cjK4bXnjT0kz0bBmi0t14U=; b=JL1CSsq+vEYnp5iz5S7JYEOTPI2kpmapMZ3M07ewu7n7AvtS6byTGulZxneRgTLDv1 vdvj8lMhPY8Ype5Q0ftHjTNzMrGH5WgKaQyEzbIu9iIwAci28DpE2BGb7MMxKEaC5KSm Oqbs8vmIWeH26gfmVyt5Ki+22h72QSVYL9+aAwHWWUyrrja3yy6CsRv5z9sACgo5yYz9 9hlNOk6f8k/BxeYP7gQiD3UZzoD+uYxiCHkmD+IyARKEOg4Qx/KXieNxkUu8tg/0illq KuVSnu77irVbzP3zLThWiDtRqGXuLEb0590Hli5XKCC01LGM2oPRJFjivF+a+Tx4tkQl 37fg== X-Gm-Message-State: ABy/qLZbu4ZBGoNptBTbqgTLSeaH4akH+ylywRU0t78i7oT3aOHe34zh 0rEf/US6Dk9KI94xhNBJekUQLaVmsRGo1o8EaVA= X-Received: by 2002:a17:90a:4985:b0:261:1141:b716 with SMTP id d5-20020a17090a498500b002611141b716mr16407697pjh.33.1688583641465; Wed, 05 Jul 2023 12:00:41 -0700 (PDT) Received: from charlie.ba.rivosinc.com ([66.220.2.162]) by smtp.gmail.com with ESMTPSA id d7-20020a170902aa8700b001b0358848b0sm19323359plr.161.2023.07.05.12.00.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 05 Jul 2023 12:00:41 -0700 (PDT) From: Charlie Jenkins <charlie@rivosinc.com> To: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Cc: charlie@rivosinc.com, conor@kernel.org, paul.walmsley@sifive.com, palmer@rivosinc.com, aou@eecs.berkeley.edu, anup@brainfault.org, konstantin@linuxfoundation.org, linux-doc@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, mick@ics.forth.gr, jrtc27@jrtc27.com Subject: [RESEND PATCH v3 0/2] RISC-V: mm: Make SV48 the default address space Date: Wed, 5 Jul 2023 11:59:40 -0700 Message-ID: <20230705190002.384799-1-charlie@rivosinc.com> X-Mailer: git-send-email 2.41.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1770608394413736705?= X-GMAIL-MSGID: =?utf-8?q?1770608394413736705?= |
Series |
RISC-V: mm: Make SV48 the default address space
|
|
Message
Charlie Jenkins
July 5, 2023, 6:59 p.m. UTC
Make sv48 the default address space for mmap as some applications currently depend on this assumption. Also enable users to select desired address space using a non-zero hint address to mmap. Previous kernel changes caused Java and other applications to be broken on sv57 which this patch fixes. Documentation is also added to the RISC-V virtual memory section to explain these changes. Charlie Jenkins (2): RISC-V: mm: Restrict address space for sv39,sv48,sv57 RISC-V: mm: Update documentation and include test Documentation/riscv/vm-layout.rst | 22 +++++++++ arch/riscv/include/asm/elf.h | 2 +- arch/riscv/include/asm/pgtable.h | 21 ++++++-- arch/riscv/include/asm/processor.h | 34 ++++++++++--- tools/testing/selftests/riscv/Makefile | 2 +- tools/testing/selftests/riscv/mm/.gitignore | 1 + tools/testing/selftests/riscv/mm/Makefile | 21 ++++++++ .../selftests/riscv/mm/testcases/mmap.c | 49 +++++++++++++++++++ 8 files changed, 139 insertions(+), 13 deletions(-) create mode 100644 tools/testing/selftests/riscv/mm/.gitignore create mode 100644 tools/testing/selftests/riscv/mm/Makefile create mode 100644 tools/testing/selftests/riscv/mm/testcases/mmap.c
Comments
Hey Charlie, On Wed, Jul 05, 2023 at 11:59:40AM -0700, Charlie Jenkins wrote: > Make sv48 the default address space for mmap as some applications > currently depend on this assumption. Also enable users to select > desired address space using a non-zero hint address to mmap. Previous > kernel changes caused Java and other applications to be broken on sv57 > which this patch fixes. > > Documentation is also added to the RISC-V virtual memory section to explain > these changes. I can't find a changelog in any of these patches, nor an explanation for why this is v3 (or a RESEND). All I can find on the list is a v1. Could you explain and provide a changelog please? Cheers, Conor.
On Wed, Jul 05, 2023 at 09:00:18PM +0100, Conor Dooley wrote: > Hey Charlie, > > On Wed, Jul 05, 2023 at 11:59:40AM -0700, Charlie Jenkins wrote: > > Make sv48 the default address space for mmap as some applications > > currently depend on this assumption. Also enable users to select > > desired address space using a non-zero hint address to mmap. Previous > > kernel changes caused Java and other applications to be broken on sv57 > > which this patch fixes. > > > > Documentation is also added to the RISC-V virtual memory section to explain > > these changes. > > I can't find a changelog in any of these patches, nor an explanation for > why this is v3 (or a RESEND). All I can find on the list is a v1. Could > you explain and provide a changelog please? > > Cheers, > Conor. I made a series of mistakes due to an incorrect email configuration. I knew something was wrong but I didn't know what after I sent out v2. v2 bumped the default address space from sv39 to sv48. The purpose of v3 was to remove an erroneous .gitignore I had included in v2 and also modify a testcase that was supposed to check the default was sv48 but it was still checking for sv39. After sending out v3 I realized what was wrong with my configuration, so I decided to mark it as a resend because I believe some people did recieve the previous emails. This is the only patch that made it through to everybody, and includes a default address space of sv48 instead of sv39. I have tested that OpenJDK 19 works on sv39, sv48, and sv57 in QEMU on this patch. OpenJDK 19 failed to work on kernel v6.4 on sv57 but worked on sv39 and sv48. Applications like Java and Go failing on sv57 were the motivation of this patch. Setting a default of sv48 will allow applications that don't explicitly support sv57 to work on sv57 hardware but still allow applications to take advantage of sv57 by specifying a hint address to mmap that is greater than or equal to 1<<56. - Charlie
On Wed, Jul 05, 2023 at 01:50:50PM -0700, Charlie Jenkins wrote: > On Wed, Jul 05, 2023 at 09:00:18PM +0100, Conor Dooley wrote: > > Hey Charlie, > > > > On Wed, Jul 05, 2023 at 11:59:40AM -0700, Charlie Jenkins wrote: > > > Make sv48 the default address space for mmap as some applications > > > currently depend on this assumption. Also enable users to select > > > desired address space using a non-zero hint address to mmap. Previous > > > kernel changes caused Java and other applications to be broken on sv57 > > > which this patch fixes. > > > > > > Documentation is also added to the RISC-V virtual memory section to explain > > > these changes. > > > > I can't find a changelog in any of these patches, nor an explanation for > > why this is v3 (or a RESEND). All I can find on the list is a v1. Could > > you explain and provide a changelog please? > > > > Cheers, > > Conor. > > I made a series of mistakes due to an incorrect email configuration. I > knew something was wrong but I didn't know what after I sent out v2. v2 > bumped the default address space from sv39 to sv48. The purpose of v3 > was to remove an erroneous .gitignore I had included in v2 and also > modify a testcase that was supposed to check the default was sv48 but it > was still checking for sv39. After sending out v3 I realized what was > wrong with my configuration, so I decided to mark it as a resend because > I believe some people did recieve the previous emails. Ah yes, I remember massive CC list you used first time around that seemed to trip up infradead's list service. I guess I've finally gotten to the incoming mail volume that I am starting to not remember things, even when they were unusual... Next time you're sending patches, please add the changelog to your cover, makes life easier for reviewers etc. Thanks Charlie, Conor.