From patchwork Fri Nov 11 17:06:28 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Claudio Imbrenda X-Patchwork-Id: 18915 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp863238wru; Fri, 11 Nov 2022 09:09:23 -0800 (PST) X-Google-Smtp-Source: AA0mqf6yJ/xdVzKQslAiXURrvvHqKJzFPiyuHaGTg6jWwpPrav/a5f0qQfvpF7u6T5BeUuDJujGU X-Received: by 2002:a17:90b:d86:b0:213:5dd:f523 with SMTP id bg6-20020a17090b0d8600b0021305ddf523mr2875840pjb.63.1668186562544; Fri, 11 Nov 2022 09:09:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668186562; cv=none; d=google.com; s=arc-20160816; b=PXJB6D8utSm/affPXG2lYw6y40djlwdyQI3wGSkAcV5jeS6b7vQ1Ha5KAhTDWjXeeZ b4BKaDmBPfAFQQzs4Fk5epYaL5AFQBzyzXZfwxz6Zj3M4O5pdywr+fio7kthhx6YpoV7 rGD7IfUcNpArYykTs/CI7rGx0nBVGGxIhR5G8B69E0wZL5HcQIqiP4j2ZEAmaNwd2lRm tgmUwVR1EMHmzXIHoEFhHTUpOzBD+o9lIh4uAG9mKreu8bX/Y+MC5KzYbR4Qmj3aIy7I 1FXU3XSncc74N7X/ZiexzxzUVONYYcQ2VR3m31v4PmSeAp42KhTzq2SRmlJpf9AnhLTu fYCQ== 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=Kt5iBuHvmiPQOHPJcw45GaWZmjl/3eupPWDl+qKrt7Q=; b=O7sqLCiRQ1VNlisDdaxVcK20h82w9WW10xYiAT2GrPujr8SAFn/v6jwE0qsH/CRoTz lPDzc9cooMVipKgv/RSoiIpjXragLzAA17/7A4oVME3lQ1BnPZP6trneJ05zZAklAOJF 2r+5gVt3xUWSWIIckppuMdzaOc4fUuZY/XJ9JgD6IpTbcY+2GfrDYeWH8tPK/x0tal6F hy/IhjWQ9xNVi8JsSzgtAG5qpAoGkT9EbdmR6xcfXWE8ZW2EllZeiOQARwCr1WV5u95P AEXNnH6cvbl6KzuX6TaNreKGzwbXwW7dHgLrOlnr0jiwob4EzU0e+ZmF2FKgQtjz98KD U+Vw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=Z242fP4u; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id na16-20020a17090b4c1000b00213959f5a91si9161641pjb.2.2022.11.11.09.09.08; Fri, 11 Nov 2022 09:09:22 -0800 (PST) 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=Z242fP4u; 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 S234115AbiKKRG7 (ORCPT + 99 others); Fri, 11 Nov 2022 12:06:59 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233553AbiKKRGs (ORCPT ); Fri, 11 Nov 2022 12:06:48 -0500 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CD34729A8; Fri, 11 Nov 2022 09:06:46 -0800 (PST) Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 2ABGi6Na022130; Fri, 11 Nov 2022 17:06:45 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=Kt5iBuHvmiPQOHPJcw45GaWZmjl/3eupPWDl+qKrt7Q=; b=Z242fP4uAPXD0WAkEAMZiIDyNfaxQoUNaxk+1Ulu9Jur/YEcabhCH+JqwExJYHUAgxDc 615qo0RBff7m6A/srDDk3UQxdY7b9KJQdOFdJ4udGLoJA8S0xdGx5YPks0YgJ5NcVZrs yRlFyoCn6S4Ay8Zec/pA00q4vawAo/ZX2I8Er0FfnGUYsm91DKwbNwfIcrV20djNvb+M WiR5iKd/LHTKrIDq2OZDdyNvY2WCCuZw+rGS9/FpBQTd1LL0f2TKDVO6n5S/C1AFFb7S ovY4MuwloD+ZOA+X1w/rXm3CKx3W1IHhWA8sGjRdb5iDMqtYMIsasplNKYBuy4vm/uqt Sg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3kst5wghmr-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Nov 2022 17:06:45 +0000 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2ABGjbL6025855; Fri, 11 Nov 2022 17:06:44 GMT Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3kst5wghkb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Nov 2022 17:06:44 +0000 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2ABH6NHu031600; Fri, 11 Nov 2022 17:06:42 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma05fra.de.ibm.com with ESMTP id 3krcbr2car-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 11 Nov 2022 17:06:42 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2ABH6dmb60817736 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 11 Nov 2022 17:06:39 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 60E2E4C04E; Fri, 11 Nov 2022 17:06:39 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D35C04C040; Fri, 11 Nov 2022 17:06:38 +0000 (GMT) Received: from localhost.localdomain (unknown [9.171.65.74]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Fri, 11 Nov 2022 17:06:38 +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 v16 2/6] KVM: s390: pv: api documentation for asynchronous destroy Date: Fri, 11 Nov 2022 18:06:28 +0100 Message-Id: <20221111170632.77622-3-imbrenda@linux.ibm.com> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221111170632.77622-1-imbrenda@linux.ibm.com> References: <20221111170632.77622-1-imbrenda@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: gm5U7jm0hEf8K-SaSSvi9BVhpAFnNY1P X-Proofpoint-ORIG-GUID: MFJVpO3E4Or6x9ikrRlNN5V7v5qP5y5i X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-11_08,2022-11-11_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 adultscore=0 mlxlogscore=999 lowpriorityscore=0 bulkscore=0 malwarescore=0 priorityscore=1501 mlxscore=0 suspectscore=0 spamscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211110115 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749220392982510972?= X-GMAIL-MSGID: =?utf-8?q?1749220392982510972?= 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 | 41 ++++++++++++++++++++++++++++++---- 1 file changed, 37 insertions(+), 4 deletions(-) diff --git a/Documentation/virt/kvm/api.rst b/Documentation/virt/kvm/api.rst index eee9f857a986..9175d41e8081 100644 --- a/Documentation/virt/kvm/api.rst +++ b/Documentation/virt/kvm/api.rst @@ -5163,10 +5163,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 @@ -5289,6 +5292,36 @@ KVM_PV_DUMP authentication tag all of which are needed to decrypt the dump at a later time. +KVM_PV_ASYNC_CLEANUP_PREPARE + :Capability: KVM_CAP_S390_PROTECTED_ASYNC_DISABLE + + 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 + :Capability: KVM_CAP_S390_PROTECTED_ASYNC_DISABLE + + 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_XEN_HVM_SET_ATTR --------------------------