Received: by 2002:a05:7208:9594:b0:7e:5202:c8b4 with SMTP id gs20csp1497022rbb; Mon, 26 Feb 2024 11:04:54 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUbq00yZHtK0EqcLiNY75AEB4/SVvX0P0Yj9xIR1857U9VztBrQmI2YQsknjDWIl9a8bbb468k+gw5mEj/hQ/oQaouyK+ABRgvfOn2ceQ== X-Google-Smtp-Source: AGHT+IFb9gtsVSBI78S8py0lvAwl97kA83TZ0ZZok+4mAzyyKlfXwkiksf2y/itFTsUJqIL78jvV X-Received: by 2002:a05:6512:38cc:b0:512:c802:7a8 with SMTP id p12-20020a05651238cc00b00512c80207a8mr4118885lft.41.1708974294271; Mon, 26 Feb 2024 11:04:54 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708974294; cv=pass; d=google.com; s=arc-20160816; b=Jvsh/36lPcEgbvoe5/wz7fXCIBrUCssxpZk/aG+1/Q2B2aNEHmYZoDCifgD2QDfLB6 gIRchhR1pt8CtA3xlFt8Iwy4E0Zfq4QD+19ZQy9+dbYMYZ0LprRWKeQibR8JqyboBS0/ pCzKEBesB7LQl8DlOQ+TFgZW3Wp6J106JauWzhyWq49D+IXdQNcTb/mrZE/h7RV4Lut1 JC3tuQDPRkAYHjBT8IZtbxlxhLO9PqIJtypp/Qvj1VVJH3DhUG1tJslsr7605hnhmRTJ fFd2O6fss6Q78yHNcA7heToUJg0PiweklP/uE3IK2Q+ELd4gQsj4/8NmEmSwMSPOVyse Qh9g== 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=CWYUyy6QSMyEARa+J67wigDGH6VAlgHZBuIPAO+RHiQ=; fh=TLdZJsFzSA0fpm6Q4iUv+uB0sG0oU+h3Bp6HiSGyZm8=; b=eKwdMOChueHbxv4crGB4i1rcuoYVXjcWgdVFEQIlO5yb8p4I07SzvHAGJkWUQYM00z ykvAAwJSWgV19O5NABpRRv9kCkmxEClWedEohV7d3YBbEBCpDIsRL6xjU/8c66JwItqj pRrdyk69smSm8Iurzpk1feBhNU5927BueJ/0a7Pr0peOpkBJy6ci+s5edZThPLlMoc3v o8sli+hagklUywZNd2JlhDLPiCo4+H/PXevySMVgc9mN/sZxav2/NUK5ivqrT7Y8fFaL 1mIVAjo0VXCrvRy8QWSqLSKxt9G4Y6FNW9iBykqya0B+Lq7Q3QOG+odfiKXaiVFQdkS6 sClQ==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PjPzMTm7; 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-82185-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82185-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. [147.75.80.249]) by mx.google.com with ESMTPS id cw14-20020a056402228e00b005662868f955si26090edb.195.2024.02.26.11.04.54 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 26 Feb 2024 11:04:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-82185-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=PjPzMTm7; 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-82185-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-82185-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 094D61F277E9 for ; Mon, 26 Feb 2024 19:04:54 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 127F1130E46; Mon, 26 Feb 2024 19:03:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="PjPzMTm7" 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 8D62C12FB25 for ; Mon, 26 Feb 2024 19:03:52 +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=1708974234; cv=none; b=HeoA+CS9VLXoWq8V8BEX6Dp9SOmPfy2S5c4rmHRy0YjnQDs6Wd2WYRRM9uHgy+0Q/P58mQ6cY/E8COi5oGdqx5e97ubatp3BgfqzO5SvTvP3J2b0eTG29RbLmoJSHlCV4XDaLShsMXISVPM49JBOygUi+7VyPZQX2kyiD2sEmzw= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708974234; c=relaxed/simple; bh=BcyNPcEjNpDKmi3eYP5q+XdH/eR7f5WZMjnLtuWyvjc=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=iHBnwQJBcMWfUpE+BDhZrfWYLMO/odq6jVCFgoT3+TvimeWh1PPDr8H7ZSZNAhnJkMQ60mKIJefrXNLuWgth+pLChmy5NPOWTGaV9gpAWfX6ZOKf8peF8kIPNJzwe0bc7KqeIpOOoeKPPLOQ3EL/gmRhIpevmEkxRDSd5gvD69k= 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=PjPzMTm7; 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=1708974231; 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=CWYUyy6QSMyEARa+J67wigDGH6VAlgHZBuIPAO+RHiQ=; b=PjPzMTm7X0OjcNlddgIFc27fg3Pn3Z0I8ObMCVM4AfOKtdS2inggKzVEvG3OvnAORuCLF/ wFLYVFsiFuNZc6JGQbHi44F42gAt73NR0Z6k9c31QN0jRhQ6O0Uy6dWVmzNIiFhomrHb5A ajIwsekOmetwfTzgE6dgI+Xayusm6pM= 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-191-DqbIcuQjPouthjs0p7X-1w-1; Mon, 26 Feb 2024 14:03:47 -0500 X-MC-Unique: DqbIcuQjPouthjs0p7X-1w-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 A80D938212D4; Mon, 26 Feb 2024 19:03:46 +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 7F719492BC6; Mon, 26 Feb 2024 19:03:46 +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 v3 05/15] Documentation: kvm/sev: separate description of firmware Date: Mon, 26 Feb 2024 14:03:34 -0500 Message-Id: <20240226190344.787149-6-pbonzini@redhat.com> In-Reply-To: <20240226190344.787149-1-pbonzini@redhat.com> References: <20240226190344.787149-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. 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