[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks
From: |
Philippe Mathieu-Daudé |
Subject: |
Re: [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks |
Date: |
Mon, 17 Aug 2020 07:26:18 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.11.0 |
On 8/17/20 7:02 AM, P J P wrote:
> +-- On Sun, 16 Aug 2020, Philippe Mathieu-Daudé wrote --+
> | On 8/11/20 1:41 PM, P J P wrote:
> | > From: Prasad J Pandit <pjp@fedoraproject.org>
> | > * This series asserts that MemoryRegionOps objects define read/write
> | > callback methods. Thus avoids potential NULL pointer dereference.
> | > ex. ->
> https://git.qemu.org/?p=qemu.git;a=commit;h=bb15013ef34617eb1344f5276292cadd326c21b2
> | >
> | > * Also adds various undefined MemoryRegionOps read/write functions
> | > to avoid potential assert failure.
> |
> | What about read_with_attrs()/write_with_attrs()? It seems they are part of
> | the same problem.
>
> * read/write_with_attrs function is called if read/write callback is not
> defined
>
> ../softmmu/memory.c
> if (mr->ops->write) {
> ... memory_region_write_accessor, mr,
> } else {
> ... memory_region_write_with_attrs_accessor,
>
> So, defining read/write methods may also address read/write_with_attrs
> issue?
>
> * $ grep -Eri -A 5 -B 5 '(\.read_with_attrs|\.write_with_attrs)' . | fpaste
>
> -> https://paste.centos.org/view/386c9597
>
> It doesn't show an occurrence where one of the read/write_with_attrs is
> missing.
>
> * Nevertheless, if we need to define read/write_with_attrs routines, because
> memory_region_init_io() would assert(3) for them
>
> could that be a subsequent patch series please?
Yes no problem, I was just wondering and wasn't sure.
- Re: [PATCH v4 6/9] spapr_pci: add spapr msi read method, (continued)
- [PATCH v4 7/9] tz-ppc: add dummy read/write methods, P J P, 2020/08/11
- [PATCH v4 8/9] imx7-ccm: add digprog mmio write method, P J P, 2020/08/11
- [PATCH v4 9/9] memory: assert MemoryRegionOps callbacks are defined, P J P, 2020/08/11
- Re: [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks, David Gibson, 2020/08/13
- Re: [PATCH v4 0/9] memory: assert and define MemoryRegionOps callbacks, Philippe Mathieu-Daudé, 2020/08/16