From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org
Subject: [PULL 5/9] exec/cpu: Declare cpu_memory_rw_debug() in 'hw/core/cpu.h' and document
Date: Fri, 31 Oct 2025 22:15:14 +0100 [thread overview]
Message-ID: <20251031211518.38503-6-philmd@linaro.org> (raw)
In-Reply-To: <20251031211518.38503-1-philmd@linaro.org>
cpu_memory_rw_debug() dispatches to CPUClass::memory_rw_debug(),
move its declaration closer to the CPU API. Document.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Zhao Liu <zhao1.liu@intel.com>
Message-Id: <20251001150529.14122-22-philmd@linaro.org>
---
include/exec/cpu-common.h | 4 ----
include/hw/core/cpu.h | 20 ++++++++++++++++++++
2 files changed, 20 insertions(+), 4 deletions(-)
diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
index 67e15c8e507..e0be4ee2b8f 100644
--- a/include/exec/cpu-common.h
+++ b/include/exec/cpu-common.h
@@ -150,10 +150,6 @@ typedef int (RAMBlockIterFunc)(RAMBlock *rb, void *opaque);
int qemu_ram_foreach_block(RAMBlockIterFunc func, void *opaque);
-/* Returns: 0 on success, -1 on error */
-int cpu_memory_rw_debug(CPUState *cpu, vaddr addr,
- void *ptr, size_t len, bool is_write);
-
/* vl.c */
void list_cpus(void);
diff --git a/include/hw/core/cpu.h b/include/hw/core/cpu.h
index e79e8e0a8ee..9615051774d 100644
--- a/include/hw/core/cpu.h
+++ b/include/hw/core/cpu.h
@@ -688,6 +688,26 @@ int cpu_write_elf32_note(WriteCoreDumpFunction f, CPUState *cpu,
int cpu_write_elf32_qemunote(WriteCoreDumpFunction f, CPUState *cpu,
void *opaque);
+/**
+ * cpu_memory_rw_debug:
+ * @cpu: The CPU whose memory is to be accessed
+ * @addr: guest virtual address
+ * @ptr: buffer with the data transferred
+ * @len: the number of bytes to read or write
+ * @is_write: indicates the transfer direction
+ *
+ * Take a virtual address, convert it to a physical address via
+ * an MMU lookup using the current settings of the specified CPU,
+ * and then perform the access (using address_space_rw() for
+ * reads or address_space_write_rom() for writes).
+ *
+ * This function is intended for use by the GDB stub and similar code.
+ *
+ * Returns: 0 on success, -1 on error
+ */
+int cpu_memory_rw_debug(CPUState *cpu, vaddr addr,
+ void *ptr, size_t len, bool is_write);
+
/**
* cpu_get_crash_info:
* @cpu: The CPU to get crash information for
--
2.51.0
next prev parent reply other threads:[~2025-10-31 21:18 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-10-31 21:15 [PULL 0/9] Accelerators & CPU patches for Halloween 2025 Philippe Mathieu-Daudé
2025-10-31 21:15 ` [PULL 1/9] cpus: Access CPUState::thread_kicked atomically Philippe Mathieu-Daudé
2025-10-31 21:15 ` [PULL 2/9] accel/hvf: Make async_safe_run_on_cpu() safe Philippe Mathieu-Daudé
2025-10-31 21:15 ` [PULL 3/9] accel/tcg: Use cpu_is_stopped() helper to access CPUState::stopped Philippe Mathieu-Daudé
2025-10-31 21:15 ` [PULL 4/9] bql: Fix bql_locked status with condvar APIs Philippe Mathieu-Daudé
2025-10-31 21:15 ` Philippe Mathieu-Daudé [this message]
2025-10-31 21:15 ` [PULL 6/9] timers: properly prefix init_clocks() Philippe Mathieu-Daudé
2025-10-31 21:15 ` [PULL 7/9] util/hexdump: fix QEMU_HEXDUMP_LINE_WIDTH logic Philippe Mathieu-Daudé
2025-10-31 21:15 ` [PULL 8/9] tests/unit: add unit test for qemu_hexdump() Philippe Mathieu-Daudé
2025-10-31 21:15 ` [PULL 9/9] rx: cpu: fix interrupts check in rx_cpu_do_interrupt() Philippe Mathieu-Daudé
2025-11-01 11:13 ` [PULL 0/9] Accelerators & CPU patches for Halloween 2025 Richard Henderson
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=20251031211518.38503-6-philmd@linaro.org \
--to=philmd@linaro.org \
--cc=qemu-devel@nongnu.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;
as well as URLs for NNTP newsgroup(s).