[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 15/32] wrap modify_page through accel calls
From: |
Glauber Costa |
Subject: |
[Qemu-devel] [PATCH 15/32] wrap modify_page through accel calls |
Date: |
Thu, 23 Oct 2008 12:18:59 -0200 |
From: Glauber Costa <address@hidden>
Yet another accel field: modify_page
Signed-off-by: Glauber Costa <address@hidden>
---
accel.c | 1 +
accel.h | 7 +++++++
exec-all.h | 1 -
exec.c | 27 ++++++++++++---------------
kqemu.c | 5 ++++-
5 files changed, 24 insertions(+), 17 deletions(-)
diff --git a/accel.c b/accel.c
index 58ac053..d615912 100644
--- a/accel.c
+++ b/accel.c
@@ -24,5 +24,6 @@ QEMUAccel noaccel = {
.info = noaccel_info,
.profile = accel_nop,
.set_notdirty = accel_nop,
+ .modify_page = accel_nop,
};
diff --git a/accel.h b/accel.h
index 76e1f3b..e232f87 100644
--- a/accel.h
+++ b/accel.h
@@ -11,6 +11,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;
@@ -55,4 +56,10 @@ 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)
+{
+ current_accel->modify_page(addr, dirty_flags);
+}
+
#endif
diff --git a/exec-all.h b/exec-all.h
index cb2e7c6..6c62f06 100644
--- a/exec-all.h
+++ b/exec-all.h
@@ -366,7 +366,6 @@ static inline int can_do_io(CPUState *env)
#define MSR_QPI_COMMBASE 0xfabe0010
int kqemu_cpu_exec(CPUState *env);
-void kqemu_modify_page(CPUState *env, ram_addr_t ram_addr);
void kqemu_set_phys_mem(uint64_t start_addr, ram_addr_t size,
ram_addr_t phys_offset);
void kqemu_record_dump(void);
diff --git a/exec.c b/exec.c
index fa62167..089a91e 100644
--- a/exec.c
+++ b/exec.c
@@ -2378,12 +2378,11 @@ static void notdirty_mem_writeb(void *opaque,
target_phys_addr_t ram_addr,
dirty_flags = phys_ram_dirty[ram_addr >> TARGET_PAGE_BITS];
#endif
}
+
stb_p(phys_ram_base + ram_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
@@ -2403,12 +2402,11 @@ static void notdirty_mem_writew(void *opaque,
target_phys_addr_t ram_addr,
dirty_flags = phys_ram_dirty[ram_addr >> TARGET_PAGE_BITS];
#endif
}
+
stw_p(phys_ram_base + ram_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
@@ -2428,12 +2426,11 @@ static void notdirty_mem_writel(void *opaque,
target_phys_addr_t ram_addr,
dirty_flags = phys_ram_dirty[ram_addr >> TARGET_PAGE_BITS];
#endif
}
+
stl_p(phys_ram_base + ram_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 98ec1a0..5777afd 100644
--- a/kqemu.c
+++ b/kqemu.c
@@ -304,7 +304,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)
+static void kqemu_modify_page(ram_addr_t ram_addr, int dirty_flags)
{
unsigned long page_index;
int ret;
@@ -312,6 +312,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
@@ -1114,6 +1116,7 @@ QEMUAccel kqemu_accel = {
.info = kqemu_info,
.profile = kqemu_profile,
.set_notdirty = kqemu_set_notdirty,
+ .modify_page = kqemu_modify_page,
};
#endif
--
1.5.5.1
- [Qemu-devel] Re: [PATCH 05/32] use more meaningful values for kqemu_cpu_exec, (continued)
- [Qemu-devel] [PATCH 07/32] introduce QEMUAccel and fill it with interrupt specific driver, Glauber Costa, 2008/10/23
- [Qemu-devel] [PATCH 06/32] split kqemu_init into two, Glauber Costa, 2008/10/23
- [Qemu-devel] [PATCH 08/32] init env made accel driver, Glauber Costa, 2008/10/23
- [Qemu-devel] [PATCH 09/32] wrap cache flushing functions into accel drivers, Glauber Costa, 2008/10/23
- [Qemu-devel] [PATCH 13/32] move disabling code to kqemu.c instead of vl.c, Glauber Costa, 2008/10/23
- [Qemu-devel] [PATCH 15/32] wrap modify_page through accel calls,
Glauber Costa <=
- [Qemu-devel] [PATCH 18/32] provide --accel option, Glauber Costa, 2008/10/23
- [Qemu-devel] [PATCH 10/32] turn info kqemu into generic info accelerator, Glauber Costa, 2008/10/23
- [Qemu-devel] [PATCH 16/32] remove kqemu reference from hw/pc.c, Glauber Costa, 2008/10/23
- [Qemu-devel] [PATCH 12/32] move kqemu externs to kqemu.h, Glauber Costa, 2008/10/23
- [Qemu-devel] [PATCH 11/32] separate accelerator part of info profiler, Glauber Costa, 2008/10/23
- [Qemu-devel] [PATCH 21/32] get_env accel wrapper, Glauber Costa, 2008/10/23
- [Qemu-devel] [PATCH 17/32] build list of available accelerators, Glauber Costa, 2008/10/23