9 Star 0 Fork 38

src-anolis-os/qemu-kvm

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
1042-target-i386-sev-do-not-create-launch-context-for-an-.patch 1.60 KB
一键复制 编辑 原始数据 按行查看 历史
From 36b08d0392f2baec061e6fb90416db42dfad20f7 Mon Sep 17 00:00:00 2001
From: Brijesh Singh <brijesh.singh@amd.com>
Date: Tue, 27 Jul 2021 12:16:09 +0000
Subject: [PATCH 05/29] target/i386: sev: do not create launch context for an
incoming guest
cherry-picked from https://github.com/AMDESE/qemu/commit/b85694233495.
The LAUNCH_START is used for creating an encryption context to encrypt
newly created guest, for an incoming guest the RECEIVE_START should be
used.
Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>
Signed-off-by: Brijesh Singh <brijesh.singh@amd.com>
Signed-off-by: Ashish Kalra <ashish.kalra@amd.com>
Signed-off-by: hanliyang <hanliyang@hygon.cn>
---
target/i386/sev.c | 14 ++++++++++----
1 file changed, 10 insertions(+), 4 deletions(-)
diff --git a/target/i386/sev.c b/target/i386/sev.c
index 5dd6c0a3f..fc8a2bb61 100644
--- a/target/i386/sev.c
+++ b/target/i386/sev.c
@@ -1024,10 +1024,16 @@ int sev_kvm_init(ConfidentialGuestSupport *cgs, Error **errp)
}
}
- ret = sev_launch_start(sev);
- if (ret) {
- error_setg(errp, "%s: failed to create encryption context", __func__);
- goto err;
+ /*
+ * The LAUNCH context is used for new guest, if its an incoming guest
+ * then RECEIVE context will be created after the connection is established.
+ */
+ if (!runstate_check(RUN_STATE_INMIGRATE)) {
+ ret = sev_launch_start(sev);
+ if (ret) {
+ error_setg(errp, "%s: failed to create encryption context", __func__);
+ goto err;
+ }
}
/* CSV guest needs no notifier to reg/unreg memory */
--
2.31.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-anolis-os/qemu-kvm.git
git@gitee.com:src-anolis-os/qemu-kvm.git
src-anolis-os
qemu-kvm
qemu-kvm
a8-virt-stream-an

搜索帮助

371d5123 14472233 46e8bd33 14472233