From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from out0.migadu.com (out0.migadu.com [94.23.1.103]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id D762829AB for ; Tue, 24 Jan 2023 18:40:30 +0000 (UTC) Date: Tue, 24 Jan 2023 18:40:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1674585628; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=wlJ1IheQ/nmg2y4yFCWkxNqXkOOpQZCoSwAptM2xy2k=; b=PcT10gEzU7Gw8ykJLFMRP0yM/eFLupvs98UON+UER4leMXr7aBmh0rX+IPPGn2q6ZsxaLR 2uZT9mhxBHz2VoDWjr49Hcuanz8qiVGXYJKRhl5DfMxJkw+URzPVVjeSFasHwnC9nyG6oB nm1D8pl8ubzG05JjK2XCjKluGHciQ5U= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Oliver Upton To: Ricardo Koller Cc: kvm@vger.kernel.org, kvmarm@lists.linux.dev, andrew.jones@linux.dev, pbonzini@redhat.com, maz@kernel.org, alexandru.elisei@arm.com, eric.auger@redhat.com, yuzenghui@huawei.com Subject: Re: [PATCH 1/4] KVM: selftests: aarch64: Relax userfaultfd read vs. write checks Message-ID: References: <20230110022432.330151-1-ricarkol@google.com> <20230110022432.330151-2-ricarkol@google.com> Precedence: bulk X-Mailing-List: kvmarm@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Migadu-Flow: FLOW_OUT 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