Ricardo, On Tue, Jan 24, 2023 at 08:17:49AM -0800, Ricardo Koller wrote: > On Mon, Jan 23, 2023 at 11:07:25PM +0000, Oliver Upton wrote: > > On Tue, Jan 10, 2023 at 02:24:29AM +0000, Ricardo Koller wrote: > > > Only Stage1 Page table walks (S1PTW) writing a PTE on an unmapped page > > > should result in a userfaultfd write. However, the userfaultfd tests in > > > page_fault_test wrongly assert that any S1PTW is a PTE write. > > > > > > Fix this by relaxing the read vs. write checks in all userfaultfd handlers. > > > Note that this is also an attempt to focus less on KVM (and userfaultfd) > > > behavior, and more on architectural behavior. Also note that after commit > > > "KVM: arm64: Fix S1PTW handling on RO memslots" the userfaultfd fault > > > (S1PTW with AF on an unmaped PTE page) is actually a read: the translation > > > fault that comes before the permission fault. > > > > I certainly agree that we cannot make assertions about read v. write > > when registering uffd in 'missing' mode. We probably need another test > > to assert that we get write faults for hardware AF updates when using > > uffd in write protect mode. > > I can do that. Only question, do you prefer having them in this series > with fixes, or another one? Oh, don't worry about it for this series as I'd like to grab it sooner rather than later. Just making a note of some additional improvements to the test :) -- Thanks, Oliver