From: Logan Gunthorpe <logang@deltatee.com>
To: linux-kernel@vger.kernel.org, linux-riscv@lists.infradead.org
Cc: Stephen Bates <sbates@raithlin.com>,
Palmer Dabbelt <palmer@sifive.com>,
Christoph Hellwig <hch@lst.de>, Albert Ou <aou@eecs.berkeley.edu>,
Logan Gunthorpe <logang@deltatee.com>
Subject: [PATCH 0/7] RISC-V: Sparsmem, Memory Hotplug and pte_devmap for P2P
Date: Wed, 27 Mar 2019 15:36:36 -0600 [thread overview]
Message-ID: <20190327213643.23789-1-logang@deltatee.com> (raw)
Hi,
This patchset enables P2P on the RISC-V architecture. To do this on the
current kernel, we only need to be able to back IO memory with struct
pages using devm_memremap_pages(). This requires ARCH_HAS_ZONE_DEVICE,
ARCH_ENABLE_MEMORY_HOTPLUG, and ARCH_ENABLE_MEMORY_HOTREMOVE; which in
turn requires ARCH_SPARSEMEM_ENABLE. We also need to ensure that the
IO memory regions in hardware can be covered by the linear region
so that there is a linear relation ship between the virtual address and
the struct page address in the vmemmap region.
While our reason to do this work is for P2P, these features are all
useful, more generally, and also enable other kernel features.
The first patch in the series implements sparse mem. It was already
submitted and reviewed last cycle, only forgotten. It has been rebased
onto v5.1-rc2.
Patches 2 through 4 rework the architecture's virtual address space
mapping trying to get as much of the IO regions covered by the linear
mapping. With Sv39, we do not have enough address space to cover all the
typical hardware regions but we can get the majority of it.
Patch 5 and 6 implement memory hotplug and remove. These are relatively
straight forward additions similar to other arches.
Patch 7 implements pte_devmap which allows us to set
ARCH_HAS_ZONE_DEVICE.
The patchset was tested in QEMU and on a HiFive Unleashed board.
However, we were unable to actually test P2P transactions with this
exact set because we have been unable to get PCI working with v5.1-rc2.
We were able to get it running on a 4.19 era kernel (with a bunch of
out-of-tree patches for PCI on a Microsemi PolarFire board).
This series is based on v5.1-rc2 and a git tree is available here:
https://github.com/sbates130272/linux-p2pmem riscv-p2p-v1
Thanks,
Logan
--
Logan Gunthorpe (7):
RISC-V: Implement sparsemem
RISC-V: doc: Add file describing the virtual memory map
RISC-V: Rework kernel's virtual address space mapping
RISC-V: Update page tables to cover the whole linear mapping
RISC-V: Implement memory hotplug
RISC-V: Implement memory hot remove
RISC-V: Implement pte_devmap()
Documentation/riscv/mm.txt | 24 +++
arch/riscv/Kconfig | 32 +++-
arch/riscv/include/asm/page.h | 2 -
arch/riscv/include/asm/pgtable-64.h | 2 +
arch/riscv/include/asm/pgtable-bits.h | 8 +-
arch/riscv/include/asm/pgtable.h | 45 ++++-
arch/riscv/include/asm/sparsemem.h | 11 ++
arch/riscv/kernel/setup.c | 1 -
arch/riscv/mm/init.c | 251 ++++++++++++++++++++++++--
9 files changed, 354 insertions(+), 22 deletions(-)
create mode 100644 Documentation/riscv/mm.txt
create mode 100644 arch/riscv/include/asm/sparsemem.h
--
2.20.1
next reply other threads:[~2019-03-27 21:37 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-03-27 21:36 Logan Gunthorpe [this message]
2019-03-27 21:36 ` [PATCH 1/7] RISC-V: Implement sparsemem Logan Gunthorpe
2019-03-27 21:36 ` [PATCH 2/7] RISC-V: doc: Add file describing the virtual memory map Logan Gunthorpe
2019-03-28 11:49 ` Mike Rapoport
2019-03-28 15:51 ` Logan Gunthorpe
2019-03-27 21:36 ` [PATCH 3/7] RISC-V: Rework kernel's virtual address space mapping Logan Gunthorpe
2019-03-28 5:39 ` Palmer Dabbelt
2019-03-28 6:28 ` Anup Patel
2019-03-28 15:54 ` Logan Gunthorpe
2019-03-27 21:36 ` [PATCH 4/7] RISC-V: Update page tables to cover the whole linear mapping Logan Gunthorpe
2019-03-28 10:03 ` Anup Patel
2019-03-28 18:24 ` Logan Gunthorpe
2019-03-27 21:36 ` [PATCH 5/7] RISC-V: Implement memory hotplug Logan Gunthorpe
2019-03-27 21:36 ` [PATCH 6/7] RISC-V: Implement memory hot remove Logan Gunthorpe
2019-03-27 21:36 ` [PATCH 7/7] RISC-V: Implement pte_devmap() Logan Gunthorpe
2019-04-24 23:23 ` [PATCH 0/7] RISC-V: Sparsmem, Memory Hotplug and pte_devmap for P2P Palmer Dabbelt
2019-04-26 16:37 ` Logan Gunthorpe
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190327213643.23789-1-logang@deltatee.com \
--to=logang@deltatee.com \
--cc=aou@eecs.berkeley.edu \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@sifive.com \
--cc=sbates@raithlin.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®