<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/tools/testing/selftests/kvm/kvm_binary_stats_test.c, branch v6.1.168</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.168</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.1.168'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2022-08-01T12:01:23+00:00</updated>
<entry>
<title>selftests: KVM: Add exponent check for boolean stats</title>
<updated>2022-08-01T12:01:23+00:00</updated>
<author>
<name>Oliver Upton</name>
<email>oupton@google.com</email>
</author>
<published>2022-07-19T14:31:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=dd4d1c3bb3f1cd91a7a67ed3d73299ecb273ff92'/>
<id>urn:sha1:dd4d1c3bb3f1cd91a7a67ed3d73299ecb273ff92</id>
<content type='text'>
The only sensible exponent for a boolean stat is 0. Add a test assertion
requiring all boolean statistics to have an exponent of 0.

Signed-off-by: Oliver Upton &lt;oupton@google.com&gt;
Reviewed-by: Andrew Jones &lt;andrew.jones@linux.dev&gt;
Message-Id: &lt;20220719143134.3246798-4-oliver.upton@linux.dev&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>selftests: KVM: Provide descriptive assertions in kvm_binary_stats_test</title>
<updated>2022-08-01T12:01:22+00:00</updated>
<author>
<name>Oliver Upton</name>
<email>oupton@google.com</email>
</author>
<published>2022-07-19T14:31:33+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7eebae78bc9754564779927976f37d04c2c01b64'/>
<id>urn:sha1:7eebae78bc9754564779927976f37d04c2c01b64</id>
<content type='text'>
As it turns out, tests sometimes fail. When that is the case, packing
the test assertion with as much relevant information helps track down
the problem more quickly.

Sharpen up the stat descriptor assertions in kvm_binary_stats_test to
more precisely describe the reason for the test assertion and which
stat is to blame.

Signed-off-by: Oliver Upton &lt;oupton@google.com&gt;
Reviewed-by: Andrew Jones &lt;andrew.jones@linux.dev&gt;
Message-Id: &lt;20220719143134.3246798-3-oliver.upton@linux.dev&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>selftests: KVM: Check stat name before other fields</title>
<updated>2022-08-01T12:01:22+00:00</updated>
<author>
<name>Oliver Upton</name>
<email>oupton@google.com</email>
</author>
<published>2022-07-19T14:31:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ad5b072716e9ea7164b578a06c615966e9203c45'/>
<id>urn:sha1:ad5b072716e9ea7164b578a06c615966e9203c45</id>
<content type='text'>
In order to provide more useful test assertions that describe the broken
stats descriptor, perform sanity check on the stat name before any other
descriptor field. While at it, avoid dereferencing the name field if the
sanity check fails as it is more likely to contain garbage.

Signed-off-by: Oliver Upton &lt;oupton@google.com&gt;
Reviewed-by: Andrew Jones &lt;andrew.jones@linux.dev&gt;
Message-Id: &lt;20220719143134.3246798-2-oliver.upton@linux.dev&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Read binary stat data in lib</title>
<updated>2022-06-24T08:51:47+00:00</updated>
<author>
<name>Ben Gardon</name>
<email>bgardon@google.com</email>
</author>
<published>2022-06-13T21:25:18+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=ed6b53ec9090133cd744705a09811cf627f3e9cb'/>
<id>urn:sha1:ed6b53ec9090133cd744705a09811cf627f3e9cb</id>
<content type='text'>
Move the code to read the binary stats data to the KVM selftests
library. It will be re-used by other tests to check KVM behavior.

Also opportunistically remove an unnecessary calculation with
"size_data" in stats_test.

Reviewed-by: David Matlack &lt;dmatlack@google.com&gt;
Reviewed-by: Peter Xu &lt;peterx@redhat.com&gt;
Signed-off-by: Ben Gardon &lt;bgardon@google.com&gt;
Message-Id: &lt;20220613212523.3436117-6-bgardon@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Clean up coding style in binary stats test</title>
<updated>2022-06-24T08:51:46+00:00</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2022-06-13T21:25:17+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=143e7eea3d66737c73cc3aa3538123ea3bb1f640'/>
<id>urn:sha1:143e7eea3d66737c73cc3aa3538123ea3bb1f640</id>
<content type='text'>
Fix a variety of code style violations and/or inconsistencies in the
binary stats test.  The 80 char limit is a soft limit and can and should
be ignored/violated if doing so improves the overall code readability.

Specifically, provide consistent indentation and don't split expressions
at arbitrary points just to honor the 80 char limit.

