From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5A556C4167B for ; Thu, 10 Mar 2022 10:32:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241274AbiCJKdo (ORCPT ); Thu, 10 Mar 2022 05:33:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57904 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241308AbiCJKdD (ORCPT ); Thu, 10 Mar 2022 05:33:03 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 604E513DE3C; Thu, 10 Mar 2022 02:32:03 -0800 (PST) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 22A93Ves026162; Thu, 10 Mar 2022 10:32:03 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=pyu4O5lMMU/BUfHgswvm5ffmgsd3h8dI5XjfpWkeku4=; b=FlsoposKHRO1GPiOe4W2W+p3w/iYQppz1nZIPRSzGt0Vmo1bLWdL8Sd4yUAaKjo3cErm m0x8E+nJNrjGIiSZG34IIHcOv6eFp7eUg/7bxVuaJxabQDjTKr8FfiSu5OrONorHBVTs YWr+IoYQX47c8k+17imCRblHlT2NUCmwPKQvzJ0W5s5xQB5DkeRMELzHOVpw3E4dg1cH YR7hkK2/Uuxc/ggUWShK1WwOWtOJ6YEYaDY+VVEjgqyCOzpj7DJlybdqcCCVzbAqfsxe liA+pICC09tdtFd0Zku1M86wRl2pUrdUDNGWd5ktiNNzhFtPWrSLsJsc5E21vlYc9e7y JQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3eq7xm0ugc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Mar 2022 10:32:02 +0000 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 22AAS7Le011763; Thu, 10 Mar 2022 10:32:02 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 3eq7xm0ue0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Mar 2022 10:32:02 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 22AAL1D9030518; Thu, 10 Mar 2022 10:31:53 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma03ams.nl.ibm.com with ESMTP id 3ekyg94aba-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Mar 2022 10:31:52 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 22AAVn0X41615840 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 10 Mar 2022 10:31:49 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C242E52050; Thu, 10 Mar 2022 10:31:49 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 32C4C5204F; Thu, 10 Mar 2022 10:31:49 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, david@redhat.com, borntraeger@linux.ibm.com Subject: [PATCH v2 8/9] Documentation: virt: Protected virtual machine dumps Date: Thu, 10 Mar 2022 10:31:11 +0000 Message-Id: <20220310103112.2156-9-frankja@linux.ibm.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220310103112.2156-1-frankja@linux.ibm.com> References: <20220310103112.2156-1-frankja@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: X7XVqWv63MnU_xN-HiMG5xNFAuPhx6c- X-Proofpoint-ORIG-GUID: TuUaY5mJtKud26_1olcj_PFt8gvQIS6p X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.816,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-03-10_03,2022-03-09_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 bulkscore=0 spamscore=0 phishscore=0 malwarescore=0 adultscore=0 clxscore=1015 priorityscore=1501 impostorscore=0 mlxscore=0 suspectscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2203100056 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Let's add a documentation file which describes the dump process. Since we only copy the UV dump data from the UV to userspace we'll not go into detail here and let the party which processes the data describe its structure. Signed-off-by: Janosch Frank --- Documentation/virt/kvm/index.rst | 1 + Documentation/virt/kvm/s390-pv-dump.rst | 60 +++++++++++++++++++++++++ 2 files changed, 61 insertions(+) create mode 100644 Documentation/virt/kvm/s390-pv-dump.rst diff --git a/Documentation/virt/kvm/index.rst b/Documentation/virt/kvm/index.rst index b6833c7bb474..32f3eed5fadb 100644 --- a/Documentation/virt/kvm/index.rst +++ b/Documentation/virt/kvm/index.rst @@ -20,6 +20,7 @@ KVM s390-diag s390-pv s390-pv-boot + s390-pv-dump timekeeping vcpu-requests diff --git a/Documentation/virt/kvm/s390-pv-dump.rst b/Documentation/virt/kvm/s390-pv-dump.rst new file mode 100644 index 000000000000..6fe7560e10b1 --- /dev/null +++ b/Documentation/virt/kvm/s390-pv-dump.rst @@ -0,0 +1,60 @@ +.. SPDX-License-Identifier: GPL-2.0 + +=========================================== +s390 (IBM Z) Protected Virtualization dumps +=========================================== + +Summary +------- + +Dumping a VM is an essential tool for debugging problems inside +it. This is especially true when a protected VM runs into trouble as +there's no way to access its memory and registers from the outside +while it's running. + +However when dumping a protected VM we need to maintain its +confidentiality until the dump is in the hands of the VM owner who +should be the only one capable of analysing it. + +The confidentiality of the VM dump is ensured by the Ultravisor who +provides an interface to KVM over which encrypted CPU and memory data +can be requested. The encryption is based on the Customer +Communication Key which is the key that's used to encrypt VM data in a +way that the customer is able to decrypt. + + +Dump process +------------ + +A dump is done in 3 steps: + +Initiation +This step initializes the dump process, generates cryptographic seeds +and extracts dump keys with which the VM dump data will be encrypted. + +Data gathering +Currently there are two types of data that can be gathered from a VM: +the memory and the vcpu state. + +The vcpu state contains all the important registers, general, floating +point, vector, control and tod/timers of a vcpu. The vcpu dump can +contain incomplete data if a vcpu is dumped while an instruction is +emulated with help of the hypervisor. This is indicated by a flag bit +in the dump data. For the same reason it is very important to not only +write out the encrypted vcpu state, but also the unencrypted state +from the hypervisor. + +The memory state is further divided into the encrypted memory and its +encryption tweaks / status flags. The encrypted memory can simply be +read once it has been exported. The time of the export does not matter +as no re-encryption is needed. Memory that has been swapped out and +hence was exported can be read from the swap and written to the dump +target without need for any special actions. + +The tweaks / status flags for the exported pages need to be requested +from the Ultravisor. + +Finalization +The finalization step will provide the data needed to be able to +decrypt the vcpu and memory data and end the dump process. When this +step completes successfully a new dump initiation can be started. -- 2.32.0