[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] memory: check write/read_with_attrs in memory d
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PATCH] memory: check write/read_with_attrs in memory dispatch |
Date: |
Tue, 13 Nov 2018 09:49:28 +0000 |
On 13 November 2018 at 01:42, Li Qiang <address@hidden> wrote:
> This can avoid the NULL-deref if the rm doesn't has a
> read/write nor write/read_with_attrs callback.
>
> Signed-off-by: Li Qiang <address@hidden>
> ---
> memory.c | 8 ++++++--
> 1 file changed, 6 insertions(+), 2 deletions(-)
Alternative approach -- assert that every MemoryRegionOps has
pointers to callbacks in it, when it is registered in memory_region_init_io()
and memory_region_init_rom_device_nomigrate().
I don't have a strong opinion on which is better, but I guess
I slightly favour requiring devices to be specific about what
their read/write behaviour is.
Do we have many devices that legitimately only want to implement
one of read and write, not both ?
thanks
-- PMM