[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 16/61] memory: Fix start offset for bitmap log_clear hook
From: |
Paolo Bonzini |
Subject: |
[PULL 16/61] memory: Fix start offset for bitmap log_clear hook |
Date: |
Mon, 16 Mar 2020 22:26:43 +0100 |
From: Matt Borgerson <address@hidden>
Currently only the final page offset is being passed to the `log_clear`
hook via `memory_region_clear_dirty_bitmap` after it is used as an
iterator in `cpu_physical_memory_test_and_clear_dirty`. This patch
corrects the start address and size of the region.
Signed-off-by: Matt Borgerson <address@hidden>
Reviewed-by: Peter Xu <address@hidden>
Signed-off-by: Paolo Bonzini <address@hidden>
---
exec.c | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
diff --git a/exec.c b/exec.c
index 0cc500d..de9d949 100644
--- a/exec.c
+++ b/exec.c
@@ -1315,7 +1315,7 @@ bool cpu_physical_memory_test_and_clear_dirty(ram_addr_t
start,
unsigned client)
{
DirtyMemoryBlocks *blocks;
- unsigned long end, page;
+ unsigned long end, page, start_page;
bool dirty = false;
RAMBlock *ramblock;
uint64_t mr_offset, mr_size;
@@ -1325,7 +1325,8 @@ bool cpu_physical_memory_test_and_clear_dirty(ram_addr_t
start,
}
end = TARGET_PAGE_ALIGN(start + length) >> TARGET_PAGE_BITS;
- page = start >> TARGET_PAGE_BITS;
+ start_page = start >> TARGET_PAGE_BITS;
+ page = start_page;
WITH_RCU_READ_LOCK_GUARD() {
blocks = atomic_rcu_read(&ram_list.dirty_memory[client]);
@@ -1345,8 +1346,8 @@ bool cpu_physical_memory_test_and_clear_dirty(ram_addr_t
start,
page += num;
}
- mr_offset = (ram_addr_t)(page << TARGET_PAGE_BITS) - ramblock->offset;
- mr_size = (end - page) << TARGET_PAGE_BITS;
+ mr_offset = (ram_addr_t)(start_page << TARGET_PAGE_BITS) -
ramblock->offset;
+ mr_size = (end - start_page) << TARGET_PAGE_BITS;
memory_region_clear_dirty_bitmap(ramblock->mr, mr_offset, mr_size);
}
--
1.8.3.1
- [PULL 05/61] configure: add configure option avx512f_opt, (continued)
- [PULL 05/61] configure: add configure option avx512f_opt, Paolo Bonzini, 2020/03/16
- [PULL 08/61] WHPX: Use QEMU values for trapped CPUID, Paolo Bonzini, 2020/03/16
- [PULL 03/61] misc: Replace zero-length arrays with flexible array member (automatic), Paolo Bonzini, 2020/03/16
- [PULL 06/61] util: add util function buffer_zero_avx512(), Paolo Bonzini, 2020/03/16
- [PULL 07/61] WHPX: TSC get and set should be dependent on VM state, Paolo Bonzini, 2020/03/16
- [PULL 10/61] hw/i386/intel_iommu: Fix out-of-bounds access on guest IRT, Paolo Bonzini, 2020/03/16
- [PULL 09/61] MAINTAINERS: Add entry for Guest X86 HAXM CPUs, Paolo Bonzini, 2020/03/16
- [PULL 11/61] oslib-posix: initialize mutex and condition variable, Paolo Bonzini, 2020/03/16
- [PULL 14/61] configure: Fix building with SASL on Windows, Paolo Bonzini, 2020/03/16
- [PULL 13/61] modules: load modules from versioned /var/run dir, Paolo Bonzini, 2020/03/16
- [PULL 16/61] memory: Fix start offset for bitmap log_clear hook,
Paolo Bonzini <=
- [PULL 12/61] build-sys: do not make qemu-ga link with pixman, Paolo Bonzini, 2020/03/16
- [PULL 15/61] tests/docker: Install SASL library to extend code coverage on amd64, Paolo Bonzini, 2020/03/16
- [PULL 19/61] ich9: Simplify ich9_lpc_initfn, Paolo Bonzini, 2020/03/16
- [PULL 18/61] ich9: fix getter type for sci_int property, Paolo Bonzini, 2020/03/16
- [PULL 17/61] qom/object: enable setter for uint types, Paolo Bonzini, 2020/03/16
- [PULL 21/61] i386: Fix GCC warning with snprintf when HAX is enabled, Paolo Bonzini, 2020/03/16
- [PULL 20/61] qom/object: Use common get/set uint helpers, Paolo Bonzini, 2020/03/16
- [PULL 22/61] WHPX: Use proper synchronization primitives while processing, Paolo Bonzini, 2020/03/16
- [PULL 23/61] Makefile: Align 'help' target output, Paolo Bonzini, 2020/03/16
- [PULL 24/61] Makefile: Let the 'help' target list the tools targets, Paolo Bonzini, 2020/03/16