Skip to content

Commit

Permalink
softmmu: Move dirtylimit.c into the target independent source set
Browse files Browse the repository at this point in the history
dirtylimit.c just uses one TARGET_PAGE_SIZE macro - change it to
qemu_target_page_size() so we can move thefile into the target
independent source set. Then we only have to compile this file
once during the build instead of multiple times (one time for
each target).

Message-Id: <20230413054509.54421-1-thuth@redhat.com>
Reviewed-by: Fabiano Rosas <farosas@suse.de>
Signed-off-by: Thomas Huth <thuth@redhat.com>
  • Loading branch information
huth committed Apr 20, 2023
1 parent 9eb7e7e commit 30ee29f
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion softmmu/dirtylimit.c
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
#include "monitor/hmp.h"
#include "monitor/monitor.h"
#include "exec/memory.h"
#include "exec/target_page.h"
#include "hw/boards.h"
#include "sysemu/kvm.h"
#include "trace.h"
Expand Down Expand Up @@ -236,7 +237,7 @@ static inline int64_t dirtylimit_dirty_ring_full_time(uint64_t dirtyrate)
static uint64_t max_dirtyrate;
uint32_t dirty_ring_size = kvm_dirty_ring_size();
uint64_t dirty_ring_size_meory_MB =
dirty_ring_size * TARGET_PAGE_SIZE >> 20;
dirty_ring_size * qemu_target_page_size() >> 20;

if (max_dirtyrate < dirtyrate) {
max_dirtyrate = dirtyrate;
Expand Down
2 changes: 1 addition & 1 deletion softmmu/meson.build
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ specific_ss.add(when: 'CONFIG_SOFTMMU', if_true: [files(
'ioport.c',
'memory.c',
'physmem.c',
'dirtylimit.c',
'watchpoint.c',
)])

Expand All @@ -18,6 +17,7 @@ softmmu_ss.add(files(
'cpu-throttle.c',
'cpu-timers.c',
'datadir.c',
'dirtylimit.c',
'dma-helpers.c',
'globals.c',
'memory_mapping.c',
Expand Down

0 comments on commit 30ee29f

Please sign in to comment.