Re: [PATCH 2/4] KVM: arm64: Don't serialize if the access flag isn't set

2022-11-29 Thread Ricardo Koller
On Tue, Nov 29, 2022 at 09:15:21PM +, Oliver Upton wrote: > Hi Ricardo, > > Thanks for having a look. > > On Tue, Nov 29, 2022 at 12:52:12PM -0800, Ricardo Koller wrote: > > On Tue, Nov 29, 2022 at 07:19:44PM +, Oliver Upton wrote: > > [...] > > > > + ret =

Re: [PATCH 2/4] KVM: arm64: Don't serialize if the access flag isn't set

2022-11-29 Thread Oliver Upton
Hi Ricardo, Thanks for having a look. On Tue, Nov 29, 2022 at 12:52:12PM -0800, Ricardo Koller wrote: > On Tue, Nov 29, 2022 at 07:19:44PM +, Oliver Upton wrote: [...] > > + ret = stage2_update_leaf_attrs(pgt, addr, 1, > > KVM_PTE_LEAF_ATTR_LO_S2_AF, 0, > > +

Re: [PATCH 3/4] KVM: arm64: Handle access faults behind the read lock

2022-11-29 Thread Ricardo Koller
On Tue, Nov 29, 2022 at 07:19:45PM +, Oliver Upton wrote: > As the underlying software walkers are able to traverse and update > stage-2 in parallel there is no need to serialize access faults. > > Only take the read lock when handling an access fault. > > Signed-off-by: Oliver Upton > ---

Re: [PATCH 2/4] KVM: arm64: Don't serialize if the access flag isn't set

2022-11-29 Thread Ricardo Koller
On Tue, Nov 29, 2022 at 07:19:44PM +, Oliver Upton wrote: > Of course, if the PTE wasn't changed then there are absolutely no > serialization requirements. Skip the DSB for an unsuccessful update to > the access flag. > > Signed-off-by: Oliver Upton > --- > arch/arm64/kvm/hyp/pgtable.c | 10

[PATCH 4/4] KVM: arm64: Condition HW AF updates on config option

2022-11-29 Thread Oliver Upton
As it currently stands, KVM makes use of FEAT_HAFDBS unconditionally. Use of the feature in the rest of the kernel is guarded by an associated Kconfig option. Align KVM with the rest of the kernel and only enable VTCR_HA when ARM64_HW_AFDBM is enabled. This can be helpful for testing changes to

[PATCH 2/4] KVM: arm64: Don't serialize if the access flag isn't set

2022-11-29 Thread Oliver Upton
Of course, if the PTE wasn't changed then there are absolutely no serialization requirements. Skip the DSB for an unsuccessful update to the access flag. Signed-off-by: Oliver Upton --- arch/arm64/kvm/hyp/pgtable.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git

[PATCH 3/4] KVM: arm64: Handle access faults behind the read lock

2022-11-29 Thread Oliver Upton
As the underlying software walkers are able to traverse and update stage-2 in parallel there is no need to serialize access faults. Only take the read lock when handling an access fault. Signed-off-by: Oliver Upton --- arch/arm64/kvm/hyp/pgtable.c | 2 +- arch/arm64/kvm/mmu.c | 4 ++--

[PATCH 1/4] KVM: arm64: Use KVM's pte type/helpers in handle_access_fault()

2022-11-29 Thread Oliver Upton
Consistently use KVM's own pte types and helpers in handle_access_fault(). No functional change intended. Signed-off-by: Oliver Upton --- arch/arm64/include/asm/kvm_pgtable.h | 5 + arch/arm64/kvm/mmu.c | 10 -- 2 files changed, 9 insertions(+), 6 deletions(-)

[PATCH 0/4] KVM: arm64: Parallel access faults

2022-11-29 Thread Oliver Upton
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

Re: [PATCH v2 0/2] KVM: selftests: Enable access_tracking_perf_test for arm64

2022-11-29 Thread Marc Zyngier
On Fri, 18 Nov 2022 21:15:01 +, Oliver Upton wrote: > Small series to add support for arm64 to access_tracking_perf_test and > correct a couple bugs along the way. > > Tested on Ampere Altra w/ all supported guest modes. > > v1 -> v2: > - Have perf_test_util indicate when to stop vCPU

Re: [PATCH v5 0/8] KVM: arm64: permit MAP_SHARED mappings with MTE enabled

2022-11-29 Thread Marc Zyngier
On Thu, 3 Nov 2022 18:10:33 -0700, Peter Collingbourne wrote: > This patch series allows VMMs to use shared mappings in MTE enabled > guests. The first five patches were taken from Catalin's tree [1] which > addressed some review feedback from when they were previously sent out > as v3 of this

Re: [PATCH v3 7/8] perf: Add perf_event_attr::config3

2022-11-29 Thread Alexander Shishkin
Rob Herring writes: > On Fri, Nov 18, 2022 at 10:49 AM Will Deacon wrote: >> >> On Fri, Nov 04, 2022 at 10:55:07AM -0500, Rob Herring wrote: >> > @@ -515,6 +516,8 @@ struct perf_event_attr { >> >* truncated accordingly on 32 bit architectures. >> >*/ >> > __u64 sig_data;