All of lore.kernel.org
 help / color / mirror / Atom feed
From: Claudio Imbrenda <imbrenda@linux.ibm.com>
To: kvm@vger.kernel.org
Cc: borntraeger@de.ibm.com, frankja@linux.ibm.com, thuth@redhat.com,
	pasic@linux.ibm.com, david@redhat.com,
	linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org,
	scgl@linux.ibm.com, seiden@linux.ibm.com, nrb@linux.ibm.com
Subject: [PATCH v13 2/6] KVM: s390: pv: api documentation for asynchronous destroy
Date: Wed, 10 Aug 2022 14:56:21 +0200	[thread overview]
Message-ID: <20220810125625.45295-3-imbrenda@linux.ibm.com> (raw)
In-Reply-To: <20220810125625.45295-1-imbrenda@linux.ibm.com>

Add documentation for the new commands added to the KVM_S390_PV_COMMAND
ioctl.

Signed-off-by: Claudio Imbrenda <imbrenda@linux.ibm.com>
Reviewed-by: Nico Boehr <nrb@linux.ibm.com>
---
 Documentation/virt/kvm/api.rst | 30 ++++++++++++++++++++++++++++--
 1 file changed, 28 insertions(+), 2 deletions(-)

diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst
index 9788b19f9ff7..5bd151b601b4 100644
--- a/Documentation/virt/kvm/api.rst
+++ b/Documentation/virt/kvm/api.rst
@@ -5163,8 +5163,11 @@ KVM_PV_ENABLE
 KVM_PV_DISABLE
   Deregister the VM from the Ultravisor and reclaim the memory that
   had been donated to the Ultravisor, making it usable by the kernel
-  again.  All registered VCPUs are converted back to non-protected
-  ones.
+  again. All registered VCPUs are converted back to non-protected
+  ones. If a previous VM had been set aside for asynchonous teardown
+  with KVM_PV_ASYNC_CLEANUP_PREPARE and not actually torn down with
+  KVM_PV_ASYNC_CLEANUP_PERFORM, it will be torn down in this call
+  together with the current VM.
 
 KVM_PV_VM_SET_SEC_PARMS
   Pass the image header from VM memory to the Ultravisor in
@@ -5287,6 +5290,29 @@ KVM_PV_DUMP
     authentication tag all of which are needed to decrypt the dump at a
     later time.
 
+KVM_PV_ASYNC_CLEANUP_PREPARE
+  Prepare the current protected VM for asynchronous teardown. Most
+  resources used by the current protected VM will be set aside for a
+  subsequent asynchronous teardown. The current protected VM will then
+  resume execution immediately as non-protected. There can be at most
+  one protected VM set aside at any time. If a protected VM had
+  already been set aside without starting the asynchronous teardown
+  process, this call will fail. In that case, the userspace process
+  should issue a normal KVM_PV_DISABLE. The resources set aside with
+  this call will need to be cleaned up with a subsequent call to
+  KVM_PV_ASYNC_CLEANUP_PERFORM or KVM_PV_DISABLE, otherwise they will
+  be cleaned up when KVM terminates.
+
+KVM_PV_ASYNC_CLEANUP_PERFORM
+  Tear down the protected VM previously set aside with
+  KVM_PV_ASYNC_CLEANUP_PREPARE. The resources that had been set aside
+  will be freed during the execution of this command. This PV command
+  should ideally be issued by userspace from a separate thread. If a
+  fatal signal is received (or the process terminates naturally), the
+  command will terminate immediately without completing, and the normal
+  KVM shutdown procedure will take care of cleaning up all remaining
+  protected VMs.
+
 
 4.126 KVM_X86_SET_MSR_FILTER
 ----------------------------
-- 
2.37.1


  parent reply	other threads:[~2022-08-10 12:57 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-10 12:56 [PATCH v13 0/6] KVM: s390: pv: implement lazy destroy for reboot Claudio Imbrenda
2022-08-10 12:56 ` [PATCH v13 1/6] KVM: s390: pv: asynchronous " Claudio Imbrenda
2022-08-11 16:26   ` Janosch Frank
2022-08-12 14:02     ` Claudio Imbrenda
2022-08-12 11:16   ` Nico Boehr
2022-08-10 12:56 ` Claudio Imbrenda [this message]
2022-08-19  9:33   ` [PATCH v13 2/6] KVM: s390: pv: api documentation for asynchronous destroy Janosch Frank
2022-08-10 12:56 ` [PATCH v13 3/6] KVM: s390: pv: add KVM_CAP_S390_PROTECTED_ASYNC_DISABLE Claudio Imbrenda
2022-08-10 12:56 ` [PATCH v13 4/6] KVM: s390: pv: avoid export before import if possible Claudio Imbrenda
2022-08-19  9:50   ` Janosch Frank
2022-08-10 12:56 ` [PATCH v13 5/6] KVM: s390: pv: support for Destroy fast UVC Claudio Imbrenda
2022-08-12 12:56   ` Nico Boehr
2022-08-19 10:01   ` Janosch Frank
2022-08-10 12:56 ` [PATCH v13 6/6] KVM: s390: pv: module parameter to fence asynchronous destroy Claudio Imbrenda

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220810125625.45295-3-imbrenda@linux.ibm.com \
    --to=imbrenda@linux.ibm.com \
    --cc=borntraeger@de.ibm.com \
    --cc=david@redhat.com \
    --cc=frankja@linux.ibm.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=nrb@linux.ibm.com \
    --cc=pasic@linux.ibm.com \
    --cc=scgl@linux.ibm.com \
    --cc=seiden@linux.ibm.com \
    --cc=thuth@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.