<feed xmlns='http://www.w3.org/2005/Atom'>
<title>lwn.git/arch/s390/include/asm/kvm_host.h, branch v5.10-rc2</title>
<subtitle>Linux kernel documentation tree maintained by Jonathan Corbet</subtitle>
<id>http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v5.10-rc2</id>
<link rel='self' href='http://mirrors.hust.edu.cn/git/lwn.git/atom?h=v5.10-rc2'/>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/'/>
<updated>2020-08-03T18:19:13+00:00</updated>
<entry>
<title>Merge tag 'kvm-s390-next-5.9-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into kvm-next-5.6</title>
<updated>2020-08-03T18:19:13+00:00</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2020-08-03T18:19:13+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=f3633c2683545213de4a00a9b0c3fba741321fb2'/>
<id>urn:sha1:f3633c2683545213de4a00a9b0c3fba741321fb2</id>
<content type='text'>
KVM: s390: Enhancement for 5.9
- implement diagnose 318
</content>
</entry>
<entry>
<title>s390/kvm: diagnose 0x318 sync and reset</title>
<updated>2020-06-23T08:55:33+00:00</updated>
<author>
<name>Collin Walling</name>
<email>walling@linux.ibm.com</email>
</author>
<published>2020-06-22T15:46:36+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=23a60f834406c8e3805328b630d09d5546b460c1'/>
<id>urn:sha1:23a60f834406c8e3805328b630d09d5546b460c1</id>
<content type='text'>
DIAGNOSE 0x318 (diag318) sets information regarding the environment
the VM is running in (Linux, z/VM, etc) and is observed via
firmware/service events.

This is a privileged s390x instruction that must be intercepted by
SIE. Userspace handles the instruction as well as migration. Data
is communicated via VCPU register synchronization.

The Control Program Name Code (CPNC) is stored in the SIE block. The
CPNC along with the Control Program Version Code (CPVC) are stored
in the kvm_vcpu_arch struct.

This data is reset on load normal and clear resets.

Signed-off-by: Collin Walling &lt;walling@linux.ibm.com&gt;
Reviewed-by: Janosch Frank &lt;frankja@linux.ibm.com&gt;
Acked-by: Cornelia Huck &lt;cohuck@redhat.com&gt;
Reviewed-by: David Hildenbrand &lt;david@redhat.com&gt;
Link: https://lore.kernel.org/r/20200622154636.5499-3-walling@linux.ibm.com
[borntraeger@de.ibm.com: fix sync_reg position]
Signed-off-by: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
</content>
</entry>
<entry>
<title>KVM: s390: reduce number of IO pins to 1</title>
<updated>2020-06-18T07:48:19+00:00</updated>
<author>
<name>Christian Borntraeger</name>
<email>borntraeger@de.ibm.com</email>
</author>
<published>2020-06-17T08:36:20+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=774911290c589e98e3638e73b24b0a4d4530e97c'/>
<id>urn:sha1:774911290c589e98e3638e73b24b0a4d4530e97c</id>
<content type='text'>
The current number of KVM_IRQCHIP_NUM_PINS results in an order 3
allocation (32kb) for each guest start/restart. This can result in OOM
killer activity even with free swap when the memory is fragmented
enough:

kernel: qemu-system-s39 invoked oom-killer: gfp_mask=0x440dc0(GFP_KERNEL_ACCOUNT|__GFP_COMP|__GFP_ZERO), order=3, oom_score_adj=0
kernel: CPU: 1 PID: 357274 Comm: qemu-system-s39 Kdump: loaded Not tainted 5.4.0-29-generic #33-Ubuntu
kernel: Hardware name: IBM 8562 T02 Z06 (LPAR)
kernel: Call Trace:
kernel: ([&lt;00000001f848fe2a&gt;] show_stack+0x7a/0xc0)
kernel:  [&lt;00000001f8d3437a&gt;] dump_stack+0x8a/0xc0
kernel:  [&lt;00000001f8687032&gt;] dump_header+0x62/0x258
kernel:  [&lt;00000001f8686122&gt;] oom_kill_process+0x172/0x180
kernel:  [&lt;00000001f8686abe&gt;] out_of_memory+0xee/0x580
kernel:  [&lt;00000001f86e66b8&gt;] __alloc_pages_slowpath+0xd18/0xe90
kernel:  [&lt;00000001f86e6ad4&gt;] __alloc_pages_nodemask+0x2a4/0x320
kernel:  [&lt;00000001f86b1ab4&gt;] kmalloc_order+0x34/0xb0
kernel:  [&lt;00000001f86b1b62&gt;] kmalloc_order_trace+0x32/0xe0
kernel:  [&lt;00000001f84bb806&gt;] kvm_set_irq_routing+0xa6/0x2e0
kernel:  [&lt;00000001f84c99a4&gt;] kvm_arch_vm_ioctl+0x544/0x9e0
kernel:  [&lt;00000001f84b8936&gt;] kvm_vm_ioctl+0x396/0x760
kernel:  [&lt;00000001f875df66&gt;] do_vfs_ioctl+0x376/0x690
kernel:  [&lt;00000001f875e304&gt;] ksys_ioctl+0x84/0xb0
kernel:  [&lt;00000001f875e39a&gt;] __s390x_sys_ioctl+0x2a/0x40
kernel:  [&lt;00000001f8d55424&gt;] system_call+0xd8/0x2c8

