<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/tools/testing/selftests/kvm/include/kvm_util.h, branch linux-5.13.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.13.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-5.13.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2021-06-08T17:29:10Z</updated>
<entry>
<title>selftests: kvm: Add support for customized slot0 memory size</title>
<updated>2021-06-08T17:29:10Z</updated>
<author>
<name>Zhenzhong Duan</name>
</author>
<published>2021-06-08T23:38:16Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f53b16ad64408b5376836708f8cf42dbf1cf6098'/>
<id>urn:sha1:f53b16ad64408b5376836708f8cf42dbf1cf6098</id>
<content type='text'>
Until commit 39fe2fc96694 ("selftests: kvm: make allocation of extra
memory take effect", 2021-05-27), parameter extra_mem_pages was used
only to calculate the page table size for all the memory chunks,
because real memory allocation happened with calls of
vm_userspace_mem_region_add() after vm_create_default().

Commit 39fe2fc96694 however changed the meaning of extra_mem_pages to
the size of memory slot 0.  This makes the memory allocation more
flexible, but makes it harder to account for the number of
pages needed for the page tables.  For example, memslot_perf_test
has a small amount of memory in slot 0 but a lot in other slots,
and adding that memory twice (both in slot 0 and with later
calls to vm_userspace_mem_region_add()) causes an error that
was fixed in commit 000ac4295339 ("selftests: kvm: fix overlapping
addresses in memslot_perf_test", 2021-05-29)

Since both uses are sensible, add a new parameter slot0_mem_pages
to vm_create_with_vcpus() and some comments to clarify the meaning of
slot0_mem_pages and extra_mem_pages.  With this change,
memslot_perf_test can go back to passing the number of memory
pages as extra_mem_pages.

Signed-off-by: Zhenzhong Duan &lt;zhenzhong.duan@intel.com&gt;
Message-Id: &lt;20210608233816.423958-4-zhenzhong.duan@intel.com&gt;
[Squashed in a single patch and rewrote the commit message. - Paolo]
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: introduce P47V64 for s390x</title>
<updated>2021-06-08T17:19:19Z</updated>
<author>
<name>Christian Borntraeger</name>
</author>
<published>2021-06-08T12:39:54Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=1bc603af73dd8fb2934306e861009c54f973dcc2'/>
<id>urn:sha1:1bc603af73dd8fb2934306e861009c54f973dcc2</id>
<content type='text'>
s390x can have up to 47bits of physical guest and 64bits of virtual
address  bits. Add a new address mode to avoid errors of testcases
going beyond 47bits.

Signed-off-by: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
Message-Id: &lt;20210608123954.10991-1-borntraeger@de.ibm.com&gt;
Fixes: ef4c9f4f6546 ("KVM: selftests: Fix 32-bit truncation of vm_get_max_gfn()")
Cc: stable@vger.kernel.org
Reviewed-by: David Matlack &lt;dmatlack@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: create alias mappings when using shared memory</title>
<updated>2021-05-27T11:45:56Z</updated>
<author>
<name>Axel Rasmussen</name>
</author>
<published>2021-05-19T20:03:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=94f3f2b31a8a9e8bd30bf6f4903ff84acc612e0e'/>
<id>urn:sha1:94f3f2b31a8a9e8bd30bf6f4903ff84acc612e0e</id>
<content type='text'>
When a memory region is added with a src_type specifying that it should
use some kind of shared memory, also create an alias mapping to the same
underlying physical pages.

And, add an API so tests can get access to these alias addresses.
Basically, for a guest physical address, let us look up the analogous
host *alias* address.

In a future commit, we'll modify the demand paging test to take
advantage of this to exercise UFFD minor faults. The idea is, we
pre-fault the underlying pages *via the alias*. When the *guest*
faults, it gets a "minor" fault (PTEs don't exist yet, but a page is
already in the page cache). Then, the userfaultfd theads can handle the
fault: they could potentially modify the underlying memory *via the
alias* if they wanted to, and then they install the PTEs and let the
guest carry on via a UFFDIO_CONTINUE ioctl.

Reviewed-by: Ben Gardon &lt;bgardon@google.com&gt;
Signed-off-by: Axel Rasmussen &lt;axelrasmussen@google.com&gt;
Message-Id: &lt;20210519200339.829146-9-axelrasmussen@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Print a message if /dev/kvm is missing</title>
<updated>2021-05-27T11:45:55Z</updated>
<author>
<name>David Matlack</name>
</author>
<published>2021-05-11T20:21:20Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=2aab4b355cbbe1deacfd9349729c43509042b557'/>
<id>urn:sha1:2aab4b355cbbe1deacfd9349729c43509042b557</id>
<content type='text'>
If a KVM selftest is run on a machine without /dev/kvm, it will exit
silently. Make it easy to tell what's happening by printing an error
message.

Opportunistically consolidate all codepaths that open /dev/kvm into a
single function so they all print the same message.

This slightly changes the semantics of vm_is_unrestricted_guest() by
changing a TEST_ASSERT() to exit(KSFT_SKIP). However
vm_is_unrestricted_guest() is only called in one place
(x86_64/mmio_warning_test.c) and that is to determine if the test should
be skipped or not.

Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Message-Id: &lt;20210511202120.1371800-1-dmatlack@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Fix 32-bit truncation of vm_get_max_gfn()</title>
<updated>2021-05-27T11:45:54Z</updated>
<author>
<name>David Matlack</name>
</author>
<published>2021-05-21T17:38:28Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ef4c9f4f654622fa15b7a94a9bd1f19e76bb7feb'/>
<id>urn:sha1:ef4c9f4f654622fa15b7a94a9bd1f19e76bb7feb</id>
<content type='text'>
vm_get_max_gfn() casts vm-&gt;max_gfn from a uint64_t to an unsigned int,
which causes the upper 32-bits of the max_gfn to get truncated.

Nobody noticed until now likely because vm_get_max_gfn() is only used
as a mechanism to create a memslot in an unused region of the guest
physical address space (the top), and the top of the 32-bit physical
address space was always good enough.

This fix reveals a bug in memslot_modification_stress_test which was
trying to create a dummy memslot past the end of guest physical memory.
Fix that by moving the dummy memslot lower.

Fixes: 52200d0d944e ("KVM: selftests: Remove duplicate guest mode handling")
Reviewed-by: Venkatesh Srinivas &lt;venkateshs@chromium.org&gt;
Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Message-Id: &lt;20210521173828.1180619-1-dmatlack@google.com&gt;
Reviewed-by: Andrew Jones &lt;drjones@redhat.com&gt;
Reviewed-by: Peter Xu &lt;peterx@redhat.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'kvmarm-5.13' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD</title>
<updated>2021-04-23T11:41:17Z</updated>
<author>
<name>Paolo Bonzini</name>
</author>
<published>2021-04-23T11:41:17Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c4f71901d53b6d8a4703389459d9f99fbd80ffd2'/>
<id>urn:sha1:c4f71901d53b6d8a4703389459d9f99fbd80ffd2</id>
<content type='text'>
KVM/arm64 updates for Linux 5.13

New features:

- Stage-2 isolation for the host kernel when running in protected mode
- Guest SVE support when running in nVHE mode
- Force W^X hypervisor mappings in nVHE mode
- ITS save/restore for guests using direct injection with GICv4.1
- nVHE panics now produce readable backtraces
- Guest support for PTP using the ptp_kvm driver
- Performance improvements in the S2 fault handler
- Alexandru is now a reviewer (not really a new feature...)

Fixes:
- Proper emulation of the GICR_TYPER register
- Handle the complete set of relocation in the nVHE EL2 object
- Get rid of the oprofile dependency in the PMU code (and of the
  oprofile body parts at the same time)
- Debug and SPE fixes
- Fix vcpu reset
</content>
</entry>
<entry>
<title>Merge branch 'kvm-sev-cgroup' into HEAD</title>
<updated>2021-04-22T17:19:01Z</updated>
<author>
<name>Paolo Bonzini</name>
</author>
<published>2021-04-22T06:39:48Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=fd49e8ee70b306a003323a17bbcc0633f322c135'/>
<id>urn:sha1:fd49e8ee70b306a003323a17bbcc0633f322c135</id>
<content type='text'>
</content>
</entry>
<entry>
<title>KVM: selftests: Make a generic helper to get vm guest mode strings</title>
<updated>2021-04-20T08:18:52Z</updated>
<author>
<name>Yanan Wang</name>
</author>
<published>2021-03-30T08:08:51Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=6436430e29fb250c140c94a8fcc218a832dcaf74'/>
<id>urn:sha1:6436430e29fb250c140c94a8fcc218a832dcaf74</id>
<content type='text'>
For generality and conciseness, make an API which can be used in all
kvm libs and selftests to get vm guest mode strings. And the index i
is checked in the API in case of possiable faults.

Suggested-by: Sean Christopherson &lt;seanjc@google.com&gt;
Signed-off-by: Yanan Wang &lt;wangyanan55@huawei.com&gt;
Reviewed-by: Ben Gardon &lt;bgardon@google.com&gt;
Reviewed-by: Andrew Jones &lt;drjones@redhat.com&gt;
Message-Id: &lt;20210330080856.14940-6-wangyanan55@huawei.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: vgic_init kvm selftests fixup</title>
<updated>2021-04-07T14:50:50Z</updated>
<author>
<name>Eric Auger</name>
</author>
<published>2021-04-07T13:59:37Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=4cffb2df4260ed38c7ae4105f6913ad2d71a16ec'/>
<id>urn:sha1:4cffb2df4260ed38c7ae4105f6913ad2d71a16ec</id>
<content type='text'>
Bring some improvements/rationalization over the first version
of the vgic_init selftests:

- ucall_init is moved in run_cpu()
- vcpu_args_set is not called as not needed
- whenever a helper is supposed to succeed, call the non "_" version
- helpers do not return -errno, instead errno is checked by the caller
- vm_gic struct is used whenever possible, as well as vm_gic_destroy
- _kvm_create_device takes an addition fd parameter

Signed-off-by: Eric Auger &lt;eric.auger@redhat.com&gt;
Suggested-by: Andrew Jones &lt;drjones@redhat.com&gt;
Reviewed-by: Andrew Jones &lt;drjones@redhat.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20210407135937.533141-1-eric.auger@redhat.com
</content>
</entry>
<entry>
<title>KVM: selftests: aarch64/vgic-v3 init sequence tests</title>
<updated>2021-04-06T13:52:31Z</updated>
<author>
<name>Eric Auger</name>
</author>
<published>2021-04-05T16:39:41Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=dc0e058eef42f61effe9fd4f0fa4b0c793cc1f14'/>
<id>urn:sha1:dc0e058eef42f61effe9fd4f0fa4b0c793cc1f14</id>
<content type='text'>
The tests exercise the VGIC_V3 device creation including the
associated KVM_DEV_ARM_VGIC_GRP_ADDR group attributes:

- KVM_VGIC_V3_ADDR_TYPE_DIST/REDIST
- KVM_VGIC_V3_ADDR_TYPE_REDIST_REGION

Some other tests dedicate to KVM_DEV_ARM_VGIC_GRP_REDIST_REGS group
and especially the GICR_TYPER read. The goal was to test the case
recently fixed by commit 23bde34771f1
("KVM: arm64: vgic-v3: Drop the reporting of GICR_TYPER.Last for userspace").

The API under test can be found at
Documentation/virt/kvm/devices/arm-vgic-v3.rst

Signed-off-by: Eric Auger &lt;eric.auger@redhat.com&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20210405163941.510258-10-eric.auger@redhat.com
</content>
</entry>
</feed>
