All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] docs/devel: memory: Document MemoryRegionOps requirement
@ 2021-09-06 12:20 Bin Meng
  2021-09-06 12:25 ` David Hildenbrand
  2021-09-06 13:01 ` Philippe Mathieu-Daudé
  0 siblings, 2 replies; 6+ messages in thread
From: Bin Meng @ 2021-09-06 12:20 UTC (permalink / raw)
  To: David Hildenbrand, Paolo Bonzini, Peter Xu
  Cc: Peter Maydell, Philippe Mathieu-Daudé, qemu-devel

It's been a requirement that at least one function pointer for read
and one for write are provided ever since the MemoryRegion APIs were
introduced in 2012.

Signed-off-by: Bin Meng <bmeng.cn@gmail.com>
---

 docs/devel/memory.rst | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/docs/devel/memory.rst b/docs/devel/memory.rst
index 5dc8a12682..7b589b21d2 100644
--- a/docs/devel/memory.rst
+++ b/docs/devel/memory.rst
@@ -344,6 +344,11 @@ based on the attributes used for the memory transaction, or need
 to be able to respond that the access should provoke a bus error
 rather than completing successfully; those devices can use the
 ->read_with_attrs() and ->write_with_attrs() callbacks instead.
+The requirement for a device's MemoryRegionOps is that at least
+one callback for read and one for write are provided. If both
+->read() and ->read_with_attrs() are provided, the plain ->read()
+version takes precedence over the with_attrs() version. So does
+the write callback.
 
 In addition various constraints can be supplied to control how these
 callbacks are called:
-- 
2.25.1



^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-10-02 14:39 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-06 12:20 [PATCH] docs/devel: memory: Document MemoryRegionOps requirement Bin Meng
2021-09-06 12:25 ` David Hildenbrand
2021-09-06 13:01 ` Philippe Mathieu-Daudé
2021-09-08 18:50   ` Peter Xu
2021-09-08 20:17     ` Philippe Mathieu-Daudé
2021-10-02 14:37       ` Bin Meng

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.