Opportunistically expand/add comments to call out the more subtle aspects
of the code.

Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
Reviewed-by: David Matlack &lt;dmatlack@google.com&gt;
Signed-off-by: Ben Gardon &lt;bgardon@google.com&gt;
Message-Id: &lt;20220613212523.3436117-5-bgardon@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Read binary stats desc in lib</title>
<updated>2022-06-24T08:51:45+00:00</updated>
<author>
<name>Ben Gardon</name>
<email>bgardon@google.com</email>
</author>
<published>2022-06-13T21:25:16+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=4d0a059415708ec0f221616f187853176d2fbebc'/>
<id>urn:sha1:4d0a059415708ec0f221616f187853176d2fbebc</id>
<content type='text'>
Move the code to read the binary stats descriptors to the KVM selftests
library. It will be re-used by other tests to check KVM behavior.

No functional change intended.

Reviewed-by: David Matlack &lt;dmatlack@google.com&gt;
Reviewed-by: Peter Xu &lt;peterx@redhat.com&gt;
Signed-off-by: Ben Gardon &lt;bgardon@google.com&gt;
Message-Id: &lt;20220613212523.3436117-4-bgardon@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Read binary stats header in lib</title>
<updated>2022-06-24T08:51:43+00:00</updated>
<author>
<name>Ben Gardon</name>
<email>bgardon@google.com</email>
</author>
<published>2022-06-13T21:25:15+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=32faa0647cea46ffda9095c3a8c95b315e139f0f'/>
<id>urn:sha1:32faa0647cea46ffda9095c3a8c95b315e139f0f</id>
<content type='text'>
Move the code to read the binary stats header to the KVM selftests
library. It will be re-used by other tests to check KVM behavior.

No functional change intended.

Reviewed-by: David Matlack &lt;dmatlack@google.com&gt;
Reviewed-by: Peter Xu &lt;peterx@redhat.com&gt;
Signed-off-by: Ben Gardon &lt;bgardon@google.com&gt;
Message-Id: &lt;20220613212523.3436117-3-bgardon@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Remove dynamic memory allocation for stats header</title>
<updated>2022-06-24T08:51:42+00:00</updated>
<author>
<name>Ben Gardon</name>
<email>bgardon@google.com</email>
</author>
<published>2022-06-13T21:25:14+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=fcd48a213f0ac45c2187b09e19d4849e14cb59f8'/>
<id>urn:sha1:fcd48a213f0ac45c2187b09e19d4849e14cb59f8</id>
<content type='text'>
There's no need to allocate dynamic memory for the stats header since
its size is known at compile time.

Reviewed-by: David Matlack &lt;dmatlack@google.com&gt;
Reviewed-by: Peter Xu &lt;peterx@redhat.com&gt;
Signed-off-by: Ben Gardon &lt;bgardon@google.com&gt;
Message-Id: &lt;20220613212523.3436117-2-bgardon@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: kvm_binary_stats_test: Fix index expressions</title>
<updated>2022-06-14T16:43:53+00:00</updated>
<author>
<name>Andrew Jones</name>
<email>drjones@redhat.com</email>
</author>
<published>2022-06-14T08:10:41+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=b3b7c6a6e80d8347a4a5a13a25fa314800f2cbbe'/>
<id>urn:sha1:b3b7c6a6e80d8347a4a5a13a25fa314800f2cbbe</id>
<content type='text'>
kvm_binary_stats_test accepts two arguments, the number of vms
and number of vcpus. If these inputs are not equal then the
test would likely crash for one reason or another due to using
miscalculated indices for the vcpus array. Fix the index
expressions by swapping the use of i and j.

Signed-off-by: Andrew Jones &lt;drjones@redhat.com&gt;
Message-Id: &lt;20220614081041.2571511-1-drjones@redhat.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Add TEST_REQUIRE macros to reduce skipping copy+paste</title>
<updated>2022-06-11T15:47:29+00:00</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2022-05-27T23:24:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=7ed397d107d461a53e350e5025d68ec3c4a8934d'/>
<id>urn:sha1:7ed397d107d461a53e350e5025d68ec3c4a8934d</id>
<content type='text'>
Add TEST_REQUIRE() and __TEST_REQUIRE() to replace the myriad open coded
instances of selftests exiting with KSFT_SKIP after printing an
informational message.  In addition to reducing the amount of boilerplate
code in selftests, the UPPERCASE macro names make it easier to visually
identify a test's requirements.

Convert usage that erroneously uses something other than print_skip()
and/or "exits" with '0' or some other non-KSFT_SKIP value.

Intentionally drop a kvm_vm_free() in aarch64/debug-exceptions.c as part
of the conversion.  All memory and file descriptors are freed on process
exit, so the explicit free is superfluous.

Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
</feed>
