[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZLQIaSMI74KpqsQQ@arm.com>
Date: Sun, 16 Jul 2023 08:10:33 -0700
From: Catalin Marinas <catalin.marinas@....com>
To: Nico Pache <npache@...hat.com>
Cc: Anshuman Khandual <anshuman.khandual@....com>,
linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
aquini@...hat.com, Andrew Morton <akpm@...ux-foundation.org>,
David Hildenbrand <david@...hat.com>,
Gerald Schaefer <gerald.schaefer@...ux.ibm.com>,
Liu Shixin <liushixin2@...wei.com>,
Will Deacon <will@...nel.org>, Yu Zhao <yuzhao@...gle.com>
Subject: Re: [RFC] arm64: properly define SOFT_DIRTY for arm64
(I noticed Mark already replied in another thread along the same lines)
On Tue, Jul 04, 2023 at 06:08:59AM -0400, Nico Pache wrote:
> Is it possible to add the same DBM check I'm using
> (!arch_has_hw_pte_young) in these pte helper functions to only clear
> it when DBM is not present?
It's not possible since we don't have a way to encode a read-only +
dirty PTE (e.g. after ptep_set_wrprotect()). The PTE_WRITE/PTE_DBM bit
in the architecture only tells that the hardware is allowed to clear the
PTE_RDONLY bit on a write access and that's what we consider hw-dirty.
When a dirty/writeable PTE is made read-only, we clear PTE_WRITE, set
PTE_RDONLY _and_ the software PTE_DIRTY bit.
With the permission indirection extensions (PIE, see patches from Joey),
PTE_RDONLY can be treated as a true !PTE_DIRTY bit but there's no
hardware around yet.
So if you need software dirty, it can only be done with another software
PTE bit. The problem is that we are short of such bits (only one left if
we move PTE_PROT_NONE to a different location). The userfaultfd people
also want such bit.
Personally I'd reuse the four PBHA bits but I keep hearing that they may
be used with some out of tree patches.
--
Catalin
Powered by blists - more mailing lists