As far as I can tell s390x does not use the iopins as we bail our for
anything other than KVM_IRQ_ROUTING_S390_ADAPTER and the chip/pin is
only used for KVM_IRQ_ROUTING_IRQCHIP. So let us use a small number to
reduce the memory footprint.

Signed-off-by: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
Reviewed-by: Cornelia Huck &lt;cohuck@redhat.com&gt;
Reviewed-by: David Hildenbrand &lt;david@redhat.com&gt;
Link: https://lore.kernel.org/r/20200617083620.5409-1-borntraeger@de.ibm.com
</content>
</entry>
<entry>
<title>KVM: async_pf: Inject 'page ready' event only if 'page not present' was previously injected</title>
<updated>2020-06-11T16:35:19+00:00</updated>
<author>
<name>Vitaly Kuznetsov</name>
<email>vkuznets@redhat.com</email>
</author>
<published>2020-06-10T17:55:32+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=2a18b7e7cd8882f626316c340c6f2fca49b5fa12'/>
<id>urn:sha1:2a18b7e7cd8882f626316c340c6f2fca49b5fa12</id>
<content type='text'>
'Page not present' event may or may not get injected depending on
guest's state. If the event wasn't injected, there is no need to
inject the corresponding 'page ready' event as the guest may get
confused. E.g. Linux thinks that the corresponding 'page not present'
event wasn't delivered *yet* and allocates a 'dummy entry' for it.
This entry is never freed.

Note, 'wakeup all' events have no corresponding 'page not present'
event and always get injected.

s390 seems to always be able to inject 'page not present', the
change is effectively a nop.

Suggested-by: Vivek Goyal &lt;vgoyal@redhat.com&gt;
Signed-off-by: Vitaly Kuznetsov &lt;vkuznets@redhat.com&gt;
Message-Id: &lt;20200610175532.779793-2-vkuznets@redhat.com&gt;
Fixes: https://bugzilla.kernel.org/show_bug.cgi?id=208081
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: x86: acknowledgment mechanism for async pf page ready notifications</title>
<updated>2020-06-01T08:26:08+00:00</updated>
<author>
<name>Vitaly Kuznetsov</name>
<email>vkuznets@redhat.com</email>
</author>
<published>2020-05-25T14:41:21+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=557a961abbe06ed9dfd3b55ef7bd6e68295cda3d'/>
<id>urn:sha1:557a961abbe06ed9dfd3b55ef7bd6e68295cda3d</id>
<content type='text'>
If two page ready notifications happen back to back the second one is not
delivered and the only mechanism we currently have is
kvm_check_async_pf_completion() check in vcpu_run() loop. The check will
only be performed with the next vmexit when it happens and in some cases
it may take a while. With interrupt based page ready notification delivery
the situation is even worse: unlike exceptions, interrupts are not handled
immediately so we must check if the slot is empty. This is slow and
unnecessary. Introduce dedicated MSR_KVM_ASYNC_PF_ACK MSR to communicate
the fact that the slot is free and host should check its notification
queue. Mandate using it for interrupt based 'page ready' APF event
delivery.

As kvm_check_async_pf_completion() is going away from vcpu_run() we need
a way to communicate the fact that vcpu-&gt;async_pf.done queue has
transitioned from empty to non-empty state. Introduce
kvm_arch_async_page_present_queued() and KVM_REQ_APF_READY to do the job.

Signed-off-by: Vitaly Kuznetsov &lt;vkuznets@redhat.com&gt;
Message-Id: &lt;20200525144125.143875-7-vkuznets@redhat.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>KVM: rename kvm_arch_can_inject_async_page_present() to kvm_arch_can_dequeue_async_page_present()</title>
<updated>2020-06-01T08:26:07+00:00</updated>
<author>
<name>Vitaly Kuznetsov</name>
<email>vkuznets@redhat.com</email>
</author>
<published>2020-05-25T14:41:18+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=7c0ade6c9023b2b90b757e2927b306bec1cc4ca6'/>
<id>urn:sha1:7c0ade6c9023b2b90b757e2927b306bec1cc4ca6</id>
<content type='text'>
An innocent reader of the following x86 KVM code:

