1 Star 0 Fork 126

ganqx/src-qemu

forked from src-openEuler/qemu 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
target-i386-csv-Load-initial-image-to-private-memory.patch 1.51 KB
一键复制 编辑 原始数据 按行查看 历史
Jiabo Feng 提交于 2024-12-12 17:01 . QEMU update to version 8.2.0-26:
From ed3c233cc00d4c30718fc64b3afc48a51b4eb438 Mon Sep 17 00:00:00 2001
From: jiangxin <jiangxin@hygon.cn>
Date: Wed, 25 Aug 2021 14:29:40 +0800
Subject: [PATCH] target/i386: csv: Load initial image to private memory for
CSV3 guest
The initial image of CSV3 guest should be loaded into private memory
before boot the guest.
Add APIs to implement the image load.
Signed-off-by: Xin Jiang <jiangxin@hygon.cn>
Signed-off-by: hanliyang <hanliyang@hygon.cn>
---
hw/i386/pc_sysfw.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
diff --git a/hw/i386/pc_sysfw.c b/hw/i386/pc_sysfw.c
index c8d9e71b88..2bbcbb8d35 100644
--- a/hw/i386/pc_sysfw.c
+++ b/hw/i386/pc_sysfw.c
@@ -37,6 +37,7 @@
#include "hw/block/flash.h"
#include "sysemu/kvm.h"
#include "sev.h"
+#include "csv.h"
#define FLASH_SECTOR_SIZE 4096
@@ -263,7 +264,18 @@ void x86_firmware_configure(void *ptr, int size)
error_report("failed to locate and/or save reset vector");
exit(1);
}
+ if (csv3_enabled()) {
+ ram_addr_t offset = 0;
+ MemoryRegion *mr;
- sev_encrypt_flash(ptr, size, &error_fatal);
+ mr = memory_region_from_host(ptr, &offset);
+ if (!mr) {
+ error_report("failed to get memory region of flash");
+ exit(1);
+ }
+ csv3_load_data(mr->addr + offset, ptr, size, &error_fatal);
+ } else {
+ sev_encrypt_flash(ptr, size, &error_fatal);
+ }
}
}
--
2.41.0.windows.1
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ganqx/src-qemu.git
git@gitee.com:ganqx/src-qemu.git
ganqx
src-qemu
src-qemu
master

搜索帮助