<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-dev/tools/testing/selftests/kvm/include/test_util.h, branch linus/master</title>
<subtitle>Linux kernel development work - see feature branches</subtitle>
<id>https://git.zx2c4.com/linux-dev/atom/tools/testing/selftests/kvm/include/test_util.h?h=linus%2Fmaster</id>
<link rel='self' href='https://git.zx2c4.com/linux-dev/atom/tools/testing/selftests/kvm/include/test_util.h?h=linus%2Fmaster'/>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/'/>
<updated>2021-11-16T12:43:25Z</updated>
<entry>
<title>KVM: selftests: Assert mmap HVA is aligned when using HugeTLB</title>
<updated>2021-11-16T12:43:25Z</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2021-11-11T00:03:01Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=f4870ef3e15ab889a689f99a579fe0fe7c53a960'/>
<id>urn:sha1:f4870ef3e15ab889a689f99a579fe0fe7c53a960</id>
<content type='text'>
Manually padding and aligning the mmap region is only needed when using
THP. When using HugeTLB, mmap will always return an address aligned to
the HugeTLB page size. Add a comment to clarify this and assert the mmap
behavior for HugeTLB.

[Removed requirement that HugeTLB mmaps must be padded per Yanan's
 feedback and added assertion that mmap returns aligned addresses
 when using HugeTLB.]

Cc: Ben Gardon &lt;bgardon@google.com&gt;
Cc: Yanan Wang &lt;wangyanan55@huawei.com&gt;
Cc: Andrew Jones &lt;drjones@redhat.com&gt;
Cc: Peter Xu &lt;peterx@redhat.com&gt;
Cc: Aaron Lewis &lt;aaronlewis@google.com&gt;
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Message-Id: &lt;20211111000310.1435032-4-dmatlack@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Expose align() helpers to tests</title>
<updated>2021-11-16T12:43:24Z</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2021-11-11T00:03:00Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=c071ff41e1502990a0902c7c3fcf72a462e46330'/>
<id>urn:sha1:c071ff41e1502990a0902c7c3fcf72a462e46330</id>
<content type='text'>
Refactor align() to work with non-pointers and split into separate
helpers for aligning up vs. down. Add align_ptr_up() for use with
pointers. Expose all helpers so that they can be used by tests and/or
other utilities.  The align_down() helper in particular will be used to
ensure gpa alignment for hugepages.

No functional change intended.

[Added sepearate up/down helpers and replaced open-coded alignment
 bit math throughout the KVM selftests.]

Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Reviewed-by: Ben Gardon &lt;bgardon@google.com&gt;
Message-Id: &lt;20211111000310.1435032-3-dmatlack@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm</title>
<updated>2021-09-27T20:58:23Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2021-09-27T20:58:23Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=9cccec2bf32fa2a8039cfcd228b9f3a4f0a4f5aa'/>
<id>urn:sha1:9cccec2bf32fa2a8039cfcd228b9f3a4f0a4f5aa</id>
<content type='text'>
Pull kvm fixes from Paolo Bonzini:
 "A bit late... I got sidetracked by back-from-vacation routines and
  conferences. But most of these patches are already a few weeks old and
  things look more calm on the mailing list than what this pull request
  would suggest.

  x86:

   - missing TLB flush

   - nested virtualization fixes for SMM (secure boot on nested
     hypervisor) and other nested SVM fixes

   - syscall fuzzing fixes

   - live migration fix for AMD SEV

   - mirror VMs now work for SEV-ES too

   - fixes for reset

   - possible out-of-bounds access in IOAPIC emulation

   - fix enlightened VMCS on Windows 2022

  ARM:

   - Add missing FORCE target when building the EL2 object

   - Fix a PMU probe regression on some platforms

  Generic:

   - KCSAN fixes

  selftests:

   - random fixes, mostly for clang compilation"

* tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (43 commits)
  selftests: KVM: Explicitly use movq to read xmm registers
  selftests: KVM: Call ucall_init when setting up in rseq_test
  KVM: Remove tlbs_dirty
  KVM: X86: Synchronize the shadow pagetable before link it
  KVM: X86: Fix missed remote tlb flush in rmap_write_protect()
  KVM: x86: nSVM: don't copy virt_ext from vmcb12
  KVM: x86: nSVM: test eax for 4K alignment for GP errata workaround
  KVM: x86: selftests: test simultaneous uses of V_IRQ from L1 and L0
  KVM: x86: nSVM: restore int_vector in svm_clear_vintr
  kvm: x86: Add AMD PMU MSRs to msrs_to_save_all[]
  KVM: x86: nVMX: re-evaluate emulation_required on nested VM exit
  KVM: x86: nVMX: don't fail nested VM entry on invalid guest state if !from_vmentry
  KVM: x86: VMX: synthesize invalid VM exit when emulating invalid guest state
  KVM: x86: nSVM: refactor svm_leave_smm and smm_enter_smm
  KVM: x86: SVM: call KVM_REQ_GET_NESTED_STATE_PAGES on exit from SMM mode
  KVM: x86: reset pdptrs_from_userspace when exiting smm
  KVM: x86: nSVM: restore the L1 host state prior to resuming nested guest on SMM exit
  KVM: nVMX: Filter out all unsupported controls when eVMCS was activated
  KVM: KVM: Use cpumask_available() to check for NULL cpumask when kicking vCPUs
  KVM: Clean up benign vcpu-&gt;cpu data races when kicking vCPUs
  ...
</content>
</entry>
<entry>
<title>KVM: selftests: Refactor help message for -s backing_src</title>
<updated>2021-09-22T14:33:14Z</updated>
<author>
<name>David Matlack</name>
<email>dmatlack@google.com</email>
</author>
<published>2021-09-17T17:36:56Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=9f2fc5554a4093e80084389f760d0b06ec2ff782'/>
<id>urn:sha1:9f2fc5554a4093e80084389f760d0b06ec2ff782</id>
<content type='text'>
All selftests that support the backing_src option were printing their
own description of the flag and then calling backing_src_help() to dump
the list of available backing sources. Consolidate the flag printing in
backing_src_help() to align indentation, reduce duplicated strings, and
improve consistency across tests.

Note: Passing "-s" to backing_src_help is unnecessary since every test
uses the same flag. However I decided to keep it for code readability
at the call sites.

While here this opportunistically fixes the incorrectly interleaved
printing -x help message and list of backing source types in
dirty_log_perf_test.

Fixes: 609e6202ea5f ("KVM: selftests: Support multiple slots in dirty_log_perf_test")
Reviewed-by: Ben Gardon &lt;bgardon@google.com&gt;
Reviewed-by: Andrew Jones &lt;drjones@redhat.com&gt;
Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Message-Id: &lt;20210917173657.44011-3-dmatlack@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>selftests: kvm: fix get_run_delay() ignoring fscanf() return warn</title>
<updated>2021-09-16T18:57:32Z</updated>
<author>
<name>Shuah Khan</name>
<email>skhan@linuxfoundation.org</email>
</author>
<published>2021-09-15T21:28:09Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=f5013d412a43662b63f3d5f3a804d63213acd471'/>
<id>urn:sha1:f5013d412a43662b63f3d5f3a804d63213acd471</id>
<content type='text'>
Fix get_run_delay() to check fscanf() return value to get rid of the
following warning. When fscanf() fails return MIN_RUN_DELAY_NS from
get_run_delay(). Move MIN_RUN_DELAY_NS from steal_time.c to test_util.h
so get_run_delay() and steal_time.c can use it.

lib/test_util.c: In function ‘get_run_delay’:
lib/test_util.c:316:2: warning: ignoring return value of ‘fscanf’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
  316 |  fscanf(fp, "%ld %ld ", &amp;val[0], &amp;val[1]);
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Acked-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>selftests: kvm: move get_run_delay() into lib/test_util</title>
<updated>2021-09-16T18:57:26Z</updated>
<author>
<name>Shuah Khan</name>
<email>skhan@linuxfoundation.org</email>
</author>
<published>2021-09-15T21:28:08Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=20175d5eac5bb94a7a3719ef275337fc9abf26ac'/>
<id>urn:sha1:20175d5eac5bb94a7a3719ef275337fc9abf26ac</id>
<content type='text'>
get_run_delay() is defined static in xen_shinfo_test and steal_time test.
Move it to lib and remove code duplication.

Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
Acked-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Signed-off-by: Shuah Khan &lt;skhan@linuxfoundation.org&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: add shared hugetlbfs backing source type</title>
<updated>2021-05-27T11:45:57Z</updated>
<author>
<name>Axel Rasmussen</name>
<email>axelrasmussen@google.com</email>
</author>
<published>2021-05-19T20:03:39Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=33090a884da5e9760f11441ac269f754375f80f5'/>
<id>urn:sha1:33090a884da5e9760f11441ac269f754375f80f5</id>
<content type='text'>
This lets us run the demand paging test on top of a shared
hugetlbfs-backed area. The "shared" is key, as this allows us to
exercise userfaultfd minor faults on hugetlbfs.