bool kvm_arch_can_inject_async_page_present(struct kvm_vcpu *vcpu)
{
        if (!(vcpu-&gt;arch.apf.msr_val &amp; KVM_ASYNC_PF_ENABLED))
                return true;
...

may get very confused: if APF mechanism is not enabled, why do we report
that we 'can inject async page present'? In reality, upon injection
kvm_arch_async_page_present() will check the same condition again and,
in case APF is disabled, will just drop the item. This is fine as the
guest which deliberately disabled APF doesn't expect to get any APF
notifications.

Rename kvm_arch_can_inject_async_page_present() to
kvm_arch_can_dequeue_async_page_present() to make it clear what we are
checking: if the item can be dequeued (meaning either injected or just
dropped).

On s390 kvm_arch_can_inject_async_page_present() always returns 'true' so
the rename doesn't matter much.

Signed-off-by: Vitaly Kuznetsov &lt;vkuznets@redhat.com&gt;
Message-Id: &lt;20200525144125.143875-4-vkuznets@redhat.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>kvm: add halt-polling cpu usage stats</title>
<updated>2020-05-15T16:26:26+00:00</updated>
<author>
<name>David Matlack</name>
<email>dmatlack@google.com</email>
</author>
<published>2020-05-08T18:22:40+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=cb953129bfe5c0f2da835a0469930873fb7e71df'/>
<id>urn:sha1:cb953129bfe5c0f2da835a0469930873fb7e71df</id>
<content type='text'>
Two new stats for exposing halt-polling cpu usage:
halt_poll_success_ns
halt_poll_fail_ns

Thus sum of these 2 stats is the total cpu time spent polling. "success"
means the VCPU polled until a virtual interrupt was delivered. "fail"
means the VCPU had to schedule out (either because the maximum poll time
was reached or it needed to yield the CPU).

To avoid touching every arch's kvm_vcpu_stat struct, only update and
export halt-polling cpu usage stats if we're on x86.

Exporting cpu usage as a u64 and in nanoseconds means we will overflow at
~500 years, which seems reasonably large.

Signed-off-by: David Matlack &lt;dmatlack@google.com&gt;
Signed-off-by: Jon Cargille &lt;jcargill@google.com&gt;
Reviewed-by: Jim Mattson &lt;jmattson@google.com&gt;

Message-Id: &lt;20200508182240.68440-1-jcargill@google.com&gt;
Signed-off-by: Paolo Bonzini &lt;pbonzini@redhat.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'kvm-s390-next-5.7-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD</title>
<updated>2020-03-26T09:58:49+00:00</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2020-03-26T09:58:49+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=8bf8961332bd6393716297e1a2b628d88300b2f2'/>
<id>urn:sha1:8bf8961332bd6393716297e1a2b628d88300b2f2</id>
<content type='text'>
KVM: s390: cleanups for 5.7

- mark sie control block as 512 byte aligned
- use fallthrough;
</content>
</entry>
<entry>
<title>KVM: s390: mark sie block as 512 byte aligned</title>
<updated>2020-03-23T17:30:33+00:00</updated>
<author>
<name>Christian Borntraeger</name>
<email>borntraeger@de.ibm.com</email>
</author>
<published>2020-03-11T08:30:56+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=f3dd18d444c757840920434e62809b6104081b06'/>
<id>urn:sha1:f3dd18d444c757840920434e62809b6104081b06</id>
<content type='text'>
The sie block must be aligned to 512 bytes. Mark it as such.

Signed-off-by: Christian Borntraeger &lt;borntraeger@de.ibm.com&gt;
Reviewed-by: David Hildenbrand &lt;david@redhat.com&gt;
</content>
</entry>
<entry>
<title>Merge tag 'kvm-s390-next-5.7-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvms390/linux into HEAD</title>
<updated>2020-03-16T17:19:34+00:00</updated>
<author>
<name>Paolo Bonzini</name>
<email>pbonzini@redhat.com</email>
</author>
<published>2020-03-16T17:19:34+00:00</published>
<link rel='alternate' type='text/html' href='http://mirrors.hust.edu.cn/git/lwn.git/commit/?id=1c482452d5db0f52e4e8eed95bd7314eec537d78'/>
<id>urn:sha1:1c482452d5db0f52e4e8eed95bd7314eec537d78</id>
<content type='text'>
KVM: s390: Features and Enhancements for 5.7 part1

1. Allow to disable gisa
2. protected virtual machines
  Protected VMs (PVM) are KVM VMs, where KVM can't access the VM's
  state like guest memory and guest registers anymore. Instead the
  PVMs are mostly managed by a new entity called Ultravisor (UV),
  which provides an API, so KVM and the PV can request management
  actions.

  PVMs are encrypted at rest and protected from hypervisor access
  while running.  They switch from a normal operation into protected
  mode, so we can still use the standard boot process to load a
  encrypted blob and then move it into protected mode.

  Rebooting is only possible by passing through the unprotected/normal
  mode and switching to protected again.

  One mm related patch will go via Andrews mm tree ( mm/gup/writeback:
  add callbacks for inaccessible pages)
</content>
</entry>
</feed>
