From: Alexandru Elisei <alexandru.elisei@arm.com>
To: "Aneesh Kumar K.V" <aneesh.kumar@kernel.org>
Cc: Jack Thomson <jackabt.amazon@gmail.com>,
maz@kernel.org, oupton@kernel.org, pbonzini@redhat.com,
joey.gouly@arm.com, seiden@linux.ibm.com, suzuki.poulose@arm.com,
yuzenghui@huawei.com, catalin.marinas@arm.com, will@kernel.org,
shuah@kernel.org, corbet@lwn.net, vladimir.murzin@arm.com,
linux-arm-kernel@lists.infradead.org, kvmarm@lists.linux.dev,
kvm@vger.kernel.org, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org, linux-doc@vger.kernel.org,
isaku.yamahata@intel.com, Jack Thomson <jackabt@amazon.com>
Subject: Re: [PATCH v5 2/5] KVM: arm64: Add pre_fault_memory implementation
Date: Tue, 11 Aug 2026 17:03:43 +0100 [thread overview]
Message-ID: <antH38FPSmAZ0nrB@raptor> (raw)
In-Reply-To: <yq5acxvz4u1i.fsf@kernel.org>
Hi Aneesh,
On Mon, Aug 03, 2026 at 11:36:33AM +0530, Aneesh Kumar K.V wrote:
> Alexandru Elisei <alexandru.elisei@arm.com> writes:
>
> > Hi Jack,
> >
> > On Fri, Jun 12, 2026 at 05:23:50PM +0100, Jack Thomson wrote:
> >> From: Jack Thomson <jackabt@amazon.com>
>
> ....
>
> >> + if (kvm_is_error_hva(hva)) {
> >> + ret = -EFAULT;
> >> + goto out;
> >> + }
> >> +
> >> + s2fd.hva = hva;
> >> + ret = user_mem_abort(&s2fd);
> >
> > If is_protected_kvm_enabled(), this function doesn't check if the mapping
> > already exists. user_mem_abort() will call **p**kvm_pgtable_stage2_map()
> > (emphasis is mine) to create the mapping, and pkvm_pgtable_stage2_map() will
> > return -EAGAIN, and keep returning -EAGAIN until the mapping is destroyed, which
> > might be some time away.
> >
> > Same thing happens **without** pKVM, kvm_pgtable_stage2_map() will return
> > -EAGAIN if the mapping exists. But that's not such a big issue, when the
> > user calls KVM_PRE_FAULT_MEMORY on the remaining range
> > kvm_pgtable_get_leaf() will detect the existing mapping. Which you have
> > already taken into consideration judging by the comment, so all good here.
> >
>
> But both gmem_abort() and user_mem_abort() handle -EAGAIN internally, don't they?
I think you're right, please ignore my comment about an existing mapping with
is_protected_kvm_enabled().
Thanks,
Alex
next prev parent reply other threads:[~2026-08-11 16:03 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-06-12 16:23 [PATCH v5 0/5] KVM: arm64: Add KVM_PRE_FAULT_MEMORY support Jack Thomson
2026-06-12 16:23 ` [PATCH v5 1/5] KVM: arm64: Pass walk flags to kvm_pgtable_get_leaf() Jack Thomson
2026-06-12 16:23 ` [PATCH v5 2/5] KVM: arm64: Add pre_fault_memory implementation Jack Thomson
2026-07-08 15:25 ` Alexandru Elisei
2026-07-10 16:00 ` Alexandru Elisei
2026-08-21 13:27 ` Thomson, Jack
2026-07-10 16:03 ` Alexandru Elisei
2026-08-03 6:06 ` Aneesh Kumar K.V
2026-08-11 16:03 ` Alexandru Elisei [this message]
2026-08-21 14:05 ` Thomson, Jack
2026-08-21 13:52 ` Thomson, Jack
2026-08-25 12:29 ` Alexandru Elisei
2026-08-25 13:04 ` Thomson, Jack
2026-07-27 11:11 ` Vincent Donnefort
2026-08-21 14:01 ` Thomson, Jack
2026-06-12 16:23 ` [PATCH v5 3/5] KVM: selftests: Enable pre_fault_memory_test for arm64 Jack Thomson
2026-06-12 16:23 ` [PATCH v5 4/5] KVM: selftests: Add option for different backing in pre-fault tests Jack Thomson
2026-06-12 16:23 ` [PATCH v5 5/5] KVM: selftests: Add nested pre-fault test for arm64 Jack Thomson
2026-06-12 16:35 ` sashiko-bot
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=antH38FPSmAZ0nrB@raptor \
--to=alexandru.elisei@arm.com \
--cc=aneesh.kumar@kernel.org \
--cc=catalin.marinas@arm.com \
--cc=corbet@lwn.net \
--cc=isaku.yamahata@intel.com \
--cc=jackabt.amazon@gmail.com \
--cc=jackabt@amazon.com \
--cc=joey.gouly@arm.com \
--cc=kvm@vger.kernel.org \
--cc=kvmarm@lists.linux.dev \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=maz@kernel.org \
--cc=oupton@kernel.org \
--cc=pbonzini@redhat.com \
--cc=seiden@linux.ibm.com \
--cc=shuah@kernel.org \
--cc=suzuki.poulose@arm.com \
--cc=vladimir.murzin@arm.com \
--cc=will@kernel.org \
--cc=yuzenghui@huawei.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.