From: Avi Kivity <avi@redhat.com>
To: Jan Kiszka <jan.kiszka@siemens.com>
Cc: kvm-devel <kvm@vger.kernel.org>
Subject: Re: [PATCH] kvm-userspace: x86: Support for breakpoints in ROM code
Date: Tue, 17 Mar 2009 11:51:50 +0200 [thread overview]
Message-ID: <49BF72B6.4040907@redhat.com> (raw)
In-Reply-To: <49BF7109.5000207@siemens.com>
Jan Kiszka wrote:
> This is not a hack (it shouldn't have been merged upstream otherwise):
> cpu_physical_memory_write_rom() takes system-wide physical addresses
> while kvm_patch_opcode_byte() works with per-CPU linear addresses.
>
From exec.c:
> /* virtual memory access for debug */
> int cpu_memory_rw_debug(CPUState *env, target_ulong addr,
> uint8_t *buf, int len, int is_write)
> {
> int l;
> target_phys_addr_t phys_addr;
> target_ulong page;
>
> while (len > 0) {
> page = addr & TARGET_PAGE_MASK;
> phys_addr = cpu_get_phys_page_debug(env, page);
> /* if no physical page mapped, return an error */
> if (phys_addr == -1)
> return -1;
> 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);
> len -= l;
> buf += l;
> addr += l;
> }
> return 0;
> }
I'm talking about replacing cpu_physical_memory_rw() with
cpu_physical_memory_write_rom() (for the write case). Is there a case
where the debugger should be prevented from writing into ROM? If so,
maybe cpu_memory_rw_debug_rom() for breakpoints?
We shouldn't juggle page descriptors in *kvm*.c.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2009-03-17 9:51 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-03-16 18:48 [PATCH] kvm-userspace: x86: Support for breakpoints in ROM code Jan Kiszka
2009-03-16 18:53 ` Jan Kiszka
2009-03-17 9:33 ` Avi Kivity
2009-03-17 9:44 ` Jan Kiszka
2009-03-17 9:51 ` Avi Kivity [this message]
2009-03-17 10:43 ` Jan Kiszka
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=49BF72B6.4040907@redhat.com \
--to=avi@redhat.com \
--cc=jan.kiszka@siemens.com \
--cc=kvm@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox