1 Star 0 Fork 131

xiaoyuliang/qemu

forked from src-openEuler/qemu 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
target-i386-sev-Fix-incompatibility-between-SEV-and-.patch 1.29 KB
一键复制 编辑 原始数据 按行查看 历史
Jiabo Feng 提交于 2024-11-30 08:43 +08:00 . QEMU update to version 8.2.0-25:
From c357946fa7c1d45a09b40214b5113f689bf7bbd0 Mon Sep 17 00:00:00 2001
From: hanliyang <hanliyang@hygon.cn>
Date: Fri, 1 Mar 2024 14:12:44 +0800
Subject: [PATCH] target/i386: sev: Fix incompatibility between SEV and CSV on
the GET_ID API
If the length of GET_ID request is too small, Hygon CSV will return
SEV_RET_INVALID_PARAM. This return code doesn't comply with SEV API
Spec.
Hygon will consider to fix the compitibility issue of return value
of the GET_ID API, so also check whether the return value is
SEV_RET_INVALID_LEN on Hygon CPUs.
Signed-off-by: hanliyang <hanliyang@hygon.cn>
---
target/i386/sev.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/target/i386/sev.c b/target/i386/sev.c
index 2c6aecd1a3..04888bc3a8 100644
--- a/target/i386/sev.c
+++ b/target/i386/sev.c
@@ -589,7 +589,8 @@ static int sev_get_cpu0_id(int fd, guchar **id, size_t *id_len, Error **errp)
/* query the ID length */
r = sev_platform_ioctl(fd, SEV_GET_ID2, &get_id2, &err);
- if (r < 0 && err != SEV_RET_INVALID_LEN) {
+ if (r < 0 && err != SEV_RET_INVALID_LEN &&
+ !(is_hygon_cpu() && err == SEV_RET_INVALID_PARAM)) {
error_setg(errp, "SEV: Failed to get ID ret=%d fw_err=%d (%s)",
r, err, fw_error_to_str(err));
return 1;
--
2.41.0.windows.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/xiao-yuliang/qemu.git
git@gitee.com:xiao-yuliang/qemu.git
xiao-yuliang
qemu
qemu
master

搜索帮助