<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/tools/testing/selftests/kvm, branch linux-6.2.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.</subtitle>
<id>https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y</id>
<link rel='self' href='https://universe.0xinfinity.dev/distro/kernel/atom?h=linux-6.2.y'/>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/'/>
<updated>2023-02-04T13:57:43Z</updated>
<entry>
<title>Merge tag 'kvmarm-fixes-6.2-3' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD</title>
<updated>2023-02-04T13:57:43Z</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2023-02-04T13:57:43Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=25b72cf7da9f0d66eef3979187ddfda98d4efcd0'/>
<id>urn:sha1:25b72cf7da9f0d66eef3979187ddfda98d4efcd0</id>
<content type='text'>
KVM/arm64 fixes for 6.2, take #3

- Yet another fix for non-CPU accesses to the memory backing
  the VGICv3 subsystem

- A set of fixes for the setlftest checking for the S1PTW
  behaviour after the fix that went in ealier in the cycle
</content>
</entry>
<entry>
<title>KVM: selftests: aarch64: Test read-only PT memory regions</title>
<updated>2023-01-29T18:49:08Z</updated>
<author>
<name>Ricardo Koller</name>
<email>ricarkol@google.com</email>
</author>
<published>2023-01-27T21:43:53Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=08ddbbdf0b55839ca93a12677a30a1ef24634969'/>
<id>urn:sha1:08ddbbdf0b55839ca93a12677a30a1ef24634969</id>
<content type='text'>
Extend the read-only memslot tests in page_fault_test to test
read-only PT (Page table) memslots. Note that this was not allowed
before commit 406504c7b040 ("KVM: arm64: Fix S1PTW handling on RO
memslots") as all S1PTW faults were treated as writes which resulted
in an (unrecoverable) exception inside the guest.

Signed-off-by: Ricardo Koller &lt;ricarkol@google.com&gt;
Reviewed-by: Oliver Upton &lt;oliver.upton@linux.dev&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20230127214353.245671-5-ricarkol@google.com
</content>
</entry>
<entry>
<title>KVM: selftests: aarch64: Fix check of dirty log PT write</title>
<updated>2023-01-29T18:49:08Z</updated>
<author>
<name>Ricardo Koller</name>
<email>ricarkol@google.com</email>
</author>
<published>2023-01-27T21:43:52Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=8b03c97fa6fd442b949b71aeb7545b970b968fe3'/>
<id>urn:sha1:8b03c97fa6fd442b949b71aeb7545b970b968fe3</id>
<content type='text'>
The dirty log checks are mistakenly testing the first page in the page
table (PT) memory region instead of the page holding the test data
page PTE.  This wasn't an issue before commit 406504c7b040 ("KVM:
arm64: Fix S1PTW handling on RO memslots") as all PT pages (including
the first page) were treated as writes.

Fix the page_fault_test dirty logging tests by checking for the right
page: the one for the PTE of the data test page.

Fixes: a4edf25b3e25 ("KVM: selftests: aarch64: Add dirty logging tests into page_fault_test")
Signed-off-by: Ricardo Koller &lt;ricarkol@google.com&gt;
Reviewed-by: Oliver Upton &lt;oliver.upton@linux.dev&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20230127214353.245671-4-ricarkol@google.com
</content>
</entry>
<entry>
<title>KVM: selftests: aarch64: Do not default to dirty PTE pages on all S1PTWs</title>
<updated>2023-01-29T18:49:08Z</updated>
<author>
<name>Ricardo Koller</name>
<email>ricarkol@google.com</email>
</author>
<published>2023-01-27T21:43:51Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=42561751ea918d8f3f54412622735e1f887cb360'/>
<id>urn:sha1:42561751ea918d8f3f54412622735e1f887cb360</id>
<content type='text'>
Only Stage1 Page table walks (S1PTW) trying to write into a PTE should
result in the PTE page being dirty in the log.  However, the dirty log
tests in page_fault_test default to treat all S1PTW accesses as writes.
Fix the relevant tests by asserting dirty pages only for S1PTW writes,
which in these tests only applies to when Hardware management of the Access
Flag is enabled.

Signed-off-by: Ricardo Koller &lt;ricarkol@google.com&gt;
Reviewed-by: Oliver Upton &lt;oliver.upton@linux.dev&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20230127214353.245671-3-ricarkol@google.com
</content>
</entry>
<entry>
<title>KVM: selftests: aarch64: Relax userfaultfd read vs. write checks</title>
<updated>2023-01-29T18:49:08Z</updated>
<author>
<name>Ricardo Koller</name>
<email>ricarkol@google.com</email>
</author>
<published>2023-01-27T21:43:50Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=0dd8d22a887a473f6f11abf556c4f7944ab5ef1d'/>
<id>urn:sha1:0dd8d22a887a473f6f11abf556c4f7944ab5ef1d</id>
<content type='text'>
Only Stage1 Page table walks (S1PTW) writing a PTE on an unmapped page
should result in a userfaultfd write. However, the userfaultfd tests in
page_fault_test wrongly assert that any S1PTW is a PTE write.

Fix this by relaxing the read vs. write checks in all userfaultfd
handlers.  Note that this is also an attempt to focus less on KVM (and
userfaultfd) behavior, and more on architectural behavior. Also note
that after commit 406504c7b040 ("KVM: arm64: Fix S1PTW handling on RO
memslots"), the userfaultfd fault (S1PTW with AF on an unmaped PTE
page) is actually a read: the translation fault that comes before the
permission fault.

