<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel/linux.git/virt/kvm/pfncache.c, branch v6.6</title>
<subtitle>Linux kernel stable tree (mirror)</subtitle>
<id>https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6</id>
<link rel='self' href='https://git.radix-linux.su/kernel/linux.git/atom?h=v6.6'/>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/'/>
<updated>2022-11-30T19:25:24+00:00</updated>
<entry>
<title>KVM: Skip unnecessary "unmap" if gpc is already valid during refresh</title>
<updated>2022-11-30T19:25:24+00:00</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2022-10-13T21:12:32+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=06e155c44aa0e7921aa44d3c67f8ea464b16cb75'/>
<id>urn:sha1:06e155c44aa0e7921aa44d3c67f8ea464b16cb75</id>
<content type='text'>
When refreshing a gfn=&gt;pfn cache, skip straight to unlocking if the cache
already valid instead of stuffing the "old" variables to turn the
unmapping outro into a nop.

Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
Signed-off-by: David Woodhouse &lt;dwmw@amazon.co.uk&gt;
</content>
</entry>
<entry>
<title>KVM: Drop @gpa from exported gfn=&gt;pfn cache check() and refresh() helpers</title>
<updated>2022-11-30T19:25:24+00:00</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2022-10-13T21:12:31+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=58f5ee5fedd981e05cb086cba4e8f923c3727a04'/>
<id>urn:sha1:58f5ee5fedd981e05cb086cba4e8f923c3727a04</id>
<content type='text'>
Drop the @gpa param from the exported check()+refresh() helpers and limit
changing the cache's GPA to the activate path.  All external users just
feed in gpc-&gt;gpa, i.e. this is a fancy nop.

Allowing users to change the GPA at check()+refresh() is dangerous as
those helpers explicitly allow concurrent calls, e.g. KVM could get into
a livelock scenario.  It's also unclear as to what the expected behavior
should be if multiple tasks attempt to refresh with different GPAs.

Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
Signed-off-by: David Woodhouse &lt;dwmw@amazon.co.uk&gt;
</content>
</entry>
<entry>
<title>KVM: Do not partially reinitialize gfn=&gt;pfn cache during activation</title>
<updated>2022-11-30T19:25:24+00:00</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2022-10-13T21:12:30+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=5762cb10235776dd1ed5f5f9d6c1aff2b73bec5c'/>
<id>urn:sha1:5762cb10235776dd1ed5f5f9d6c1aff2b73bec5c</id>
<content type='text'>
Don't partially reinitialize a gfn=&gt;pfn cache when activating the cache,
and instead assert that the cache is not valid during activation.  Bug
the VM if the assertion fails, as use-after-free and/or data corruption
is all but guaranteed if KVM ends up with a valid-but-inactive cache.

Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
Signed-off-by: David Woodhouse &lt;dwmw@amazon.co.uk&gt;
</content>
</entry>
<entry>
<title>KVM: Drop KVM's API to allow temporarily unmapping gfn=&gt;pfn cache</title>
<updated>2022-11-30T19:25:24+00:00</updated>
<author>
<name>Sean Christopherson</name>
<email>seanjc@google.com</email>
</author>
<published>2022-10-13T21:12:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=9f87791d686d85614584438d4f249eb32ef7964c'/>
<id>urn:sha1:9f87791d686d85614584438d4f249eb32ef7964c</id>
<content type='text'>
Drop kvm_gpc_unmap() as it has no users and unclear requirements.  The
API was added as part of the original gfn_to_pfn_cache support, but its
sole usage[*] was never merged.  Fold the guts of kvm_gpc_unmap() into
the deactivate path and drop the API.  Omit acquiring refresh_lock as
as concurrent calls to kvm_gpc_deactivate() are not allowed (this is
not enforced, e.g. via lockdep. due to it being called during vCPU
destruction).

If/when temporary unmapping makes a comeback, the desirable behavior is
likely to restrict temporary unmapping to vCPU-exclusive mappings and
require the vcpu-&gt;mutex be held to serialize unmap.  Use of the
refresh_lock to protect unmapping was somewhat specuatively added by
commit 93984f19e7bc ("KVM: Fully serialize gfn=&gt;pfn cache refresh via
mutex") to guard against concurrent unmaps, but the primary use case of
the temporary unmap, nested virtualization[*], doesn't actually need or
want concurrent unmaps.

[*] https://lore.kernel.org/all/20211210163625.2886-7-dwmw2@infradead.org

Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
Signed-off-by: David Woodhouse &lt;dwmw@amazon.co.uk&gt;
</content>
</entry>
<entry>
<title>KVM: Use gfn_to_pfn_cache's immutable "kvm" in kvm_gpc_refresh()</title>
<updated>2022-11-30T19:25:24+00:00</updated>
<author>
<name>Michal Luczaj</name>
<email>mhal@rbox.co</email>
</author>
<published>2022-10-13T21:12:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=0318f207d1c2e297d1ec1c6e145bb8bd053236f9'/>
<id>urn:sha1:0318f207d1c2e297d1ec1c6e145bb8bd053236f9</id>
<content type='text'>
Make kvm_gpc_refresh() use kvm instance cached in gfn_to_pfn_cache.

No functional change intended.

Suggested-by: Sean Christopherson &lt;seanjc@google.com&gt;
Signed-off-by: Michal Luczaj &lt;mhal@rbox.co&gt;
[sean: leave kvm_gpc_unmap() as-is]
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
Signed-off-by: David Woodhouse &lt;dwmw@amazon.co.uk&gt;
</content>
</entry>
<entry>
<title>KVM: Clean up hva_to_pfn_retry()</title>
<updated>2022-11-30T19:25:23+00:00</updated>
<author>
<name>Michal Luczaj</name>
<email>mhal@rbox.co</email>
</author>
<published>2022-10-13T21:12:27+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=2a0b128a906ab28b1ab41ceedcaf462b6f74f1aa'/>
<id>urn:sha1:2a0b128a906ab28b1ab41ceedcaf462b6f74f1aa</id>
<content type='text'>
Make hva_to_pfn_retry() use kvm instance cached in gfn_to_pfn_cache.

Suggested-by: Sean Christopherson &lt;seanjc@google.com&gt;
Signed-off-by: Michal Luczaj &lt;mhal@rbox.co&gt;
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
Signed-off-by: David Woodhouse &lt;dwmw@amazon.co.uk&gt;
</content>
</entry>
<entry>
<title>KVM: Use gfn_to_pfn_cache's immutable "kvm" in kvm_gpc_check()</title>
<updated>2022-11-30T19:25:23+00:00</updated>
<author>
<name>Michal Luczaj</name>
<email>mhal@rbox.co</email>
</author>
<published>2022-10-13T21:12:26+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=e308c24a358d1e79951b16c387cbc6c6593639a5'/>
<id>urn:sha1:e308c24a358d1e79951b16c387cbc6c6593639a5</id>
<content type='text'>
Make kvm_gpc_check() use kvm instance cached in gfn_to_pfn_cache.

Suggested-by: Sean Christopherson &lt;seanjc@google.com&gt;
Signed-off-by: Michal Luczaj &lt;mhal@rbox.co&gt;
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
Signed-off-by: David Woodhouse &lt;dwmw@amazon.co.uk&gt;
</content>
</entry>
<entry>
<title>KVM: Store immutable gfn_to_pfn_cache properties</title>
<updated>2022-11-30T19:25:23+00:00</updated>
<author>
<name>Michal Luczaj</name>
<email>mhal@rbox.co</email>
</author>
<published>2022-10-13T21:12:24+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=8c82a0b3ba1a411b84af5d43a4cc5994efa897ec'/>
<id>urn:sha1:8c82a0b3ba1a411b84af5d43a4cc5994efa897ec</id>
<content type='text'>
Move the assignment of immutable properties @kvm, @vcpu, and @usage to
the initializer.  Make _activate() and _deactivate() use stored values.

Note, @len is also effectively immutable for most cases, but not in the
case of the Xen runstate cache, which may be split across two pages and
the length of the first segment will depend on its address.

Suggested-by: Sean Christopherson &lt;seanjc@google.com&gt;
Signed-off-by: Michal Luczaj &lt;mhal@rbox.co&gt;
[sean: handle @len in a separate patch]
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
[dwmw2: acknowledge that @len can actually change for some use cases]
Signed-off-by: David Woodhouse &lt;dwmw@amazon.co.uk&gt;
</content>
</entry>
<entry>
<title>KVM: x86: Remove unused argument in gpc_unmap_khva()</title>
<updated>2022-11-30T16:05:32+00:00</updated>
<author>
<name>Michal Luczaj</name>
<email>mhal@rbox.co</email>
</author>
<published>2022-10-13T21:12:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=c1a81f3bd9b40edc1444dfaeac33f92cff0e770a'/>
<id>urn:sha1:c1a81f3bd9b40edc1444dfaeac33f92cff0e770a</id>
<content type='text'>
Remove the unused @kvm argument from gpc_unmap_khva().

Signed-off-by: Michal Luczaj &lt;mhal@rbox.co&gt;
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
Signed-off-by: David Woodhouse &lt;dwmw@amazon.co.uk&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: Shorten gfn_to_pfn_cache function names</title>
<updated>2022-11-30T16:03:58+00:00</updated>
<author>
<name>Michal Luczaj</name>
<email>mhal@rbox.co</email>
</author>
<published>2022-10-13T21:12:22+00:00</published>
<link rel='alternate' type='text/html' href='https://git.radix-linux.su/kernel/linux.git/commit/?id=aba3caef58626f09b629085440eec5dd1368669a'/>
<id>urn:sha1:aba3caef58626f09b629085440eec5dd1368669a</id>
<content type='text'>
Formalize "gpc" as the acronym and use it in function names.

No functional change intended.

Suggested-by: Sean Christopherson &lt;seanjc@google.com&gt;
Signed-off-by: Michal Luczaj &lt;mhal@rbox.co&gt;
Signed-off-by: Sean Christopherson &lt;seanjc@google.com&gt;
Signed-off-by: David Woodhouse &lt;dwmw@amazon.co.uk&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
</feed>
