Received: by 2002:a05:7412:798b:b0:fc:a2b0:25d7 with SMTP id fb11csp870361rdb; Fri, 23 Feb 2024 02:42:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUBhS8eg2m28ohgzOfNTmvG0nIvebbGL+rl3NaZSectRCzi/wkTHcMXRQSPcENEaxNJQHXgsjKCABq2WPRaRhM1iLODHJXVXnAxHiyC5w== X-Google-Smtp-Source: AGHT+IHusOQyRP5m2seaY48KmY27MzRCc+TJm79pRkZ4oGsrnmvZRKbnzFjvTPq+yySXZu8cJlp4 X-Received: by 2002:a17:906:26ca:b0:a3e:876d:1b1 with SMTP id u10-20020a17090626ca00b00a3e876d01b1mr956866ejc.20.1708684963135; Fri, 23 Feb 2024 02:42:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708684963; cv=pass; d=google.com; s=arc-20160816; b=n5nDXWbSHnPuBuN+dLTGzMz421w/4fBQSeu3NhZ6SYjAs2HQL9UUEvmeWDVpd13JI/ LDG+cuSonNPdmc1yxG3up3T1Paa0qVsYBMTSY4IUh3ZNr99NSm4azY2C/nIkYg4rZ17M fOCI4MscsSHIuEHRueA3aLK6taYoBhSzcSsHe6ykxucVf5dHnija2PfM8mMlSpQyuNxM k0jg/okHc6feDmfNRDMeTVg6ziq6aqVdERHQHw0QphqZb1CR9CBnsFNknmj/qPpwlFmI bg5wcXu4M/wSqaI6TQAewIEbA5AW16A29wKctleUUk9ZATeeCEjz0T+Yx9QU4G2D52Ls YL5Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=HNd1RWFfxP99GP5p/jumFBlLTjGZdI0OBikpCrKysX4=; fh=TLdZJsFzSA0fpm6Q4iUv+uB0sG0oU+h3Bp6HiSGyZm8=; b=bk1Q371Muszq1VUVIsIrqP+AXb8OMFKk027yQlh5gVd89bpYCQAr09k3FEVmbW5EIn 3TYsrQNKcRdFtNS1yI1KL6C1RX2tuh88IgxJ1yoeJvYet10/9/5NoFl4I09ls22RN+1x W/yWPBqE5vTiNIjxLnd2AL4MBNQtKunvM+Lbwoh3A6D5dOan1gMxb6XdFW40+22NvHKp 2TGxooNG7LvWrv0PMhZvghQN2sWcVo5t/cDQZOBq8Vboc6YRnUtIdZsvjrh/mIzFzlQ+ lNzRw62rEsPoeBG5p55i8CmjC8rQLoGzlkDghFMq97xv+x09Y+gvGy+k1lt5spuc7qtb dxQg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="TEJo/+xj"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-78157-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78157-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id ho34-20020a1709070ea200b00a3edad2d5f7si3764421ejc.601.2024.02.23.02.42.43 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 23 Feb 2024 02:42:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-78157-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="TEJo/+xj"; arc=pass (i=1 spf=pass spfdomain=redhat.com dkim=pass dkdomain=redhat.com dmarc=pass fromdomain=redhat.com); spf=pass (google.com: domain of linux-kernel+bounces-78157-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-78157-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 3EAAC1F21861 for ; Fri, 23 Feb 2024 10:42:11 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 3D71C7C08D; Fri, 23 Feb 2024 10:40:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="TEJo/+xj" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 854F078B7E for ; Fri, 23 Feb 2024 10:40:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.133.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708684819; cv=none; b=VHrw7iUmuROQa2irzTEBaiIVY+6oTx540u5DMUDMXpM7CTCfpwgVCSeZXz8gJy9TmNcv+5678TIAaP6aVPWvNvPaemELhs4WsAA5iKxmi97uJuApeYB/09IzNaBZc/0Fk/H3ouxdmSZDOriqt1yF57fSOjLx2U2z2iIOkLVzMRU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708684819; c=relaxed/simple; bh=mdeBdatCKk8Xzj5nvfbu+cmRuDDMrfl3wd3KLsml9bc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=eu7BXyH4wPra3S3oWHN/JijHV2UTZsC03YLvYYhRYe14HqObcb+qyrdgvhhXsrLEehSbHAbDU8sAJVbUkc0id7xfZWGyBM+TwXF3ok107l+t3hFcrCblSMN+FMW/ufWzLTDR/fcTRbZ08fNZBRpQIDUg43VHmOQmxaQvW6p12Fo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b=TEJo/+xj; arc=none smtp.client-ip=170.10.133.124 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1708684816; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=HNd1RWFfxP99GP5p/jumFBlLTjGZdI0OBikpCrKysX4=; b=TEJo/+xjlz3F4obG2Ic25FS16NYtOiFQMSTD8W93C+bc4ugwCDF5wVdPGzh18AkqsVGbIM hv6g7ipQXnHv1C8azOuOOMmmaQW6phx1p5nDfMInlmzVxZ+LxKL8iqEioD5YYN0V0/c0wH 995r6SzGeWQcjG2lCbY7f03stn4KdYA= Received: from mimecast-mx02.redhat.com (mx-ext.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-650-UfgFwcO_Nsuq-cLNup0YLg-1; Fri, 23 Feb 2024 05:40:11 -0500 X-MC-Unique: UfgFwcO_Nsuq-cLNup0YLg-1 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 061A21C068D1; Fri, 23 Feb 2024 10:40:11 +0000 (UTC) Received: from virtlab701.virt.lab.eng.bos.redhat.com (virtlab701.virt.lab.eng.bos.redhat.com [10.19.152.228]) by smtp.corp.redhat.com (Postfix) with ESMTP id D292F112132A; Fri, 23 Feb 2024 10:40:10 +0000 (UTC) From: Paolo Bonzini To: linux-kernel@vger.kernel.org, kvm@vger.kernel.org Cc: seanjc@google.com, michael.roth@amd.com, aik@amd.com Subject: [PATCH v2 03/11] Documentation: kvm/sev: separate description of firmware Date: Fri, 23 Feb 2024 05:40:01 -0500 Message-Id: <20240223104009.632194-4-pbonzini@redhat.com> In-Reply-To: <20240223104009.632194-1-pbonzini@redhat.com> References: <20240223104009.632194-1-pbonzini@redhat.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain Content-Transfer-Encoding: 8bit X-Scanned-By: MIMEDefang 3.4.1 on 10.11.54.3 The description of firmware is included part under the "SEV Key Management" header, part under the KVM_SEV_INIT ioctl. Put these two bits together and and rename "SEV Key Management" to what it actually is, namely a description of the KVM_MEMORY_ENCRYPT_OP API. Signed-off-by: Paolo Bonzini Message-Id: <20240209183743.22030-4-pbonzini@redhat.com> Reviewed-by: Michael Roth Signed-off-by: Paolo Bonzini --- .../virt/kvm/x86/amd-memory-encryption.rst | 29 +++++++++++-------- 1 file changed, 17 insertions(+), 12 deletions(-) diff --git a/Documentation/virt/kvm/x86/amd-memory-encryption.rst b/Documentation/virt/kvm/x86/amd-memory-encryption.rst index 995780088eb2..37c5c37f4f6e 100644 --- a/Documentation/virt/kvm/x86/amd-memory-encryption.rst +++ b/Documentation/virt/kvm/x86/amd-memory-encryption.rst @@ -46,14 +46,8 @@ SEV hardware uses ASIDs to associate a memory encryption key with a VM. Hence, the ASID for the SEV-enabled guests must be from 1 to a maximum value defined in the CPUID 0x8000001f[ecx] field. -SEV Key Management -================== - -The SEV guest key management is handled by a separate processor called the AMD -Secure Processor (AMD-SP). Firmware running inside the AMD-SP provides a secure -key management interface to perform common hypervisor activities such as -encrypting bootstrap code, snapshot, migrating and debugging the guest. For more -information, see the SEV Key Management spec [api-spec]_ +``KVM_MEMORY_ENCRYPT_OP`` API +============================= The main ioctl to access SEV is KVM_MEMORY_ENCRYPT_OP. If the argument to KVM_MEMORY_ENCRYPT_OP is NULL, the ioctl returns 0 if SEV is enabled @@ -87,10 +81,6 @@ guests, such as launching, running, snapshotting, migrating and decommissioning. The KVM_SEV_INIT command is used by the hypervisor to initialize the SEV platform context. In a typical workflow, this command should be the first command issued. -The firmware can be initialized either by using its own non-volatile storage or -the OS can manage the NV storage for the firmware using the module parameter -``init_ex_path``. If the file specified by ``init_ex_path`` does not exist or -is invalid, the OS will create or override the file with output from PSP. Returns: 0 on success, -negative on error @@ -434,6 +424,21 @@ issued by the hypervisor to make the guest ready for execution. Returns: 0 on success, -negative on error +Firmware Management +=================== + +The SEV guest key management is handled by a separate processor called the AMD +Secure Processor (AMD-SP). Firmware running inside the AMD-SP provides a secure +key management interface to perform common hypervisor activities such as +encrypting bootstrap code, snapshot, migrating and debugging the guest. For more +information, see the SEV Key Management spec [api-spec]_ + +The AMD-SP firmware can be initialized either by using its own non-volatile +storage or the OS can manage the NV storage for the firmware using +parameter ``init_ex_path`` of the ``ccp`` module. If the file specified +by ``init_ex_path`` does not exist or is invalid, the OS will create or +override the file with PSP non-volatile storage. + References ========== -- 2.39.1