aboutsummaryrefslogtreecommitdiffstats
path: root/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71-e3000/0090-KVM-SVM-Fix-SEV-LAUNCH_SECRET-command.patch
diff options
context:
space:
mode:
Diffstat (limited to 'meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71-e3000/0090-KVM-SVM-Fix-SEV-LAUNCH_SECRET-command.patch')
-rw-r--r--meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71-e3000/0090-KVM-SVM-Fix-SEV-LAUNCH_SECRET-command.patch64
1 files changed, 64 insertions, 0 deletions
diff --git a/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71-e3000/0090-KVM-SVM-Fix-SEV-LAUNCH_SECRET-command.patch b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71-e3000/0090-KVM-SVM-Fix-SEV-LAUNCH_SECRET-command.patch
new file mode 100644
index 00000000..1aec08a2
--- /dev/null
+++ b/meta-amd-bsp/recipes-kernel/linux/linux-yocto-4.14.71-e3000/0090-KVM-SVM-Fix-SEV-LAUNCH_SECRET-command.patch
@@ -0,0 +1,64 @@
+From 0c47ce82da47eebc2e05744bcbebcc4976ea6ada Mon Sep 17 00:00:00 2001
+From: Brijesh Singh <brijesh.singh@amd.com>
+Date: Mon, 19 Feb 2018 10:13:25 -0600
+Subject: [PATCH 90/95] KVM: SVM: Fix SEV LAUNCH_SECRET command
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The SEV LAUNCH_SECRET command fails with error code 'invalid param'
+because we missed filling the guest and header system physical address
+while issuing the command.
+
+Fixes: 9f5b5b950aa9 (KVM: SVM: Add support for SEV LAUNCH_SECRET command)
+Cc: Paolo Bonzini <pbonzini@redhat.com>
+Cc: Radim Krčmář <rkrcmar@redhat.com>
+Cc: Borislav Petkov <bp@suse.de>
+Cc: Tom Lendacky <thomas.lendacky@amd.com>
+Cc: linux-kernel@vger.kernel.org
+Cc: Joerg Roedel <joro@8bytes.org>
+Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
+Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
+Signed-off-by: Sudheesh Mavila <sudheesh.mavila@amd.com>
+---
+ arch/x86/kvm/svm.c | 10 +++++++---
+ 1 file changed, 7 insertions(+), 3 deletions(-)
+
+diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
+index 6352a6c..e7815a3 100755
+--- a/arch/x86/kvm/svm.c
++++ b/arch/x86/kvm/svm.c
+@@ -6573,7 +6573,7 @@ static int sev_launch_secret(struct kvm *kvm, struct kvm_sev_cmd *argp)
+ struct page **pages;
+ void *blob, *hdr;
+ unsigned long n;
+- int ret;
++ int ret, offset;
+
+ if (!sev_guest(kvm))
+ return -ENOTTY;
+@@ -6599,6 +6599,10 @@ static int sev_launch_secret(struct kvm *kvm, struct kvm_sev_cmd *argp)
+ if (!data)
+ goto e_unpin_memory;
+
++ offset = params.guest_uaddr & (PAGE_SIZE - 1);
++ data->guest_address = __sme_page_pa(pages[0]) + offset;
++ data->guest_len = params.guest_len;
++
+ blob = psp_copy_user_blob(params.trans_uaddr, params.trans_len);
+ if (IS_ERR(blob)) {
+ ret = PTR_ERR(blob);
+@@ -6613,8 +6617,8 @@ static int sev_launch_secret(struct kvm *kvm, struct kvm_sev_cmd *argp)
+ ret = PTR_ERR(hdr);
+ goto e_free_blob;
+ }
+- data->trans_address = __psp_pa(blob);
+- data->trans_len = params.trans_len;
++ data->hdr_address = __psp_pa(hdr);
++ data->hdr_len = params.hdr_len;
+
+ data->handle = sev->handle;
+ ret = sev_issue_cmd(kvm, SEV_CMD_LAUNCH_UPDATE_SECRET, data, &argp->error);
+--
+2.7.4
+