Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp891106rwi; Mon, 10 Oct 2022 08:28:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM670e/gHT0K92wWkrBM0v7R0yJvrhal+0LmxxfGXQvfZ2bswzXlRN1Ckcvfm/1DM3nrZxIF X-Received: by 2002:a17:906:8447:b0:78d:776f:c544 with SMTP id e7-20020a170906844700b0078d776fc544mr13354939ejy.405.1665415715473; Mon, 10 Oct 2022 08:28:35 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665415715; cv=none; d=google.com; s=arc-20160816; b=qnMnJy6eWqVCJL9NSvp7oYLh8FQ819DPoGlKyoKcpAn4M6ICCdulf7qEl1SUX+HvEi 9TYDLK4pbN/FsM+cg7w0px5LQDEdFfJNaGuTqQCigOeTiaSY6sVI5OmewZp+0ofpkVCp XtPiZA81uS8tQirJfW/zjF8JXVvFhGAh7QnE7vRhVq1OxsP4FMgj0Cch3v42wOYbSjcO pXIaBRK7xuIEFOeBVrjSbC9CPR55/4oUPPIDJYsFoGZa5Zh9mf8J4OMzzddqKpL0fbqN D+GrMF+X/6dj5FCdDL1LVL0EMhnRITqOt5dGskrhD9Es/91Gu9ebEcwlD+ZloROmtP9T 3Chg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=MfYGOe8P0yg9cRGZVtO83pLACXEpdNizSPoag0mslh8=; b=v4018a+GYU5m3zGkR4IJiN6sgM4ks46QkF13yiV8LVXUJqvjfNotaJyyq3niU0CkWB EPTxTNqEdEUw0e8oILHlZV7xE6HgnaXX/Yyi3yBGKPTbyN1x6A7Hn4rD/yYod9pGxLmP wHFAz9MkIwG6cUrb/MAOSeu3v/WdxiekyBpBiv6w+x92CyZK9+vnMnw5Nz885mG03KR8 dMdj6WuaMF9Moz1UwKNd9H8gtvHJcGmxkWMn7Kw2RWgXhPKETsbff6sgBAgAF/88igOO BLfbKTl5nbK64d1iG8fuvmzAyDdLkGxxQZ6Z1HndB82dF8G5nzeBtmaEExgNp27VNUZe D1AA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=Jn+Z2s4h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id dr20-20020a170907721400b007879808e995si10750864ejc.55.2022.10.10.08.28.08; Mon, 10 Oct 2022 08:28:35 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=Jn+Z2s4h; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229965AbiJJOzN (ORCPT + 99 others); Mon, 10 Oct 2022 10:55:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229920AbiJJOyy (ORCPT ); Mon, 10 Oct 2022 10:54:54 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3233D167D8; Mon, 10 Oct 2022 07:54:51 -0700 (PDT) Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29AEb4p7020862; Mon, 10 Oct 2022 14:54:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=MfYGOe8P0yg9cRGZVtO83pLACXEpdNizSPoag0mslh8=; b=Jn+Z2s4hmkfHDtaZv8BLpVFWZ7ROVsGzubE2RPK6/XICiaO/DzL8bcdKXuGxf26pkAjA GXSrFjE1LheGHaeGT82W/ANC95+VPnYh0MZrOmjg77HKN5GjmnQ4Nb7d/T/9A64ukeng QieJp9cJXM0WqqqMm+HXCnSikWmIVT9tIk3n3a0C9HYRQlpqwzBhMnu6XXhwASeUvtee tCSk4C+0kO9gAau++dAYs4ic2rFlLkEZqMYeJXHSpz1GQ5I6jy+8Dybf7XUdRrJpNPh1 bIN7mF7DsoYRNOEdN3uoVAfjNl/BEqiTvzKbkyeYf2FXaGNest3IzsJW1sgQwWvizzPv MQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3k3jhbfatx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Oct 2022 14:54:50 +0000 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 29AEoVW1028362; Mon, 10 Oct 2022 14:54:50 GMT Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3k3jhbfasa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Oct 2022 14:54:50 +0000 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 29AErPDv004601; Mon, 10 Oct 2022 14:54:47 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma02fra.de.ibm.com with ESMTP id 3k30u926d7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 Oct 2022 14:54:46 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 29AEsh7265798468 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 Oct 2022 14:54:43 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CC7275204F; Mon, 10 Oct 2022 14:54:43 +0000 (GMT) Received: from p-imbrenda.boeblingen.de.ibm.com (unknown [9.152.224.242]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 80C9D52052; Mon, 10 Oct 2022 14:54:43 +0000 (GMT) From: Claudio Imbrenda To: kvm@vger.kernel.org Cc: borntraeger@de.ibm.com, frankja@linux.ibm.com, thuth@redhat.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 v15 2/6] KVM: s390: pv: api documentation for asynchronous destroy Date: Mon, 10 Oct 2022 16:54:38 +0200 Message-Id: <20221010145442.85867-3-imbrenda@linux.ibm.com> X-Mailer: git-send-email 2.37.3 In-Reply-To: <20221010145442.85867-1-imbrenda@linux.ibm.com> References: <20221010145442.85867-1-imbrenda@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: EtqKD8DagwjQbU_w0xhvsLCNQsuzBZqM X-Proofpoint-ORIG-GUID: KYdZhQfdrgaI_rl2HcrBSFu7XFT-o2YU X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-10-10_08,2022-10-10_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 spamscore=0 phishscore=0 adultscore=0 impostorscore=0 suspectscore=0 clxscore=1015 mlxscore=0 lowpriorityscore=0 malwarescore=0 mlxlogscore=999 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210100086 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add documentation for the new commands added to the KVM_S390_PV_COMMAND ioctl. Signed-off-by: Claudio Imbrenda Reviewed-by: Nico Boehr Reviewed-by: Steffen Eiden Reviewed-by: Janosch Frank --- Documentation/virt/kvm/api.rst | 37 ++++++++++++++++++++++++++++++---- 1 file changed, 33 insertions(+), 4 deletions(-) diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst index abd7c32126ce..5775e5fbfd18 100644 --- a/Documentation/virt/kvm/api.rst +++ b/Documentation/virt/kvm/api.rst @@ -5161,10 +5161,13 @@ 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. + 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. If a + previous protected VM had been prepared for asynchonous teardown with + KVM_PV_ASYNC_CLEANUP_PREPARE and not subsequently torn down with + KVM_PV_ASYNC_CLEANUP_PERFORM, it will be torn down in this call + together with the current protected VM. KVM_PV_VM_SET_SEC_PARMS Pass the image header from VM memory to the Ultravisor in @@ -5287,6 +5290,32 @@ 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 prepared for asynchronous teardown at any time. If + a protected VM had already been prepared for teardown without + subsequently calling KVM_PV_ASYNC_CLEANUP_PERFORM, 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_PREPARE can be called again as soon + as cleanup starts, i.e. before KVM_PV_ASYNC_CLEANUP_PERFORM finishes. + +KVM_PV_ASYNC_CLEANUP_PERFORM + Tear down the protected VM previously prepared for teardown 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, including the ones whose teardown was interrupted by + process termination. + 4.126 KVM_X86_SET_MSR_FILTER ---------------------------- -- 2.37.3