* Re: [PATCH V5 1/3] riscv: mm: Prepare for reusing PTE RSW bit(9) [not found] ` <20241113095833.1805746-2-zhangchunyan@iscas.ac.cn> @ 2025-01-30 8:42 ` Björn Töpel 2025-02-05 0:19 ` Alistair Popple 2025-02-11 1:20 ` Chunyan Zhang 0 siblings, 2 replies; 6+ messages in thread From: Björn Töpel @ 2025-01-30 8:42 UTC (permalink / raw) To: Chunyan Zhang, Palmer Dabbelt, Albert Ou, Paul Walmsley, Alexandre Ghiti, Andrew Morton Cc: linux-riscv, linux-kernel, Chunyan Zhang, Alistair Popple, linux-mm Chunyan Zhang <zhangchunyan@iscas.ac.cn> writes: > The PTE bit(9) on RISC-V is reserved for software, it is used by devmap > now which has to be disabled if we want to use bit(9) for other features, > since there's no more free PTE bit on RISC-V now. > > So to make ARCH_HAS_PTE_DEVMAP selectable, this patch uses it as > the build condition of devmap definitions. Heads-up: It seems like Alistair's series [1] that removes the devmap PTE bit will most likely land in 6.15. Björn [1] https://lore.kernel.org/linux-mm/cover.11189864684e31260d1408779fac9db80122047b.1736488799.git-series.apopple@nvidia.com/ ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH V5 1/3] riscv: mm: Prepare for reusing PTE RSW bit(9) 2025-01-30 8:42 ` [PATCH V5 1/3] riscv: mm: Prepare for reusing PTE RSW bit(9) Björn Töpel @ 2025-02-05 0:19 ` Alistair Popple 2025-02-11 1:20 ` Chunyan Zhang 1 sibling, 0 replies; 6+ messages in thread From: Alistair Popple @ 2025-02-05 0:19 UTC (permalink / raw) To: Björn Töpel Cc: Chunyan Zhang, Palmer Dabbelt, Albert Ou, Paul Walmsley, Alexandre Ghiti, Andrew Morton, linux-riscv, linux-kernel, Chunyan Zhang, linux-mm On Thu, Jan 30, 2025 at 09:42:21AM +0100, Björn Töpel wrote: > Chunyan Zhang <zhangchunyan@iscas.ac.cn> writes: > > > The PTE bit(9) on RISC-V is reserved for software, it is used by devmap > > now which has to be disabled if we want to use bit(9) for other features, > > since there's no more free PTE bit on RISC-V now. > > > > So to make ARCH_HAS_PTE_DEVMAP selectable, this patch uses it as > > the build condition of devmap definitions. > > Heads-up: It seems like Alistair's series [1] that removes the devmap > PTE bit will most likely land in 6.15. That is indeed the plan/hope. I just reposted the series based on v6.14-rc1. Note that I didn't include the devmap PTE change in the repost as I plan on posting that as a separate followup series but I'm hoping both will make it for v6.15. - Alistair > Björn > > [1] https://lore.kernel.org/linux-mm/cover.11189864684e31260d1408779fac9db80122047b.1736488799.git-series.apopple@nvidia.com/ ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH V5 1/3] riscv: mm: Prepare for reusing PTE RSW bit(9) 2025-01-30 8:42 ` [PATCH V5 1/3] riscv: mm: Prepare for reusing PTE RSW bit(9) Björn Töpel 2025-02-05 0:19 ` Alistair Popple @ 2025-02-11 1:20 ` Chunyan Zhang 2025-02-11 4:01 ` Deepak Gupta 1 sibling, 1 reply; 6+ messages in thread From: Chunyan Zhang @ 2025-02-11 1:20 UTC (permalink / raw) To: Björn Töpel Cc: Chunyan Zhang, Palmer Dabbelt, Albert Ou, Paul Walmsley, Alexandre Ghiti, Andrew Morton, linux-riscv, linux-kernel, Alistair Popple, linux-mm On Thu, 30 Jan 2025 at 16:42, Björn Töpel <bjorn@kernel.org> wrote: > > Chunyan Zhang <zhangchunyan@iscas.ac.cn> writes: > > > The PTE bit(9) on RISC-V is reserved for software, it is used by devmap > > now which has to be disabled if we want to use bit(9) for other features, > > since there's no more free PTE bit on RISC-V now. > > > > So to make ARCH_HAS_PTE_DEVMAP selectable, this patch uses it as > > the build condition of devmap definitions. > > Heads-up: It seems like Alistair's series [1] that removes the devmap > PTE bit will most likely land in 6.15. Yes, I've been keeping an eye on Alistair's series, intended to update this patchset after Alistair's patch that removes the devmap PTE bit got merged. Thanks, Chunyan > > > Björn > > [1] https://lore.kernel.org/linux-mm/cover.11189864684e31260d1408779fac9db80122047b.1736488799.git-series.apopple@nvidia.com/ ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH V5 1/3] riscv: mm: Prepare for reusing PTE RSW bit(9) 2025-02-11 1:20 ` Chunyan Zhang @ 2025-02-11 4:01 ` Deepak Gupta 2025-02-11 8:05 ` Chunyan Zhang 0 siblings, 1 reply; 6+ messages in thread From: Deepak Gupta @ 2025-02-11 4:01 UTC (permalink / raw) To: Chunyan Zhang Cc: Björn Töpel, Chunyan Zhang, Palmer Dabbelt, Albert Ou, Paul Walmsley, Alexandre Ghiti, Andrew Morton, linux-riscv, linux-kernel, Alistair Popple, linux-mm On Tue, Feb 11, 2025 at 09:20:22AM +0800, Chunyan Zhang wrote: >On Thu, 30 Jan 2025 at 16:42, Björn Töpel <bjorn@kernel.org> wrote: >> >> Chunyan Zhang <zhangchunyan@iscas.ac.cn> writes: >> >> > The PTE bit(9) on RISC-V is reserved for software, it is used by devmap >> > now which has to be disabled if we want to use bit(9) for other features, >> > since there's no more free PTE bit on RISC-V now. >> > >> > So to make ARCH_HAS_PTE_DEVMAP selectable, this patch uses it as >> > the build condition of devmap definitions. >> >> Heads-up: It seems like Alistair's series [1] that removes the devmap >> PTE bit will most likely land in 6.15. > >Yes, I've been keeping an eye on Alistair's series, intended to update >this patchset after Alistair's patch that removes the devmap PTE bit >got merged. Please keep in mind that even after claiming back devmap PTE SW bit, a compile time decision to select between uffd-wp and soft-dirty is not desirable. > >Thanks, >Chunyan >> >> >> Björn >> >> [1] https://lore.kernel.org/linux-mm/cover.11189864684e31260d1408779fac9db80122047b.1736488799.git-series.apopple@nvidia.com/ > ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH V5 1/3] riscv: mm: Prepare for reusing PTE RSW bit(9) 2025-02-11 4:01 ` Deepak Gupta @ 2025-02-11 8:05 ` Chunyan Zhang 2025-02-20 18:23 ` Deepak Gupta 0 siblings, 1 reply; 6+ messages in thread From: Chunyan Zhang @ 2025-02-11 8:05 UTC (permalink / raw) To: Deepak Gupta Cc: Björn Töpel, Chunyan Zhang, Palmer Dabbelt, Albert Ou, Paul Walmsley, Alexandre Ghiti, Andrew Morton, linux-riscv, linux-kernel, Alistair Popple, linux-mm On Tue, 11 Feb 2025 at 12:01, Deepak Gupta <debug@rivosinc.com> wrote: > > On Tue, Feb 11, 2025 at 09:20:22AM +0800, Chunyan Zhang wrote: > >On Thu, 30 Jan 2025 at 16:42, Björn Töpel <bjorn@kernel.org> wrote: > >> > >> Chunyan Zhang <zhangchunyan@iscas.ac.cn> writes: > >> > >> > The PTE bit(9) on RISC-V is reserved for software, it is used by devmap > >> > now which has to be disabled if we want to use bit(9) for other features, > >> > since there's no more free PTE bit on RISC-V now. > >> > > >> > So to make ARCH_HAS_PTE_DEVMAP selectable, this patch uses it as > >> > the build condition of devmap definitions. > >> > >> Heads-up: It seems like Alistair's series [1] that removes the devmap > >> PTE bit will most likely land in 6.15. > > > >Yes, I've been keeping an eye on Alistair's series, intended to update > >this patchset after Alistair's patch that removes the devmap PTE bit > >got merged. > > Please keep in mind that even after claiming back devmap PTE SW bit, a compile > time decision to select between uffd-wp and soft-dirty is not desirable. Yes, I agree. I've read your aother email. I also hope we can have more RSW bits to use. So should we add uffd-wp and soft-dirty support on RISC-V until we have two RSW bits for these two functions? Is an undesirable solution better than no solution for now? I can optimize the code when we have more free RSW bits, that's not hard. Thanks, Chunyan ^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH V5 1/3] riscv: mm: Prepare for reusing PTE RSW bit(9) 2025-02-11 8:05 ` Chunyan Zhang @ 2025-02-20 18:23 ` Deepak Gupta 0 siblings, 0 replies; 6+ messages in thread From: Deepak Gupta @ 2025-02-20 18:23 UTC (permalink / raw) To: Chunyan Zhang Cc: Björn Töpel, Chunyan Zhang, Palmer Dabbelt, Albert Ou, Paul Walmsley, Alexandre Ghiti, Andrew Morton, linux-riscv, linux-kernel, Alistair Popple, linux-mm Sorry for the late response. On Tue, Feb 11, 2025 at 04:05:02PM +0800, Chunyan Zhang wrote: >On Tue, 11 Feb 2025 at 12:01, Deepak Gupta <debug@rivosinc.com> wrote: >> >> On Tue, Feb 11, 2025 at 09:20:22AM +0800, Chunyan Zhang wrote: >> >On Thu, 30 Jan 2025 at 16:42, Björn Töpel <bjorn@kernel.org> wrote: >> >> >> >> Chunyan Zhang <zhangchunyan@iscas.ac.cn> writes: >> >> >> >> > The PTE bit(9) on RISC-V is reserved for software, it is used by devmap >> >> > now which has to be disabled if we want to use bit(9) for other features, >> >> > since there's no more free PTE bit on RISC-V now. >> >> > >> >> > So to make ARCH_HAS_PTE_DEVMAP selectable, this patch uses it as >> >> > the build condition of devmap definitions. >> >> >> >> Heads-up: It seems like Alistair's series [1] that removes the devmap >> >> PTE bit will most likely land in 6.15. >> > >> >Yes, I've been keeping an eye on Alistair's series, intended to update >> >this patchset after Alistair's patch that removes the devmap PTE bit >> >got merged. >> >> Please keep in mind that even after claiming back devmap PTE SW bit, a compile >> time decision to select between uffd-wp and soft-dirty is not desirable. > >Yes, I agree. I've read your aother email. I also hope we can have >more RSW bits to use. So should we add uffd-wp and soft-dirty support >on RISC-V until we have two RSW bits for these two functions? Is an >undesirable solution better than no solution for now? Problem is that this undesirable solution doesn't solve anything for *most* users. Kernel can't deviate from providing functionality (which is actually arch-agnostic) to user mode depending on the architecture. >I can optimize the code when we have more free RSW bits, that's not hard. We got 3 use cases, - pfnmap/pte_special - uffd-wp - softdirty 4th one for devmap, I hope we don't need to do it. Should get it back. https://lore.kernel.org/lkml/cover.95ff0627bc727f2bae44bea4c00ad7a83fbbcfac.1739941374.git-series.apopple@nvidia.com/#r It looks like any work there would be wasted time. There is a (fast track) proposal out there to get 2 more RSW bits. https://lists.riscv.org/g/tech-privileged/message/2268 I hope it gets ratified soon. We will have proper solution to this problem then. ^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2025-02-20 18:23 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <20241113095833.1805746-1-zhangchunyan@iscas.ac.cn>
[not found] ` <20241113095833.1805746-2-zhangchunyan@iscas.ac.cn>
2025-01-30 8:42 ` [PATCH V5 1/3] riscv: mm: Prepare for reusing PTE RSW bit(9) Björn Töpel
2025-02-05 0:19 ` Alistair Popple
2025-02-11 1:20 ` Chunyan Zhang
2025-02-11 4:01 ` Deepak Gupta
2025-02-11 8:05 ` Chunyan Zhang
2025-02-20 18:23 ` Deepak Gupta
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox