[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH v2 8/9] hvf: only consider directly writeable memory regions for
From: |
Yan-Jie Wang |
Subject: |
[PATCH v2 8/9] hvf: only consider directly writeable memory regions for dirty-tracking |
Date: |
Wed, 2 Mar 2022 20:26:10 +0800 |
It is no need to dirty-track MMIO regions or other readonly regions.
Before we start or stop to dirty-track a memory region, check the type of
the memory region. The region must be a writeable ram to be dirty-tracked.
Signed-off-by: Yan-Jie Wang <ubzeme@gmail.com>
---
accel/hvf/hvf-mem.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/accel/hvf/hvf-mem.c b/accel/hvf/hvf-mem.c
index 2f70ceb307..b215386bc8 100644
--- a/accel/hvf/hvf-mem.c
+++ b/accel/hvf/hvf-mem.c
@@ -180,6 +180,11 @@ static void hvf_set_dirty_tracking(MemoryRegionSection
*section, bool on)
{
HVFSlot *slot;
+ if (!memory_region_is_ram(section->mr) || memory_region_is_rom(section)) {
+ /* do not consider memory regions which are not directly writeable */
+ return;
+ }
+
qemu_mutex_lock(&memlock);
slot = hvf_find_overlap_slot(
--
2.32.0 (Apple Git-132)
- [PATCH v2 0/9] Many improvements to HVF memory-related codes, Yan-Jie Wang, 2022/03/02
- [PATCH v2 1/9] hvf: move memory related functions from hvf-accel-ops.c to hvf-mem.c, Yan-Jie Wang, 2022/03/02
- [PATCH v2 2/9] hvf: simplify data structures and codes of memory related functions, Yan-Jie Wang, 2022/03/02
- [PATCH v2 3/9] hvf: use correct data types for addresses in memory related functions, Yan-Jie Wang, 2022/03/02
- [PATCH v2 4/9] hvf: rename struct hvf_slot to HVFSlot, Yan-Jie Wang, 2022/03/02
- [PATCH v2 5/9] hvf: fix memory dirty-tracking, Yan-Jie Wang, 2022/03/02
- [PATCH v2 6/9] hvf: add a lock for memory related functions, Yan-Jie Wang, 2022/03/02
- [PATCH v2 7/9] hvf: use GTree to store memory slots instead of fixed-size array, Yan-Jie Wang, 2022/03/02
- [PATCH v2 8/9] hvf: only consider directly writeable memory regions for dirty-tracking,
Yan-Jie Wang <=
- [PATCH v2 9/9] hvf: remove the need to lookup memory slots when clearing dirty-bits, Yan-Jie Wang, 2022/03/02