---
exec-all.h | 8 +++++++-
exec.c | 24 +++++++++---------------
kqemu.c | 26 +++++++++++++++-----------
3 files changed, 31 insertions(+), 27 deletions(-)
diff --git a/exec-all.h b/exec-all.h
index ed96a22..04112e0 100644
--- a/exec-all.h
+++ b/exec-all.h
@@ -586,6 +586,7 @@ typedef struct QEMUAccel {
int (*info)(CPUState *env, char *buf);
int (*profile)(CPUState *env, char *buf);
void (*set_notdirty)(ram_addr_t addr);
+ void (*modify_page)(ram_addr_t addr, int dirty_flags);
} QEMUAccel;
extern QEMUAccel *current_accel;
@@ -639,11 +640,16 @@ static inline void accel_set_notdirty(target_ulong addr)
current_accel->set_notdirty(addr);
}
+static inline void accel_modify_page(target_ulong addr, int dirty_flags)
+{
+ if (current_accel && current_accel->modify_page)
+ current_accel->modify_page(addr, dirty_flags);
+}
+
#ifdef USE_KQEMU
#define KQEMU_MODIFY_PAGE_MASK (0xff & ~(VGA_DIRTY_FLAG | CODE_DIRTY_FLAG))
int kqemu_cpu_exec(CPUState *env);
-void kqemu_modify_page(CPUState *env, ram_addr_t ram_addr);
void kqemu_record_dump(void);
static inline int kqemu_is_ok(CPUState *env)
diff --git a/exec.c b/exec.c
index 6d05f75..92f1552 100644
--- a/exec.c
+++ b/exec.c
@@ -2185,11 +2185,9 @@ static void notdirty_mem_writeb(void *opaque,
target_phys_addr_t addr, uint32_t
#endif
}
stb_p((uint8_t *)(long)addr, val);
-#ifdef USE_KQEMU
- if (cpu_single_env->kqemu_enabled &&
- (dirty_flags & KQEMU_MODIFY_PAGE_MASK) != KQEMU_MODIFY_PAGE_MASK)
- kqemu_modify_page(cpu_single_env, ram_addr);
-#endif
+
+ accel_modify_page(ram_addr, dirty_flags);
+
dirty_flags |= (0xff & ~CODE_DIRTY_FLAG);
phys_ram_dirty[ram_addr >> TARGET_PAGE_BITS] = dirty_flags;
/* we remove the notdirty callback only if the code has been
@@ -2211,11 +2209,9 @@ static void notdirty_mem_writew(void *opaque,
target_phys_addr_t addr, uint32_t
#endif
}
stw_p((uint8_t *)(long)addr, val);
-#ifdef USE_KQEMU
- if (cpu_single_env->kqemu_enabled &&
- (dirty_flags & KQEMU_MODIFY_PAGE_MASK) != KQEMU_MODIFY_PAGE_MASK)
- kqemu_modify_page(cpu_single_env, ram_addr);
-#endif
+
+ accel_modify_page(ram_addr, dirty_flags);
+
dirty_flags |= (0xff & ~CODE_DIRTY_FLAG);
phys_ram_dirty[ram_addr >> TARGET_PAGE_BITS] = dirty_flags;
/* we remove the notdirty callback only if the code has been
@@ -2237,11 +2233,9 @@ static void notdirty_mem_writel(void *opaque,
target_phys_addr_t addr, uint32_t
#endif
}
stl_p((uint8_t *)(long)addr, val);
-#ifdef USE_KQEMU
- if (cpu_single_env->kqemu_enabled &&
- (dirty_flags & KQEMU_MODIFY_PAGE_MASK) != KQEMU_MODIFY_PAGE_MASK)
- kqemu_modify_page(cpu_single_env, ram_addr);
-#endif
+
+ accel_modify_page(ram_addr, dirty_flags);
+
dirty_flags |= (0xff & ~CODE_DIRTY_FLAG);
phys_ram_dirty[ram_addr >> TARGET_PAGE_BITS] = dirty_flags;
/* we remove the notdirty callback only if the code has been
diff --git a/kqemu.c b/kqemu.c
index 44c1a55..7e24bb7 100644
--- a/kqemu.c
+++ b/kqemu.c
@@ -358,16 +358,6 @@ void kqemu_set_notdirty(ram_addr_t ram_addr)
ram_pages_to_update[nb_ram_pages_to_update++] = ram_addr;
}
-QEMUAccel kqemu_accel = {
- .cpu_interrupt = kqemu_cpu_interrupt,
- .init_env = kqemu_init_env,
- .flush_cache = kqemu_flush,
- .flush_page = kqemu_flush_page,
- .info = kqemu_info,
- .profile = kqemu_profile,
- .set_notdirty = kqemu_set_notdirty,
-};
-
static void kqemu_reset_modified_ram_pages(void)
{
int i;
@@ -380,7 +370,7 @@ static void kqemu_reset_modified_ram_pages(void)
nb_modified_ram_pages = 0;
}
-void kqemu_modify_page(CPUState *env, ram_addr_t ram_addr)
+void kqemu_modify_page(ram_addr_t ram_addr, int dirty_flags)
{
unsigned long page_index;
int ret;
@@ -388,6 +378,8 @@ void kqemu_modify_page(CPUState *env, ram_addr_t ram_addr)
DWORD temp;
#endif
+ if ((dirty_flags & KQEMU_MODIFY_PAGE_MASK) != KQEMU_MODIFY_PAGE_MASK)
+ return;
page_index = ram_addr >> TARGET_PAGE_BITS;
if (!modified_ram_pages_table[page_index]) {
#if 0
@@ -411,6 +403,18 @@ void kqemu_modify_page(CPUState *env, ram_addr_t ram_addr)
}
}
+QEMUAccel kqemu_accel = {
+ .cpu_interrupt = kqemu_cpu_interrupt,
+ .init_env = kqemu_init_env,
+ .flush_cache = kqemu_flush,
+ .flush_page = kqemu_flush_page,
+ .info = kqemu_info,
+ .profile = kqemu_profile,
+ .set_notdirty = kqemu_set_notdirty,
+ .modify_page = kqemu_modify_page,
+};
+
+
struct fpstate {
uint16_t fpuc;
uint16_t dummy1;
--
1.5.5
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
kvm-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/kvm-devel