From patchwork Fri Feb 7 11:39:32 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Christian Borntraeger X-Patchwork-Id: 11370339 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8243B921 for ; Fri, 7 Feb 2020 11:40:57 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 6B2FE214AF for ; Fri, 7 Feb 2020 11:40:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727621AbgBGLky (ORCPT ); Fri, 7 Feb 2020 06:40:54 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:14552 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726861AbgBGLkG (ORCPT ); Fri, 7 Feb 2020 06:40:06 -0500 Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 017Bc34k171317; Fri, 7 Feb 2020 06:40:05 -0500 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 2y0mdxtqkg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 07 Feb 2020 06:40:04 -0500 Received: from m0098416.ppops.net (m0098416.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 017Be4nO185670; Fri, 7 Feb 2020 06:40:04 -0500 Received: from ppma02dal.us.ibm.com (a.bd.3ea9.ip4.static.sl-reverse.com [169.62.189.10]) by mx0b-001b2d01.pphosted.com with ESMTP id 2y0mdxtqk0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 07 Feb 2020 06:40:04 -0500 Received: from pps.filterd (ppma02dal.us.ibm.com [127.0.0.1]) by ppma02dal.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 017Bcl09026906; Fri, 7 Feb 2020 11:40:03 GMT Received: from b01cxnp22034.gho.pok.ibm.com (b01cxnp22034.gho.pok.ibm.com [9.57.198.24]) by ppma02dal.us.ibm.com with ESMTP id 2xykca1y7k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 07 Feb 2020 11:40:03 +0000 Received: from b01ledav006.gho.pok.ibm.com (b01ledav006.gho.pok.ibm.com [9.57.199.111]) by b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 017Be1pf42795406 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 7 Feb 2020 11:40:01 GMT Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5AF24AC059; Fri, 7 Feb 2020 11:40:01 +0000 (GMT) Received: from b01ledav006.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 412AEAC05E; Fri, 7 Feb 2020 11:40:01 +0000 (GMT) Received: from localhost.localdomain (unknown [9.114.17.106]) by b01ledav006.gho.pok.ibm.com (Postfix) with ESMTP; Fri, 7 Feb 2020 11:40:01 +0000 (GMT) From: Christian Borntraeger To: Christian Borntraeger , Janosch Frank Cc: KVM , Cornelia Huck , David Hildenbrand , Thomas Huth , Ulrich Weigand , Claudio Imbrenda , Andrea Arcangeli , linux-s390 , Michael Mueller , Vasily Gorbik , Janosch Frank Subject: [PATCH 09/35] KVM: s390: protvirt: Add KVM api documentation Date: Fri, 7 Feb 2020 06:39:32 -0500 Message-Id: <20200207113958.7320-10-borntraeger@de.ibm.com> X-Mailer: git-send-email 2.24.0 In-Reply-To: <20200207113958.7320-1-borntraeger@de.ibm.com> References: <20200207113958.7320-1-borntraeger@de.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.138,18.0.572 definitions=2020-02-07_01:2020-02-07,2020-02-06 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxlogscore=999 spamscore=0 adultscore=0 mlxscore=0 clxscore=1015 malwarescore=0 priorityscore=1501 phishscore=0 suspectscore=0 bulkscore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2001150001 definitions=main-2002070089 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Janosch Frank Add documentation for KVM_CAP_S390_PROTECTED capability and the KVM_S390_PV_COMMAND and KVM_S390_PV_COMMAND_VCPU ioctls. Signed-off-by: Janosch Frank [borntraeger@de.ibm.com: patch merging, splitting, fixing] Signed-off-by: Christian Borntraeger --- Documentation/virt/kvm/api.txt | 61 ++++++++++++++++++++++++++++++++++ 1 file changed, 61 insertions(+) diff --git a/Documentation/virt/kvm/api.txt b/Documentation/virt/kvm/api.txt index 73448764f544..4874d42286ca 100644 --- a/Documentation/virt/kvm/api.txt +++ b/Documentation/virt/kvm/api.txt @@ -4204,6 +4204,60 @@ the clear cpu reset definition in the POP. However, the cpu is not put into ESA mode. This reset is a superset of the initial reset. +4.125 KVM_S390_PV_COMMAND + +Capability: KVM_CAP_S390_PROTECTED +Architectures: s390 +Type: vm ioctl +Parameters: struct kvm_pv_cmd +Returns: 0 on success, < 0 on error + +struct kvm_pv_cmd { + __u32 cmd; /* Command to be executed */ + __u16 rc; /* Ultravisor return code */ + __u16 rrc; /* Ultravisor return reason code */ + __u64 data; /* Data or address */ +}; + +cmd values: +KVM_PV_VM_CREATE +Allocate memory and register the VM with the Ultravisor, thereby +donating memory to the Ultravisor making it inaccessible to KVM. + +KVM_PV_VM_DESTROY +Deregisters the VM from the Ultravisor and frees memory that was +donated, so the kernel can use it again. All registered VCPUs have to +be unregistered beforehand and all memory has to be exported or +shared. + +KVM_PV_VM_SET_SEC_PARMS +Pass the image header from VM memory to the Ultravisor in preparation +of image unpacking and verification. + +KVM_PV_VM_UNPACK +Unpack (protect and decrypt) a page of the encrypted boot image. + +KVM_PV_VM_VERIFY +Verify the integrity of the unpacked image. Only if this succeeds, KVM +is allowed to start protected VCPUs. + +4.126 KVM_S390_PV_COMMAND_VCPU + +Capability: KVM_CAP_S390_PROTECTED +Architectures: s390 +Type: vcpu ioctl +Parameters: struct kvm_pv_cmd +Returns: 0 on success, < 0 on error + +cmd values: +KVM_PV_VCPU_CREATE +Allocate memory and register a VCPU with the Ultravisor, thereby +donating memory to the Ultravisor making it inaccessible to KVM. + +KVM_PV_VCPU_DESTROY +Unregisters the VCPU from the Ultravisor and frees memory that was +donated, so the kernel can use it again. + 5. The kvm_run structure ------------------------ @@ -5439,3 +5493,10 @@ Architectures: s390 This capability indicates that the KVM_S390_NORMAL_RESET and KVM_S390_CLEAR_RESET ioctls are available. + +8.23 KVM_CAP_S390_PROTECTED + +Architecture: s390 + +This capability indicates that KVM can start protected VMs and the +Ultravisor has therefore been initialized.