mirror of
https://github.com/yuzu-emu/unicorn.git
synced 2025-01-11 10:15:36 +00:00
memory: do not touch code dirty bitmap unless TCG is enabled
cpu_physical_memory_set_dirty_lebitmap unconditionally syncs the DIRTY_MEMORY_CODE bitmap. This however is unused unless TCG is enabled. Backports commit 9460dee4b2258e3990906fb34099481c8334c267 from qemu
This commit is contained in:
parent
6172e3dc29
commit
6bbfcf65e8
|
@ -125,10 +125,13 @@ static inline void cpu_physical_memory_set_dirty_lebitmap(struct uc_struct *uc,
|
|||
for (k = 0; k < nr; k++) {
|
||||
if (bitmap[k]) {
|
||||
unsigned long temp = leul_to_cpu(bitmap[k]);
|
||||
uc->ram_list.dirty_memory[DIRTY_MEMORY_CODE][page + k] |= temp;
|
||||
if (tcg_enabled(uc)) {
|
||||
uc->ram_list.dirty_memory[DIRTY_MEMORY_CODE][page + k] |= temp;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
uint8_t clients = tcg_enabled(uc) ? DIRTY_CLIENTS_ALL : DIRTY_CLIENTS_NOCODE;
|
||||
/*
|
||||
* bitmap-traveling is faster than memory-traveling (for addr...)
|
||||
* especially when most of the memory is not dirty.
|
||||
|
@ -143,8 +146,7 @@ static inline void cpu_physical_memory_set_dirty_lebitmap(struct uc_struct *uc,
|
|||
addr = page_number * TARGET_PAGE_SIZE;
|
||||
ram_addr = start + addr;
|
||||
cpu_physical_memory_set_dirty_range(uc, ram_addr,
|
||||
TARGET_PAGE_SIZE * hpratio,
|
||||
DIRTY_CLIENTS_ALL);
|
||||
TARGET_PAGE_SIZE * hpratio, clients);
|
||||
} while (c != 0);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue