Received: by 2002:a05:7412:3b8b:b0:fc:a2b0:25d7 with SMTP id nd11csp1130327rdb; Fri, 9 Feb 2024 11:07:43 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCVbrHvkTOgpgYSKsHv1e9ecG4twS9tZw4HUaWTJgMbj0UG8i9PmyhvWRNTzkBawEZcYv1PTpzOdflVeFc+j7y+duDdjox3vsIjrUreHMQ== X-Google-Smtp-Source: AGHT+IFUHyEtYsJCM3732Coh7rcvYqvLV67PWMZcONbPi4KS+GcDOYAXVsOgZyuj+lx2z5i0QYaL X-Received: by 2002:a62:b50d:0:b0:6df:e035:5549 with SMTP id y13-20020a62b50d000000b006dfe0355549mr196092pfe.15.1707505662945; Fri, 09 Feb 2024 11:07:42 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707505662; cv=pass; d=google.com; s=arc-20160816; b=kkTkTEXL1ky8/WvehF2iXymzgNA/JYSnFH0DetCFXeaSi1WAmVELZyG9IRWDjRuPKY 0GKRyTkrCscJGrPYNA58K1nqo2KigHN6uU1jDcG7VR0BFMuWbF4Sgm5jfeDn8IVmnOzw DE/iA33yOtLquo3Ic2GUhiXcnHh2OuBn8LTE5RrnL7x9VHybeamtxkf6mubkVKX+bhbq vLDlXydEBsgsLFo5Q5T7Xlr34hAABn6VJijfCO9omPhAKOrO4y4r75Y0vI0djDnGfCgr S3/5WHHJhzeTOMv3wOUDlmzYMQW73kMlfbuSGfrFWUboR8BBz2ZsplT62DNsTMTSXgR9 ufrA== 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=SAt/ASJDi0a9pG5VDkbDUypZizJmqJCKlEMTUVFDghU=; fh=QewFiFZdatmQ7nNPyDpr0AT51Yj5TMyNQ9l5GJxmF1o=; b=avJKcL7/W54MjK51ExIzC8RbPlNuY/ZSrCqRm9BBjrfJbHXtIDSgoXXGQ5x4A/PLr7 usGat+h6QW7QVnx3Ad8ZNDoPSNOd5C8rQ+qFOSCHOAuqIVY0eNd2TRTb87t6dDTqCyza vaJRQKZqB5+inBdc39A7VjqOf6p2XG/gQHRlPhRcmG4gQO8SFqutGrhhs2vt2oTDT3SR WIClmnHr25Br0tUlxuuC5zlpr2vnLPEuEuHFsCpmHhKeCWX0C8hvvW3EdvAg3PtwNcM/ fz2LEU2djhmPzrpSMbER/IMyyyYJTv65tZQHR/z0BibGSrYB1uVi86INfQTmRLDOnmEf VknA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bPZXsGBI; 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-59811-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59811-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com X-Forwarded-Encrypted: i=2; AJvYcCX6b3fxgsT3fFcHFqE2WLL0B1W5vr7annoh7qroEA/RjEtCDa26J6auhtwDOaEFJo+b2jLdERgNta4nCT6fgOJa6yjHcfJk0UrRO4o33g== Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id u62-20020a638541000000b005dc229b6778si2154514pgd.14.2024.02.09.11.07.42 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 09 Feb 2024 11:07:42 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-59811-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=bPZXsGBI; 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-59811-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-59811-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id CE96BB2A7CB for ; Fri, 9 Feb 2024 18:39:07 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 80F4D1272B9; Fri, 9 Feb 2024 18:37:53 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="bPZXsGBI" Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.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 A46887E774 for ; Fri, 9 Feb 2024 18:37:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=170.10.129.124 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707503872; cv=none; b=rkNvEcj+L9IOVxLJX7pmEQozw56Sn9VpDEXWAVWKdnDh9V+83uGSzVbSPjVSDKmhJ3Flkjq71O6ZAEpvfJsPiD+U5B2lhVmXT2zVTfc5F3k/U9+QNBL+55mXd9O6llWrAS8SE6QZKELaTaiIxFGK7bayLg2jLszDDPAWda4dICA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707503872; c=relaxed/simple; bh=tafaotKNTsqIVnZYPat0blc78aZKGHZ+FqJMJixoAWg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=BHP4ygfCZLyv0SOhis3HpZ1J5bAI1k0jTQx6XsDyRY3yHWPom3S68l8ShHt9XDV6rJEo0gwJvCJ/h9ZO0dkh9BXovbkW8wGcfSADgiiz3LRdyz8LvaFN29xWyD1NjdfISfPbZf2v1DnLm78Ajiet25m8xsKTUnDbB/eCnmOny7o= 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=bPZXsGBI; arc=none smtp.client-ip=170.10.129.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=1707503868; 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=SAt/ASJDi0a9pG5VDkbDUypZizJmqJCKlEMTUVFDghU=; b=bPZXsGBIHGjKZvmcvALir7hqBFaEo44PpcsRpFlEkhh9Bt/ocUXmE1WaLiqu+iiJPbugW4 eZUzAYRBkfy9tdxBMP3PCHj+GFLubyMXvCiKOZpCVB3/ylFoVcM1EP1qDPSUMe1qHdl+Gh EJGq35OjJ1HGpRrgyAN9YBtqsQDIKHk= Received: from mimecast-mx02.redhat.com (mimecast-mx02.redhat.com [66.187.233.88]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-29-9JF7XzGGOWaNQGZN9A13Pg-1; Fri, 09 Feb 2024 13:37:45 -0500 X-MC-Unique: 9JF7XzGGOWaNQGZN9A13Pg-1 Received: from smtp.corp.redhat.com (int-mx09.intmail.prod.int.rdu2.redhat.com [10.11.54.9]) (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 9149F185A784; Fri, 9 Feb 2024 18:37:44 +0000 (UTC) Received: from virtlab511.virt.lab.eng.bos.redhat.com (virtlab511.virt.lab.eng.bos.redhat.com [10.19.152.198]) by smtp.corp.redhat.com (Postfix) with ESMTP id 634D1492BC6; Fri, 9 Feb 2024 18:37:44 +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, isaku.yamahata@intel.com Subject: [PATCH 03/10] Documentation: kvm/sev: separate description of firmware Date: Fri, 9 Feb 2024 13:37:35 -0500 Message-Id: <20240209183743.22030-4-pbonzini@redhat.com> In-Reply-To: <20240209183743.22030-1-pbonzini@redhat.com> References: <20240209183743.22030-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.9 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 --- .../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.0