mbox series

[v1,0/4] riscv: mm: add Svnapot support

Message ID 20220411141536.2461073-1-panqinglin2020@iscas.ac.cn (mailing list archive)
Headers show
Series riscv: mm: add Svnapot support | expand

Message

Qinglin Pan April 11, 2022, 2:15 p.m. UTC
From: Qinglin Pan <panqinglin2020@iscas.ac.cn>

Svnapot is a RISC-V extension for marking contiguous 4K pages as a non-4K
page. This patch set is for using Svnapot in Linux Kernel's boot process
and hugetlb fs.

Since Svnapot is just stable recently, and there seems no official way to
determine if the CPU supports Svnapot at runtime. This patchset adds a Kconfig
item for using Svnapot in "Platform type"->"Svnapot support". Its default value
is off, and people can set it on when their CPU supports Svnapot.

Qemu support for Svnapot has been accepted but still not merged into master.
So the qemu which we use to test this patchset is current in this repo (it
contains qemu Svnapot patchset):
https://github.com/plctlab/plct-qemu/tree/plct-virtmem-dev

Tested on:
  - qemu rv64 with "Svnapot support" off.
  - plct-qemu rv64 with "Svnapot support" on.


Qinglin Pan (4):
  mm: modify pte format for Svnapot
  mm: support Svnapot in physical page linear-mapping
  mm: support Svnapot in hugetlb page
  mm: support Svnapot in huge vmap

 arch/riscv/Kconfig                    |  10 +-
 arch/riscv/include/asm/hugetlb.h      |  31 +++-
 arch/riscv/include/asm/page.h         |   2 +-
 arch/riscv/include/asm/pgtable-bits.h |  31 ++++
 arch/riscv/include/asm/pgtable.h      |  68 ++++++++
 arch/riscv/include/asm/vmalloc.h      |  20 +++
 arch/riscv/mm/hugetlbpage.c           | 236 +++++++++++++++++++++++++-
 arch/riscv/mm/init.c                  |  29 +++-
 8 files changed, 416 insertions(+), 11 deletions(-)

Comments

Qinglin Pan April 11, 2022, 2:39 p.m. UTC | #1
Hi all,

Sorry, a correction is needed here.

&gt; 
&gt; Qemu support for Svnapot has been accepted but still not merged into master.
&gt; So the qemu which we use to test this patchset is current in this repo (it
&gt; contains qemu Svnapot patchset):
&gt; https://github.com/plctlab/plct-qemu/tree/plct-virtmem-dev
&gt; 
&gt; Tested on:
&gt;   - qemu rv64 with "Svnapot support" off.
&gt;   - plct-qemu rv64 with "Svnapot support" on.
&gt; 

The Svnapot support for QEMU has been merged into master branch. Tests for this
patchset can run on it directly now, with cpu option specified like
"-cpu rv64,svnapot=true".

Thanks,
Qinglin

&gt; 
&gt; _______________________________________________
&gt; linux-riscv mailing list
&gt; linux-riscv@lists.infradead.org
&gt; http://lists.infradead.org/mailman/listinfo/linux-riscv
Palmer Dabbelt May 20, 2022, 5:10 p.m. UTC | #2
On Mon, 11 Apr 2022 07:15:32 PDT (-0700), panqinglin2020@iscas.ac.cn wrote:
> From: Qinglin Pan <panqinglin2020@iscas.ac.cn>
>
> Svnapot is a RISC-V extension for marking contiguous 4K pages as a non-4K
> page. This patch set is for using Svnapot in Linux Kernel's boot process
> and hugetlb fs.
>
> Since Svnapot is just stable recently, and there seems no official way to
> determine if the CPU supports Svnapot at runtime. This patchset adds a Kconfig
> item for using Svnapot in "Platform type"->"Svnapot support". Its default value
> is off, and people can set it on when their CPU supports Svnapot.
>
> Qemu support for Svnapot has been accepted but still not merged into master.
> So the qemu which we use to test this patchset is current in this repo (it
> contains qemu Svnapot patchset):
> https://github.com/plctlab/plct-qemu/tree/plct-virtmem-dev
>
> Tested on:
>   - qemu rv64 with "Svnapot support" off.
>   - plct-qemu rv64 with "Svnapot support" on.
>
>
> Qinglin Pan (4):
>   mm: modify pte format for Svnapot
>   mm: support Svnapot in physical page linear-mapping
>   mm: support Svnapot in hugetlb page
>   mm: support Svnapot in huge vmap
>
>  arch/riscv/Kconfig                    |  10 +-
>  arch/riscv/include/asm/hugetlb.h      |  31 +++-
>  arch/riscv/include/asm/page.h         |   2 +-
>  arch/riscv/include/asm/pgtable-bits.h |  31 ++++
>  arch/riscv/include/asm/pgtable.h      |  68 ++++++++
>  arch/riscv/include/asm/vmalloc.h      |  20 +++
>  arch/riscv/mm/hugetlbpage.c           | 236 +++++++++++++++++++++++++-
>  arch/riscv/mm/init.c                  |  29 +++-
>  8 files changed, 416 insertions(+), 11 deletions(-)

Sorry for being slow here, I got pretty buried this round.

This generally looks OK, but we definately need dynamic detection.  It 
should be super easy to do that with the new framework, as we essentialy 
just need to check for Svnapot on allocation.

Aside from that, just a minor comment: it feels like Svnapot is simple 
enough that we should be able to fit it into the generic mapping code.  
No big deal if it doesn't work and I haven't tried to do so, but I think 
it's worth a shot.
Qinglin Pan May 22, 2022, 2:38 a.m. UTC | #3
Hi Palmer,

&gt; 
&gt; Sorry for being slow here, I got pretty buried this round.
&gt; 
&gt; This generally looks OK, but we definately need dynamic detection.  It 
&gt; should be super easy to do that with the new framework, as we essentialy 
&gt; just need to check for Svnapot on allocation.
&gt; 

Thanks for your comment. I also have the idea to detect Svnapot cpu support dynamically
and will do it in next version.

&gt; Aside from that, just a minor comment: it feels like Svnapot is simple 
&gt; enough that we should be able to fit it into the generic mapping code.  
&gt; No big deal if it doesn't work and I haven't tried to do so, but I think 
&gt; it's worth a shot.

Ok, I will try this in next version too.

Yours,
Qinglin