linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Oliver Upton <oliver.upton@linux.dev>
To: Marc Zyngier <maz@kernel.org>, James Morse <james.morse@arm.com>,
	Alexandru Elisei <alexandru.elisei@arm.com>
Cc: linux-arm-kernel@lists.infradead.org,
	kvmarm@lists.cs.columbia.edu, kvm@vger.kernel.org,
	kvmarm@lists.linux.dev, Ricardo Koller <ricarkol@google.com>,
	Oliver Upton <oliver.upton@linux.dev>
Subject: [PATCH v2 0/6] KVM: arm64: Parallel access faults
Date: Fri,  2 Dec 2022 18:51:50 +0000	[thread overview]
Message-ID: <20221202185156.696189-1-oliver.upton@linux.dev> (raw)

When I implemented the parallel faults series I was mostly focused on
improving the performance of 8.1+ implementations which bring us
FEAT_HAFDBS. In so doing, I failed to put access faults on the read side
of the MMU lock.

Anyhow, this small series adds support for handling access faults in
parallel, piling on top of the infrastructure from the first parallel
faults series.

Patch 1 is a nit I had when working on this series.

Patches 2-4 improve the retry logic to avoid unnecessarily serializing
and/or invalidating when an attr walker has no effect on the page
tables due to a race.

I added a flag to indicate whether or not a table walk takes place
within a fault handler to decide whether or not an early return is
necessary for EAGAIN. We could probably pile even more onto this in the
future with lock contention and need_resched() detection.

Patch 5 rolls over access faults to the read lock.

Finally, patch 6 guards KVM's use of VTCR_EL2.HA with the corresponding
kernel config option for FEAT_HAFDBS. FWIW, it is rather useful for
testing access faults on systems that implement FEAT_HAFDBS.

Applies to kvmarm/next. Tested on Ampere Altra w/ VTCR_EL2.HA=0 and
lockdep enabled.

v1 -> v2:
 - Don't serialize if attr walker fails due to an invalid PTE (Ricardo)
 - Rejig the error handling path in the table walker to suppress EAGAIN
   in non-fault handling paths

v1: https://lore.kernel.org/kvmarm/20221129191946.1735662-1-oliver.upton@linux.dev

Oliver Upton (6):
  KVM: arm64: Use KVM's pte type/helpers in handle_access_fault()
  KVM: arm64: Ignore EAGAIN for walks outside of a fault
  KVM: arm64: Return EAGAIN for invalid PTE in attr walker
  KVM: arm64: Don't serialize if the access flag isn't set
  KVM: arm64: Handle access faults behind the read lock
  KVM: arm64: Condition HW AF updates on config option

 arch/arm64/include/asm/kvm_pgtable.h |  8 ++++++
 arch/arm64/kvm/hyp/pgtable.c         | 43 ++++++++++++++++++++++++----
 arch/arm64/kvm/mmu.c                 | 18 ++++++------
 3 files changed, 54 insertions(+), 15 deletions(-)


base-commit: edf3e6d30db78cc37bb57944b2255225aa73bbe8
-- 
2.39.0.rc0.267.gcb52ba06e7-goog


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

             reply	other threads:[~2022-12-02 18:53 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-02 18:51 Oliver Upton [this message]
2022-12-02 18:51 ` [PATCH v2 1/6] KVM: arm64: Use KVM's pte type/helpers in handle_access_fault() Oliver Upton
2022-12-02 18:51 ` [PATCH v2 2/6] KVM: arm64: Ignore EAGAIN for walks outside of a fault Oliver Upton
2022-12-02 18:51 ` [PATCH v2 3/6] KVM: arm64: Return EAGAIN for invalid PTE in attr walker Oliver Upton
2022-12-02 18:51 ` [PATCH v2 4/6] KVM: arm64: Don't serialize if the access flag isn't set Oliver Upton
2022-12-02 18:51 ` [PATCH v2 5/6] KVM: arm64: Handle access faults behind the read lock Oliver Upton
2022-12-02 18:51 ` [PATCH v2 6/6] KVM: arm64: Condition HW AF updates on config option Oliver Upton
2023-01-23 20:29 ` [PATCH v2 0/6] KVM: arm64: Parallel access faults Oliver Upton

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=20221202185156.696189-1-oliver.upton@linux.dev \
    --to=oliver.upton@linux.dev \
    --cc=alexandru.elisei@arm.com \
    --cc=james.morse@arm.com \
    --cc=kvm@vger.kernel.org \
    --cc=kvmarm@lists.cs.columbia.edu \
    --cc=kvmarm@lists.linux.dev \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=maz@kernel.org \
    --cc=ricarkol@google.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).