On Thu, Dec 22, 2022 at 08:58:40PM +, Oliver Upton wrote:
> On Thu, Dec 22, 2022 at 09:01:15AM +, Marc Zyngier wrote:
> > On Wed, 21 Dec 2022 17:46:24 +, Oliver Upton
> > wrote:
> > > - When UFFD is in use, translation faults are reported to userspace as
> > >writes when from a
Hi Marc,
On Wed, Dec 21, 2022 at 05:43:03PM +, Marc Zyngier wrote:
> Hi Ricardo,
>
> On Wed, 21 Dec 2022 16:46:06 +,
> Ricardo Koller wrote:
> >
> > Hello,
> >
> > On Tue, Dec 20, 2022 at 08:09:22PM +, Marc Zyngier wrote:
> > > As a m
Need to send some changes for page_fault_test as many tests assume that
any S1PTW is always a PT write, and are failing. Also need to add some new
tests for PTs in RO memslots (as it didn't make much sense before this
change).
> }
> }
>
> --
> 2.34.1
&g
The arm/pmu test prints the value of counters as %ld. Most tests start
with counters around 0 or UINT_MAX, so having something like -16 instead of
0x_fff0 is not very useful.
Report counter values as hexadecimals.
Reported-by: Alexandru Elisei
Signed-off-by: Ricardo Koller
---
arm/pmu.c
w_at_64bits".
3. Refactor the test invocations to use the new "run_test()" which adds a
report prefix indicating whether the test uses 64 or 32-bit overflows.
A subsequent commit will actually add the 64-bit overflow tests.
Signed-off-by: Ricar
MCR_EL0.LP == 1" (for more
details see AArch64.IncrementEventCounter() pseudocode in the ARM ARM DDI
0487H.a, J1.1.1 "aarch64/debug").
Signed-off-by: Ricardo Koller
---
arm/pmu.c | 97 ---
1 file changed, 64 insertions(+), 33
counters on PMUv3p5.
Fix tests by correctly checking overflowing-counters against the expected
64-bit value.
Signed-off-by: Ricardo Koller
---
arm/pmu.c | 37 +
1 file changed, 25 insertions(+), 12 deletions(-)
diff --git a/arm/pmu.c b/arm/pmu.c
index cd47b14
(): cntr0 <-> cntr1
[0] https://lore.kernel.org/kvmarm/20221113163832.3154370-1-...@kernel.org/
[1] https://lore.kernel.org/kvmarm/y4jasyxvfrnvv...@google.com/
Ricardo Koller (4):
arm: pmu: Fix overflow checks for PMUv3p5 long counters
arm: pmu: Prepare for testing 64-bit overflows
arm: pm
On Wed, Dec 14, 2022 at 10:45:07AM +, Alexandru Elisei wrote:
> Hi,
>
> On Tue, Dec 13, 2022 at 10:04:04AM -0800, Ricardo Koller wrote:
> > On Tue, Dec 13, 2022 at 05:03:40PM +, Alexandru Elisei wrote:
> > > Hi,
> > >
> > > Checked that all p
On Wed, Dec 14, 2022 at 10:46:05AM +, Alexandru Elisei wrote:
> Hi,
>
> On Tue, Dec 13, 2022 at 10:01:06AM -0800, Ricardo Koller wrote:
> > On Tue, Dec 13, 2022 at 04:43:38PM +, Alexandru Elisei wrote:
> > > Hi,
> > >
> > > On Tue, Dec 13, 2022
On Fri, Dec 09, 2022 at 05:58:31PM +, Oliver Upton wrote:
> On Fri, Dec 09, 2022 at 04:44:46PM +, James Clark wrote:
> > ARMV8_PMU_PMCR_N_MASK is an unshifted value which results in the wrong
> > reset value for PMCR_EL0, so shift it to fix it.
>
> That's just mean. *_MASK tends to be a
uld be changed to unsigned
> long. The counters only increment, they don't decrement, and I can't think
> how printing them as signed could be useful.
>
> One more comment below.
>
> On Fri, Dec 02, 2022 at 04:55:27AM +, Ricardo Koller wrote:
> > Modify all tests
On Tue, Dec 13, 2022 at 04:43:38PM +, Alexandru Elisei wrote:
> Hi,
>
> On Tue, Dec 13, 2022 at 08:21:24AM -0800, Ricardo Koller wrote:
> > On Tue, Dec 13, 2022 at 12:36:14PM +, Alexandru Elisei wrote:
> > > Hi,
> > >
> > > Some more comment
On Tue, Dec 13, 2022 at 12:36:14PM +, Alexandru Elisei wrote:
> Hi,
>
> Some more comments below.
>
> On Fri, Dec 02, 2022 at 04:55:25AM +, Ricardo Koller wrote:
> > PMUv3p5 uses 64-bit counters irrespective of whether the PMU is configured
> > for o
On Fri, Dec 09, 2022 at 05:47:14PM +, Alexandru Elisei wrote:
> Hi,
>
> On Fri, Dec 02, 2022 at 04:55:25AM +, Ricardo Koller wrote:
> > PMUv3p5 uses 64-bit counters irrespective of whether the PMU is configured
> > for overflowing at 32 or 64-bits. The consequence is
On Thu, Dec 08, 2022 at 07:01:57PM +, Sean Christopherson wrote:
> On Thu, Dec 08, 2022, Ricardo Koller wrote:
> > On Thu, Dec 08, 2022 at 12:37:23AM +, Oliver Upton wrote:
> > > On Thu, Dec 08, 2022 at 12:24:20AM +, Sean Christopherson wrote:
> > > > >
On Thu, Dec 08, 2022 at 12:37:23AM +, Oliver Upton wrote:
> On Thu, Dec 08, 2022 at 12:24:20AM +, Sean Christopherson wrote:
> > On Thu, Dec 08, 2022, Oliver Upton wrote:
> > > On Wed, Dec 07, 2022 at 11:57:27PM +, Sean Christopherson wrote:
> > > > > diff --git
On Mon, Dec 05, 2022 at 12:05:32PM +, Marc Zyngier wrote:
> On Thu, 01 Dec 2022 16:51:46 +,
> Ricardo Koller wrote:
> >
> > On Thu, Dec 01, 2022 at 08:47:47AM -0800, Ricardo Koller wrote:
> > > On Sun, Nov 13, 2022 at 04:38:20PM +, Marc Zyngier wrote:
&
MCR_EL0.LP == 1" (for more
details see AArch64.IncrementEventCounter() pseudocode in the ARM ARM DDI
0487H.a, J1.1.1 "aarch64/debug").
Signed-off-by: Ricardo Koller
---
arm/pmu.c | 91 ---
1 file changed, 60 insertions(+), 31
w_at_64bits".
3. Refactor the test invocations to use the new "run_test()" which adds a
report prefix indicating whether the test uses 64 or 32-bit overflows.
A subsequent commit will actually add the 64-bit overflow tests.
Signed-off-by: Ricar
://lore.kernel.org/kvmarm/y4jasyxvfrnvv...@google.com/
Ricardo Koller (3):
arm: pmu: Fix overflow checks for PMUv3p5 long counters
arm: pmu: Prepare for testing 64-bit overflows
arm: pmu: Add tests for 64-bit overflows
arm/pmu.c | 217 +-
1 file
counters on PMUv3p5.
Fix tests by correctly checking overflowing-counters against the expected
64-bit value.
Signed-off-by: Ricardo Koller
---
arm/pmu.c | 29 ++---
1 file changed, 18 insertions(+), 11 deletions(-)
diff --git a/arm/pmu.c b/arm/pmu.c
index cd47b14..eeac984
On Thu, Dec 01, 2022 at 08:47:47AM -0800, Ricardo Koller wrote:
> On Sun, Nov 13, 2022 at 04:38:20PM +, Marc Zyngier wrote:
> > The PMU architecture makes a subtle difference between a 64bit
> > counter and a counter that has a 64bit overflow. This is for example
> >
On Sun, Nov 13, 2022 at 04:38:20PM +, Marc Zyngier wrote:
> The PMU architecture makes a subtle difference between a 64bit
> counter and a counter that has a 64bit overflow. This is for example
> the case of the cycle counter, which can generate an overflow on
> a 32bit boundary if
On Wed, Nov 30, 2022 at 08:21:17AM +, Marc Zyngier wrote:
> On Wed, 30 Nov 2022 01:23:20 +,
> Ricardo Koller wrote:
> >
> > On Tue, Nov 29, 2022 at 09:15:21PM +, Oliver Upton wrote:
> > > Hi Ricardo,
> > >
> > > Thanks for having a loo
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:
>
> [...]
>
> > &g
kvm_set_pfn_accessed(kvm_pte_to_pfn(pte));
> --
> 2.38.1.584.g0f3c55d4c2-goog
>
> ___
> kvmarm mailing list
> kvmarm@lists.cs.columbia.edu
> https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
Reviewed-by: Ricardo Koller
___
kvmarm mailing list
kvmarm@lists.cs.columbia.edu
https://lists.cs.columbia.edu/mailman/listinfo/kvmarm
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
On Tue, Nov 15, 2022 at 11:54:27PM +, Oliver Upton wrote:
> On Tue, Nov 15, 2022 at 03:27:18PM -0800, Ricardo Koller wrote:
> > On Tue, Nov 15, 2022 at 03:03:42PM -0800, Ricardo Koller wrote:
> > > On Mon, Nov 14, 2022 at 08:54:52PM +, Oliver Upton wrote:
>
> [...]
On Tue, Nov 15, 2022 at 03:03:42PM -0800, Ricardo Koller wrote:
> On Mon, Nov 14, 2022 at 08:54:52PM +, Oliver Upton wrote:
> > Hi Ricardo,
> >
> > On Sat, Nov 12, 2022 at 08:17:06AM +, Ricardo Koller wrote:
> >
> > [...]
> >
> > > +
On Mon, Nov 14, 2022 at 08:54:52PM +, Oliver Upton wrote:
> Hi Ricardo,
>
> On Sat, Nov 12, 2022 at 08:17:06AM +, Ricardo Koller wrote:
>
> [...]
>
> > +/**
> > + * kvm_pgtable_stage2_split() - Split a range of huge page
On Wed, Nov 09, 2022 at 11:55:31PM +, Oliver Upton wrote:
> On Wed, Nov 09, 2022 at 09:53:45PM +, Sean Christopherson wrote:
> > On Mon, Nov 07, 2022, Oliver Upton wrote:
> > > Use RCU to safely walk the stage-2 page tables in parallel. Acquire and
> > > release the RCU read lock when
permission relaxation (i.e., not having changes broadcasted to all
PEs).
Signed-off-by: Marc Zyngier
Signed-off-by: Ricardo Koller
---
arch/arm64/include/asm/kvm_asm.h | 4 +++
arch/arm64/kvm/hyp/nvhe/hyp-main.c | 10 ++
arch/arm64/kvm/hyp/nvhe/tlb.c | 54
B per vCPU, 50%
reads, and 2MB HugeTLB memory, the time it takes vCPUs to access all of
their memory after dirty logging is enabled decreased by 44% from 2.58s to
1.42s.
Signed-off-by: Ricardo Koller
---
arch/arm64/include/asm/kvm_host.h | 30
arch/arm64/kvm/mmu.c
_DIRTY_LOG. And
do not split when enabling dirty logging if KVM_DIRTY_LOG_INITIALLY_SET
is set.
Signed-off-by: Ricardo Koller
---
arch/arm64/kvm/mmu.c | 19 +++
1 file changed, 15 insertions(+), 4 deletions(-)
diff --git a/arch/arm64/kvm/mmu.c b/arch/arm64/kvm/mmu.c
index 78
Move the functionality of kvm_mmu_write_protect_pt_masked() into its
caller, kvm_arch_mmu_enable_log_dirty_pt_masked(). This will be used in a
subsequent commit in order to share some of the code in
kvm_arch_mmu_enable_log_dirty_pt_masked().
No functional change intended.
Signed-off-by: Ricardo
Add a new capability to detect "Stage-2 Translation table
break-before-make" (FEAT_BBM) level 2.
Signed-off-by: Ricardo Koller
---
arch/arm64/kernel/cpufeature.c | 11 +++
arch/arm64/tools/cpucaps | 1 +
2 files changed, 12 insertions(+)
diff --git a/arch/ar
Add kvm_uninit_stage2_mmu() and move kvm_free_stage2_pgd()
into it. A future commit will add some more things to do
inside of kvm_uninit_stage2_mmu().
No functional change intended.
Signed-off-by: Ricardo Koller
---
arch/arm64/include/asm/kvm_mmu.h | 1 +
arch/arm64/kvm/mmu.c | 7
Refactor kvm_arch_commit_memory_region() as a preparation for a future
commit to look cleaner and more understandable. Also, it looks more like
its x86 counterpart (in kvm_mmu_slot_apply_flags()).
No functional change intended.
Signed-off-by: Ricardo Koller
---
arch/arm64/kvm/mmu.c | 15
for large ranges (e.g., all guest memory in 1G chunks at a time).
No functional change intended. This new function will be used in a
Signed-off-by: Ricardo Koller
---
arch/arm64/include/asm/kvm_pgtable.h | 29 +++
arch/arm64/kvm/hyp/pgtable.c | 74
2 files
specified in the Arm ARM (DDI 0487H.a) section "Support levels for changing
block size" D5.10.1, this can result in a Conflict abort. So, handle it by
clearing all VM TLB entries.
Signed-off-by: Ricardo Koller
---
arch/arm64/include/asm/esr.h | 1 +
arch/arm64/include/asm/kvm_
commit for eagerly breaking huge pages.
Signed-off-by: Ricardo Koller
---
arch/arm64/include/asm/kvm_pgtable.h | 4 ++--
arch/arm64/kvm/hyp/nvhe/setup.c | 2 +-
arch/arm64/kvm/hyp/pgtable.c | 25 -
3 files changed, 15 insertions(+), 16 deletions(-)
diff --git
stage2_make_pte() throws a warning when used in a non-shared walk, as PTEs
are not "locked" when walking non-shared. Add a check so it can be used
non-shared.
Signed-off-by: Ricardo Koller
---
arch/arm64/kvm/hyp/pgtable.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
tree, and then use it to replace the 1G PTE in a single step.
This will be used in a subsequent commit for eager huge page splitting.
No functional change intended. This new function will be used in a
subsequent commit.
Signed-off-by: Ricardo Koller
---
arch/arm64/kvm/hyp/pgtable.c | 93
https://github.com/ricarkol/linux/commit/f78e9102b2bff4fb7f30bee810d7d611a537b46d
[3]
https://lore.kernel.org/kvmarm/20221107215644.1895162-1-oliver.up...@linux.dev/
Marc Zyngier (1):
KVM: arm64: Use local TLBI on permission relaxation
Ricardo Koller (11):
KVM: arm64: Relax WARN check in sta
On Thu, Nov 03, 2022 at 09:11:33AM +, Oliver Upton wrote:
> The break-before-make sequence is a bit annoying as it opens a window
> wherein memory is unmapped from the guest. KVM should replace the PTE
> as quickly as possible and avoid unnecessary work in between.
>
> Presently, the stage-2
On Thu, Oct 27, 2022 at 10:22:47PM +, Oliver Upton wrote:
> In order to service stage-2 faults in parallel, stage-2 table walkers
> must take exclusive ownership of the PTE being worked on. An additional
> requirement of the architecture is that software must perform a
> 'break-before-make'
On Fri, Oct 28, 2022 at 11:43:33AM -0700, Ricardo Koller wrote:
> On Fri, Oct 28, 2022 at 11:41:57AM -0700, Ricardo Koller wrote:
> > On Fri, Oct 07, 2022 at 11:28:09PM +, Oliver Upton wrote:
> > > The break-before-make sequence is a bit annoying as it opens a window
&g
On Fri, Oct 28, 2022 at 11:41:57AM -0700, Ricardo Koller wrote:
> On Fri, Oct 07, 2022 at 11:28:09PM +, Oliver Upton wrote:
> > The break-before-make sequence is a bit annoying as it opens a window
> > wherein memory is unmapped from the guest. KVM should replace the PTE
On Fri, Oct 07, 2022 at 11:28:09PM +, Oliver Upton wrote:
> The break-before-make sequence is a bit annoying as it opens a window
> wherein memory is unmapped from the guest. KVM should replace the PTE
> as quickly as possible and avoid unnecessary work in between.
>
> Presently, the stage-2
Add some dirty logging tests into page_fault_test. Mark the data and/or
page-table memory regions for dirty logging, perform some accesses, and
check that the dirty log bits are set or clean when expected.
Signed-off-by: Ricardo Koller
---
.../selftests/kvm/aarch64/page_fault_test.c | 76
Add some readonly memslot tests into page_fault_test. Mark the data and/or
page-table memory regions as readonly, perform some accesses, and check
that the right fault is triggered when expected (e.g., a store with no
write-back should lead to an mmio exit).
Signed-off-by: Ricardo Koller
Add some mix of tests into page_fault_test: memory regions with all the
pairwise combinations of read-only, userfaultfd, and dirty-logging. For
example, writing into a read-only region which has a hole handled with
userfaultfd.
Signed-off-by: Ricardo Koller
---
.../selftests/kvm/aarch64
Add some userfaultfd tests into page_fault_test. Punch holes into the
data and/or page-table memslots, perform some accesses, and check that
the faults are taken (or not taken) when expected.
Signed-off-by: Ricardo Koller
---
.../selftests/kvm/aarch64/page_fault_test.c | 187
). This first commit starts by adding two sanity checks
for all types of accesses: AF setting by the hw, and accessing memslots
with holes.
Signed-off-by: Ricardo Koller
---
tools/testing/selftests/kvm/.gitignore| 1 +
tools/testing/selftests/kvm/Makefile | 1 +
.../selftests
-by: Ricardo Koller
Reviewed-by: Sean Christopherson
Reviewed-by: Andrew Jones
---
.../selftests/kvm/include/kvm_util_base.h | 4 ++
.../selftests/kvm/lib/aarch64/processor.c | 12 ++--
tools/testing/selftests/kvm/lib/elf.c | 3 +-
tools/testing/selftests/kvm/lib/kvm_util.c| 57
.
Suggested-by: Sean Christopherson
Signed-off-by: Ricardo Koller
Reviewed-by: Andrew Jones
---
.../selftests/kvm/lib/aarch64/processor.c | 27 ++-
.../selftests/kvm/lib/riscv/processor.c | 27 ++-
2 files changed, 30 insertions(+), 24 deletions(-)
diff
Define macros for memory type indexes and construct DEFAULT_MAIR_EL1
with macros from asm/sysreg.h. The index macros can then be used when
constructing PTEs (instead of using raw numbers).
Reviewed-by: Andrew Jones
Reviewed-by: Oliver Upton
Signed-off-by: Ricardo Koller
---
.../selftests/kvm
the pt memslot.
Cc: Sean Christopherson
Cc: Andrew Jones
Signed-off-by: Ricardo Koller
Reviewed-by: Andrew Jones
Reviewed-by: Sean Christopherson
---
.../selftests/kvm/include/kvm_util_base.h | 26 +--
tools/testing/selftests/kvm/lib/kvm_util.c| 18 +++--
2 files c
-by: Ricardo Koller
---
tools/testing/selftests/kvm/include/kvm_util_base.h | 1 +
tools/testing/selftests/kvm/lib/kvm_util.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/tools/testing/selftests/kvm/include/kvm_util_base.h
b/tools/testing/selftests/kvm/include/kvm_util_base.h
index
Copy bitfield.h from include/linux/bitfield.h. A subsequent change will
make use of some FIELD_{GET,PREP} macros defined in this header.
The header was copied as-is, no changes needed.
Cc: Jakub Kicinski
Cc: Arnaldo Carvalho de Melo
Reviewed-by: Oliver Upton
Signed-off-by: Ricardo Koller
is then used in the stop function (to wait and
destroy the threads).
Reviewed-by: Oliver Upton
Reviewed-by: Ben Gardon
Signed-off-by: Ricardo Koller
---
tools/testing/selftests/kvm/Makefile | 1 +
.../selftests/kvm/demand_paging_test.c| 228 +++---
.../selftests
Deleting a memslot (when freeing a VM) is not closing the backing fd,
nor it's unmapping the alias mapping. Fix by adding the missing close
and munmap.
Reviewed-by: Andrew Jones
Reviewed-by: Oliver Upton
Reviewed-by: Ben Gardon
Signed-off-by: Ricardo Koller
---
tools/testing/selftests/kvm
Add a library function to get the PTE (a host virtual address) of a
given GVA. This will be used in a future commit by a test to clear and
check the access flag of a particular page.
Reviewed-by: Oliver Upton
Reviewed-by: Andrew Jones
Signed-off-by: Ricardo Koller
---
.../selftests/kvm
rew and Oliver in commit "KVM: selftests: Use the
right memslot for code, page-tables, and data allocations", as the commit
changed quite a bit (again). Thanks for the reviews! would it have been OK
to keep it? not sure how strict we all are about collecting r-b's on a
commit that changed.
On Fri, Oct 14, 2022 at 09:30:10PM +, Sean Christopherson wrote:
> On Tue, Oct 11, 2022, Ricardo Koller wrote:
> > Ricardo Koller (14):
> > KVM: selftests: Add a userfaultfd library
> > KVM: selftests: aarch64: Add virt_get_pte_hva() library function
> > KVM: s
n 10/4/22 18:58, Alexandru Elisei wrote:
> >>> Hi Eric,
> >>>
> >>> On Tue, Oct 04, 2022 at 06:20:23PM +0200, Eric Auger wrote:
> >>>> Hi Ricardo, Marc,
> >>>>
> >>>> On 8/5/22 02:41, Ricardo Koller wrote:
> >>&
-by: Ricardo Koller
Reviewed-by: Sean Christopherson
---
.../selftests/kvm/include/kvm_util_base.h | 4 ++
.../selftests/kvm/lib/aarch64/processor.c | 12 ++--
tools/testing/selftests/kvm/lib/elf.c | 3 +-
tools/testing/selftests/kvm/lib/kvm_util.c| 57
Add some mix of tests into page_fault_test: memory regions with all the
pairwise combinations of read-only, userfaultfd, and dirty-logging. For
example, writing into a read-only region which has a hole handled with
userfaultfd.
Signed-off-by: Ricardo Koller
---
.../selftests/kvm/aarch64
Add some dirty logging tests into page_fault_test. Mark the data and/or
page-table memory regions for dirty logging, perform some accesses, and
check that the dirty log bits are set or clean when expected.
Signed-off-by: Ricardo Koller
---
.../selftests/kvm/aarch64/page_fault_test.c | 75
Add some userfaultfd tests into page_fault_test. Punch holes into the
data and/or page-table memslots, perform some accesses, and check that
the faults are taken (or not taken) when expected.
Signed-off-by: Ricardo Koller
---
.../selftests/kvm/aarch64/page_fault_test.c | 189
Add some readonly memslot tests into page_fault_test. Mark the data and/or
page-table memory regions as readonly, perform some accesses, and check
that the right fault is triggered when expected (e.g., a store with no
write-back should lead to an mmio exit).
Signed-off-by: Ricardo Koller
). This first commit starts by adding two sanity checks
for all types of accesses: AF setting by the hw, and accessing memslots
with holes.
Signed-off-by: Ricardo Koller
---
tools/testing/selftests/kvm/.gitignore| 1 +
tools/testing/selftests/kvm/Makefile | 1 +
.../selftests
.
Suggested-by: Sean Christopherson
Signed-off-by: Ricardo Koller
---
.../selftests/kvm/lib/aarch64/processor.c | 27 ++-
.../selftests/kvm/lib/riscv/processor.c | 27 ++-
2 files changed, 30 insertions(+), 24 deletions(-)
diff --git a/tools/testing/selftests
the pt memslot.
Cc: Sean Christopherson
Cc: Andrew Jones
Signed-off-by: Ricardo Koller
Reviewed-by: Andrew Jones
Reviewed-by: Sean Christopherson
---
.../selftests/kvm/include/kvm_util_base.h | 26 +--
tools/testing/selftests/kvm/lib/kvm_util.c| 18 +++--
2 files c
Copy bitfield.h from include/linux/bitfield.h. A subsequent change will
make use of some FIELD_{GET,PREP} macros defined in this header.
The header was copied as-is, no changes needed.
Cc: Jakub Kicinski
Cc: Arnaldo Carvalho de Melo
Reviewed-by: Oliver Upton
Signed-off-by: Ricardo Koller
-by: Ricardo Koller
---
tools/testing/selftests/kvm/include/kvm_util_base.h | 1 +
tools/testing/selftests/kvm/lib/kvm_util.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/tools/testing/selftests/kvm/include/kvm_util_base.h
b/tools/testing/selftests/kvm/include/kvm_util_base.h
index
Deleting a memslot (when freeing a VM) is not closing the backing fd,
nor it's unmapping the alias mapping. Fix by adding the missing close
and munmap.
Reviewed-by: Andrew Jones
Reviewed-by: Oliver Upton
Reviewed-by: Ben Gardon
Signed-off-by: Ricardo Koller
---
tools/testing/selftests/kvm
is then used in the stop function (to wait and
destroy the threads).
Reviewed-by: Oliver Upton
Reviewed-by: Ben Gardon
Signed-off-by: Ricardo Koller
---
tools/testing/selftests/kvm/Makefile | 1 +
.../selftests/kvm/demand_paging_test.c| 228 +++---
.../selftests
Define macros for memory type indexes and construct DEFAULT_MAIR_EL1
with macros from asm/sysreg.h. The index macros can then be used when
constructing PTEs (instead of using raw numbers).
Reviewed-by: Andrew Jones
Reviewed-by: Oliver Upton
Signed-off-by: Ricardo Koller
---
.../selftests/kvm
Add a library function to get the PTE (a host virtual address) of a
given GVA. This will be used in a future commit by a test to clear and
check the access flag of a particular page.
Reviewed-by: Oliver Upton
Reviewed-by: Andrew Jones
Signed-off-by: Ricardo Koller
---
.../selftests/kvm
strict we all are about collecting r-b's on a
commit that changed.
Ricardo Koller (14):
KVM: selftests: Add a userfaultfd library
KVM: selftests: aarch64: Add virt_get_pte_hva() library function
KVM: selftests: Add missing close and munmap in
__vm_mem_region_delete()
KVM: selftests:
On Wed, Sep 28, 2022 at 04:58:53PM +, Sean Christopherson wrote:
> On Tue, Sep 27, 2022, Ricardo Koller wrote:
> > On Tue, Sep 27, 2022 at 10:06:23PM +, Sean Christopherson wrote:
> > > On Mon, Sep 26, 2022, Ricardo Koller wrote:
> > > > On Thu, Sep 22,
On Tue, Sep 27, 2022 at 10:06:23PM +, Sean Christopherson wrote:
> On Mon, Sep 26, 2022, Ricardo Koller wrote:
> > On Thu, Sep 22, 2022 at 07:32:42PM +, Sean Christopherson wrote:
> > > On Thu, Sep 22, 2022, Ricardo Koller wrote:
> > > > +
On Thu, Sep 22, 2022 at 07:32:42PM +, Sean Christopherson wrote:
> On Thu, Sep 22, 2022, Ricardo Koller wrote:
> > +/* Returns true to continue the test, and false if it should be skipped. */
> > +static bool punch_hole_in_memslot(struct kvm_vm *vm,
>
> This is a very mis
Add some mix of tests into page_fault_test: memslots with all the
pairwise combinations of read-only, userfaultfd, and dirty-logging. For
example, writing into a read-only memslot which has a hole handled with
userfaultfd.
Signed-off-by: Ricardo Koller
---
.../selftests/kvm/aarch64
Add some userfaultfd tests into page_fault_test. Punch holes into the
data and/or page-table memslots, perform some accesses, and check that
the faults are taken (or not taken) when expected.
Signed-off-by: Ricardo Koller
---
.../selftests/kvm/aarch64/page_fault_test.c | 190
Add some readonly memslot tests into page_fault_test. Mark the data
and/or page-table memslots as readonly, perform some accesses, and check
that the right fault is triggered when expected (e.g., a store with no
write-back should lead to an mmio exit).
Signed-off-by: Ricardo Koller
-by: Ricardo Koller
---
.../selftests/kvm/include/kvm_util_base.h | 4 ++
.../selftests/kvm/lib/aarch64/processor.c | 12 ++--
tools/testing/selftests/kvm/lib/elf.c | 3 +-
tools/testing/selftests/kvm/lib/kvm_util.c| 57 ---
.../selftests/kvm/lib/riscv/processor.c
Copy bitfield.h from include/linux/bitfield.h. A subsequent change will
make use of some FIELD_{GET,PREP} macros defined in this header.
The header was copied as-is, no changes needed.
Cc: Jakub Kicinski
Cc: Arnaldo Carvalho de Melo
Reviewed-by: Oliver Upton
Signed-off-by: Ricardo Koller
Add some dirty logging tests into page_fault_test. Mark the data and/or
page-table memslots for dirty logging, perform some accesses, and check
that the dirty log bits are set or clean when expected.
Signed-off-by: Ricardo Koller
---
.../selftests/kvm/aarch64/page_fault_test.c | 75
.
Suggested-by: Sean Christopherson
Signed-off-by: Ricardo Koller
---
.../selftests/kvm/lib/aarch64/processor.c | 27 ++-
.../selftests/kvm/lib/riscv/processor.c | 27 ++-
2 files changed, 30 insertions(+), 24 deletions(-)
diff --git a/tools/testing/selftests
). This first commit starts by adding two sanity checks
for all types of accesses: AF setting by the hw, and accessing memslots
with holes.
Signed-off-by: Ricardo Koller
---
tools/testing/selftests/kvm/.gitignore| 1 +
tools/testing/selftests/kvm/Makefile | 1 +
.../selftests
-by: Ricardo Koller
---
tools/testing/selftests/kvm/include/kvm_util_base.h | 1 +
tools/testing/selftests/kvm/lib/kvm_util.c | 1 +
2 files changed, 2 insertions(+)
diff --git a/tools/testing/selftests/kvm/include/kvm_util_base.h
b/tools/testing/selftests/kvm/include/kvm_util_base.h
index
the pt memslot.
Cc: Sean Christopherson
Cc: Andrew Jones
Signed-off-by: Ricardo Koller
Reviewed-by: Andrew Jones
---
.../selftests/kvm/include/kvm_util_base.h | 26 +--
tools/testing/selftests/kvm/lib/kvm_util.c| 18 +++--
2 files changed, 34 insertions(+), 10 del
Add a library function to get the PTE (a host virtual address) of a
given GVA. This will be used in a future commit by a test to clear and
check the access flag of a particular page.
Reviewed-by: Oliver Upton
Reviewed-by: Andrew Jones
Signed-off-by: Ricardo Koller
---
.../selftests/kvm
Deleting a memslot (when freeing a VM) is not closing the backing fd,
nor it's unmapping the alias mapping. Fix by adding the missing close
and munmap.
Reviewed-by: Andrew Jones
Reviewed-by: Oliver Upton
Reviewed-by: Ben Gardon
Signed-off-by: Ricardo Koller
---
tools/testing/selftests/kvm
Define macros for memory type indexes and construct DEFAULT_MAIR_EL1
with macros from asm/sysreg.h. The index macros can then be used when
constructing PTEs (instead of using raw numbers).
Reviewed-by: Andrew Jones
Reviewed-by: Oliver Upton
Signed-off-by: Ricardo Koller
---
.../selftests/kvm
is then used in the stop function (to wait and
destroy the threads).
Reviewed-by: Oliver Upton
Reviewed-by: Ben Gardon
Signed-off-by: Ricardo Koller
---
tools/testing/selftests/kvm/Makefile | 1 +
.../selftests/kvm/demand_paging_test.c| 228 +++---
.../selftests
tests: Add vm_mem_region_get_src_fd library function
- addressed Oliver comments in commit "KVM: selftests: aarch64: Add
aarch64/page_fault_test"
- collect r-b's from Andrew
Ricardo Koller (14):
KVM: selftests: Add a userfaultfd library
KVM: selftests: aarch64: Add virt_get_
1 - 100 of 261 matches
Mail list logo