代码拉取完成,页面将自动刷新
同步操作将从 src-openEuler/qemu 强制同步,此操作会覆盖自 Fork 仓库以来所做的任何修改,且无法恢复!!!
确定后同步将在后台操作,完成时将刷新页面,请耐心等待。
From b791d13a0630e6640b3c39dc90671a2150734a24 Mon Sep 17 00:00:00 2001
From: Xin Jiang <jiangxin@hygon.cn>
Date: Thu, 13 Jul 2023 09:35:10 +0800
Subject: [PATCH] vga: Force full update for CSV3 guest
As CSV3's NPT(nested page table) is managed by firmware, VMM is hard
to track the dirty pages of vga buffer. Although VMM could perform
a command to firmware to update read/write attribute of vga buffer
in NPT, it costs more time due to communication between VMM and
firmware. So the simplest method is to fully update vga buffer
always.
Signed-off-by: Xin Jiang <jiangxin@hygon.cn>
Signed-off-by: hanliyang <hanliyang@hygon.cn>
---
accel/kvm/kvm-all.c | 1 +
accel/stubs/kvm-stub.c | 2 ++
hw/display/vga.c | 7 +++++++
include/sysemu/kvm.h | 8 ++++++++
target/i386/csv.c | 3 +++
5 files changed, 21 insertions(+)
diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c
index 8077630825..8028caddf9 100644
--- a/accel/kvm/kvm-all.c
+++ b/accel/kvm/kvm-all.c
@@ -103,6 +103,7 @@ bool kvm_allowed;
bool kvm_readonly_mem_allowed;
bool kvm_vm_attributes_allowed;
bool kvm_msi_use_devid;
+bool kvm_csv3_allowed;
bool kvm_has_guest_debug;
static int kvm_sstep_flags;
static bool kvm_immediate_exit;
diff --git a/accel/stubs/kvm-stub.c b/accel/stubs/kvm-stub.c
index ad39a434c4..b071afee45 100644
--- a/accel/stubs/kvm-stub.c
+++ b/accel/stubs/kvm-stub.c
@@ -27,6 +27,8 @@ bool kvm_msi_use_devid;
bool virtcca_cvm_allowed;
+bool kvm_csv3_allowed;
+
void kvm_flush_coalesced_mmio_buffer(void)
{
}
diff --git a/hw/display/vga.c b/hw/display/vga.c
index cb6b6ee2ca..3f1358676b 100644
--- a/hw/display/vga.c
+++ b/hw/display/vga.c
@@ -39,6 +39,8 @@
#include "migration/vmstate.h"
#include "trace.h"
+#include "sysemu/kvm.h"
+
//#define DEBUG_VGA_MEM
//#define DEBUG_VGA_REG
@@ -1790,6 +1792,11 @@ static void vga_update_display(void *opaque)
s->cursor_blink_time = qemu_clock_get_ms(QEMU_CLOCK_VIRTUAL);
full_update = 1;
}
+
+ /* Force to full update in CSV guest. */
+ if (kvm_csv3_enabled())
+ full_update = 1;
+
switch(graphic_mode) {
case GMODE_TEXT:
vga_draw_text(s, full_update);
diff --git a/include/sysemu/kvm.h b/include/sysemu/kvm.h
index 31af5f0e24..fd8634cc8f 100644
--- a/include/sysemu/kvm.h
+++ b/include/sysemu/kvm.h
@@ -44,6 +44,7 @@ extern bool kvm_gsi_routing_allowed;
extern bool kvm_gsi_direct_mapping;
extern bool kvm_readonly_mem_allowed;
extern bool kvm_msi_use_devid;
+extern bool kvm_csv3_allowed;
#define kvm_enabled() (kvm_allowed)
#define virtcca_cvm_enabled() (virtcca_cvm_allowed)
@@ -147,6 +148,12 @@ extern bool kvm_msi_use_devid;
*/
#define kvm_msi_devid_required() (kvm_msi_use_devid)
+/**
+ * kvm_csv3_enabled:
+ * Returns: true if CSV3 feature is used for the VM.
+ */
+#define kvm_csv3_enabled() (kvm_csv3_allowed)
+
#else
#define kvm_enabled() (0)
@@ -163,6 +170,7 @@ extern bool kvm_msi_use_devid;
#define kvm_gsi_direct_mapping() (false)
#define kvm_readonly_mem_enabled() (false)
#define kvm_msi_devid_required() (false)
+#define kvm_csv3_enabled() (false)
#endif /* CONFIG_KVM_IS_POSSIBLE */
diff --git a/target/i386/csv.c b/target/i386/csv.c
index 12282ba451..65d87de003 100644
--- a/target/i386/csv.c
+++ b/target/i386/csv.c
@@ -14,6 +14,7 @@
#include "qemu/osdep.h"
#include "qemu/error-report.h"
#include "qapi/error.h"
+#include "sysemu/kvm.h"
#include <linux/kvm.h>
@@ -60,6 +61,8 @@ csv3_init(uint32_t policy, int fd, void *state, struct sev_ops *ops)
return -1;
}
+ kvm_csv3_allowed = true;
+
csv3_guest.sev_fd = fd;
csv3_guest.state = state;
csv3_guest.sev_ioctl = ops->sev_ioctl;
--
2.41.0.windows.1
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。