Signed-off-by: Ricardo Koller &lt;ricarkol@google.com&gt;
Reviewed-by: Oliver Upton &lt;oliver.upton@linux.dev&gt;
Signed-off-by: Marc Zyngier &lt;maz@kernel.org&gt;
Link: https://lore.kernel.org/r/20230127214353.245671-2-ricarkol@google.com
</content>
</entry>
<entry>
<title>KVM: selftests: Make reclaim_period_ms input always be positive</title>
<updated>2023-01-22T09:10:24Z</updated>
<author>
<name>Vipin Sharma</name>
<email>vipinsh@google.com</email>
</author>
<published>2023-01-11T18:34:08Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=c2c46b10d52624376322b01654095a84611c7e09'/>
<id>urn:sha1:c2c46b10d52624376322b01654095a84611c7e09</id>
<content type='text'>
reclaim_period_ms used to be positive only but the commit 0001725d0f9b
("KVM: selftests: Add atoi_positive() and atoi_non_negative() for input
validation") incorrectly changed it to non-negative validation.

Change validation to allow only positive input.

Fixes: 0001725d0f9b ("KVM: selftests: Add atoi_positive() and atoi_non_negative() for input validation")
Signed-off-by: Vipin Sharma &lt;vipinsh@google.com&gt;
Reported-by: Ben Gardon &lt;bgardon@google.com&gt;
Reviewed-by: Ben Gardon &lt;bgardon@google.com&gt;
Reviewed-by: Sean Christopherson &lt;seanjc@google.com&gt;
Message-Id: &lt;20230111183408.104491-1-vipinsh@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>selftests: kvm: move declaration at the beginning of main()</title>
<updated>2023-01-22T09:08:33Z</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2023-01-22T09:04:50Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=50aa870ba2f7735f556e52d15f61cd0f359c4c0b'/>
<id>urn:sha1:50aa870ba2f7735f556e52d15f61cd0f359c4c0b</id>
<content type='text'>
Placing a declaration of evt_reset is pedantically invalid
according to the C standard.  While GCC does not really care
and only warns with -Wpedantic, clang ignores the declaration
altogether with an error:

x86_64/xen_shinfo_test.c:965:2: error: expected expression
        struct kvm_xen_hvm_attr evt_reset = {
        ^
x86_64/xen_shinfo_test.c:969:38: error: use of undeclared identifier evt_reset
        vm_ioctl(vm, KVM_XEN_HVM_SET_ATTR, &amp;evt_reset);
                                            ^

Reported-by: Yu Zhang &lt;yu.c.zhang@linux.intel.com&gt;
Reported-by: Sean Christopherson &lt;seanjc@google.com&gt;
Fixes: a79b53aaaab5 ("KVM: x86: fix deadlock for KVM_XEN_EVTCHN_RESET", 2022-12-28)
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: restore special vmmcall code layout needed by the harness</title>
<updated>2022-12-28T12:18:01Z</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2022-11-30T18:11:47Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=129c48cde6c9e519d033305649665427c6cac494'/>
<id>urn:sha1:129c48cde6c9e519d033305649665427c6cac494</id>
<content type='text'>
Commit 8fda37cf3d41 ("KVM: selftests: Stuff RAX/RCX with 'safe' values
in vmmcall()/vmcall()", 2022-11-21) broke the svm_nested_soft_inject_test
because it placed a "pop rbp" instruction after vmmcall.  While this is
correct and mimics what is done in the VMX case, this particular test
expects a ud2 instruction right after the vmmcall, so that it can skip
over it in the L1 part of the test.

Inline a suitably-modified version of vmmcall() to restore the
functionality of the test.

Fixes: 8fda37cf3d41 ("KVM: selftests: Stuff RAX/RCX with 'safe' values in vmmcall()/vmcall()"
Cc: Vitaly Kuznetsov &lt;vkuznets@redhat.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
Reviewed-by: Sean Christopherson &lt;seanjc@google.com&gt;
Reviewed-by: Vitaly Kuznetsov &lt;vkuznets@redhat.com&gt;
Reviewed-by: Maxim Levitsky &lt;mlevitsk@redhat.com&gt;
Message-Id: &lt;20221130181147.9911-1-pbonzini@redhat.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: x86: fix deadlock for KVM_XEN_EVTCHN_RESET</title>
<updated>2022-12-28T10:53:57Z</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2022-12-28T10:33:41Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=a79b53aaaab53de017517bf9579b6106397a523c'/>
<id>urn:sha1:a79b53aaaab53de017517bf9579b6106397a523c</id>
<content type='text'>
While KVM_XEN_EVTCHN_RESET is usually called with no vCPUs running,
if that happened it could cause a deadlock.  This is due to
kvm_xen_eventfd_reset() doing a synchronize_srcu() inside
a kvm-&gt;lock critical section.

To avoid this, first collect all the evtchnfd objects in an
array and free all of them once the kvm-&gt;lock critical section
is over and th SRCU grace period has expired.

Reported-by: Michal Luczaj &lt;mhal@rbox.co&gt;
Cc: David Woodhouse &lt;dwmw@amazon.co.uk&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: selftests: Mark correct page as mapped in virt_map()</title>
<updated>2022-12-27T11:00:50Z</updated>
<author>
<name>Oliver Upton</name>
<email>oliver.upton@linux.dev</email>
</author>
<published>2022-12-09T01:53:02Z</published>
<link rel='alternate' type='text/html' href='https://universe.0xinfinity.dev/distro/kernel/commit/?id=92c8191bb5d3f670ed806f91823381193288a4e1'/>
<id>urn:sha1:92c8191bb5d3f670ed806f91823381193288a4e1</id>
<content type='text'>
The loop marks vaddr as mapped after incrementing it by page size,
thereby marking the *next* page as mapped. Set the bit in vpages_mapped
first instead.

Fixes: 56fc7732031d ("KVM: selftests: Fill in vm-&gt;vpages_mapped bitmap in virt_map() too")
Signed-off-by: Oliver Upton &lt;oliver.upton@linux.dev&gt;
Message-Id: &lt;20221209015307.1781352-4-oliver.upton@linux.dev&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
</feed>