Signed-off-by: Axel Rasmussen &lt;axelrasmussen@google.com&gt;
Message-Id: &lt;20210519200339.829146-11-axelrasmussen@google.com&gt;
Reviewed-by: Ben Gardon &lt;bgardon@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: add shmem backing source type</title>
<updated>2021-05-27T11:45:56Z</updated>
<author>
<name>Axel Rasmussen</name>
<email>axelrasmussen@google.com</email>
</author>
<published>2021-05-19T20:03:36Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=c9befd5958fdf8913db69049d47b6ac1d970af03'/>
<id>urn:sha1:c9befd5958fdf8913db69049d47b6ac1d970af03</id>
<content type='text'>
This lets us run the demand paging test on top of a shmem-backed area.
In follow-up commits, we'll 1) leverage this new capability to create an
alias mapping, and then 2) use the alias mapping to exercise UFFD minor
faults.

Signed-off-by: Axel Rasmussen &lt;axelrasmussen@google.com&gt;
Message-Id: &lt;20210519200339.829146-8-axelrasmussen@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: List all hugetlb src types specified with page sizes</title>
<updated>2021-04-20T08:18:53Z</updated>
<author>
<name>Yanan Wang</name>
<email>wangyanan55@huawei.com</email>
</author>
<published>2021-03-30T08:08:54Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=623653b7d4622cb7d016e9a81e6a9d0d9b1326df'/>
<id>urn:sha1:623653b7d4622cb7d016e9a81e6a9d0d9b1326df</id>
<content type='text'>
With VM_MEM_SRC_ANONYMOUS_HUGETLB, we currently can only use system
default hugetlb pages to back the testing guest memory. In order to
add flexibility, now list all the known hugetlb backing src types with
different page sizes, so that we can specify use of hugetlb pages of the
exact granularity that we want. And as all the known hugetlb page sizes
are listed, it's appropriate for all architectures.

Besides, the helper get_backing_src_pagesz() is added to get the
granularity of different backing src types(anonumous, thp, hugetlb).

Suggested-by: Ben Gardon &lt;bgardon@google.com&gt;
Signed-off-by: Yanan Wang &lt;wangyanan55@huawei.com&gt;
Reviewed-by: Andrew Jones &lt;drjones@redhat.com&gt;
Message-Id: &lt;20210330080856.14940-9-wangyanan55@huawei.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Add a helper to get system default hugetlb page size</title>
<updated>2021-04-20T08:18:52Z</updated>
<author>
<name>Yanan Wang</name>
<email>wangyanan55@huawei.com</email>
</author>
<published>2021-03-30T08:08:53Z</published>
<link rel='alternate' type='text/html' href='https://git.zx2c4.com/linux-dev/commit/?id=5579fa682a3411e5ed58bde35af5128f1044a4b9'/>
<id>urn:sha1:5579fa682a3411e5ed58bde35af5128f1044a4b9</id>
<content type='text'>
If HUGETLB is configured in the host kernel, then we can know the system
default hugetlb page size through *cat /proc/meminfo*. Otherwise, we will
not see the information of hugetlb pages in file /proc/meminfo if it's not
configured. So add a helper to determine whether HUGETLB is configured and
then get the default page size by reading /proc/meminfo.

This helper can be useful when a program wants to use the default hugetlb
pages of the system and doesn't know the default page size.

Signed-off-by: Yanan Wang &lt;wangyanan55@huawei.com&gt;
Reviewed-by: Andrew Jones &lt;drjones@redhat.com&gt;
Message-Id: &lt;20210330080856.14940-8-wangyanan55@huawei.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
</feed>
