* [Qemu-devel] [PATCH 1/2] ROM write access for debugging
@ 2009-03-17 17:18 Jan Kiszka
2009-03-28 17:51 ` Anthony Liguori
0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2009-03-17 17:18 UTC (permalink / raw)
To: qemu-devel
Enhance cpu_memory_rw_debug so that it can write even to ROM regions.
This allows to modify ROM via gdb (I see no point in denying this to the
user), and it will enable us to drop kvm_patch_opcode_byte().
Credits go to Avi for suggesting this.
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
---
exec.c | 11 ++++++++---
1 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/exec.c b/exec.c
index 86ab7de..5e94a8f 100644
--- a/exec.c
+++ b/exec.c
@@ -3448,7 +3448,7 @@ void stq_phys(target_phys_addr_t addr, uint64_t val)
#endif
-/* virtual memory access for debug */
+/* virtual memory access for debug (includes writing to ROM) */
int cpu_memory_rw_debug(CPUState *env, target_ulong addr,
uint8_t *buf, int len, int is_write)
{
@@ -3465,8 +3465,13 @@ int cpu_memory_rw_debug(CPUState *env, target_ulong addr,
l = (page + TARGET_PAGE_SIZE) - addr;
if (l > len)
l = len;
- cpu_physical_memory_rw(phys_addr + (addr & ~TARGET_PAGE_MASK),
- buf, l, is_write);
+ phys_addr += (addr & ~TARGET_PAGE_MASK);
+#if !defined(CONFIG_USER_ONLY)
+ if (is_write)
+ cpu_physical_memory_write_rom(phys_addr, buf, l);
+ else
+#endif
+ cpu_physical_memory_rw(phys_addr, buf, l, is_write);
len -= l;
buf += l;
addr += l;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [Qemu-devel] [PATCH 1/2] ROM write access for debugging
2009-03-17 17:18 [Qemu-devel] [PATCH 1/2] ROM write access for debugging Jan Kiszka
@ 2009-03-28 17:51 ` Anthony Liguori
0 siblings, 0 replies; 2+ messages in thread
From: Anthony Liguori @ 2009-03-28 17:51 UTC (permalink / raw)
To: qemu-devel
Jan Kiszka wrote:
> Enhance cpu_memory_rw_debug so that it can write even to ROM regions.
> This allows to modify ROM via gdb (I see no point in denying this to the
> user), and it will enable us to drop kvm_patch_opcode_byte().
>
> Credits go to Avi for suggesting this.
>
> Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
>
Applied both in series. Thanks.
Regards,
Anthony Liguori
> ---
>
> exec.c | 11 ++++++++---
> 1 files changed, 8 insertions(+), 3 deletions(-)
>
> diff --git a/exec.c b/exec.c
> index 86ab7de..5e94a8f 100644
> --- a/exec.c
> +++ b/exec.c
> @@ -3448,7 +3448,7 @@ void stq_phys(target_phys_addr_t addr, uint64_t val)
>
> #endif
>
> -/* virtual memory access for debug */
> +/* virtual memory access for debug (includes writing to ROM) */
> int cpu_memory_rw_debug(CPUState *env, target_ulong addr,
> uint8_t *buf, int len, int is_write)
> {
> @@ -3465,8 +3465,13 @@ int cpu_memory_rw_debug(CPUState *env, target_ulong addr,
> l = (page + TARGET_PAGE_SIZE) - addr;
> if (l > len)
> l = len;
> - cpu_physical_memory_rw(phys_addr + (addr & ~TARGET_PAGE_MASK),
> - buf, l, is_write);
> + phys_addr += (addr & ~TARGET_PAGE_MASK);
> +#if !defined(CONFIG_USER_ONLY)
> + if (is_write)
> + cpu_physical_memory_write_rom(phys_addr, buf, l);
> + else
> +#endif
> + cpu_physical_memory_rw(phys_addr, buf, l, is_write);
> len -= l;
> buf += l;
> addr += l;
>
>
>
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2009-03-28 17:52 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-17 17:18 [Qemu-devel] [PATCH 1/2] ROM write access for debugging Jan Kiszka
2009-03-28 17:51 ` Anthony Liguori
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).