Re: [PATCH v3] memory: Directly dispatch alias accesses on origin memory region

2021-04-21 Thread Peter Xu
On Wed, Apr 21, 2021 at 11:33:55AM +0100, Mark Cave-Ayland wrote: > On 20/04/2021 21:59, Peter Xu wrote: > > > > > I agree with this sentiment: it has taken me a while to figure out what > > > > was happening, and that was only because I spotted accesses being > > > > rejected with -d

Re: [PATCH v3] memory: Directly dispatch alias accesses on origin memory region

2021-04-21 Thread Peter Maydell
On Tue, 20 Apr 2021 at 21:59, Peter Xu wrote: > I think it should always be a valid request to trigger memory access via the > MR > layer, say, what if the caller has no address space context at all? From the > name of memory_region_dispatch_write|read I don't see either on why we should > not

Re: [PATCH v3] memory: Directly dispatch alias accesses on origin memory region

2021-04-21 Thread Mark Cave-Ayland
On 20/04/2021 21:59, Peter Xu wrote: I agree with this sentiment: it has taken me a while to figure out what was happening, and that was only because I spotted accesses being rejected with -d guest_errors. From my perspective the names memory_region_dispatch_read() and

Re: [PATCH v3] memory: Directly dispatch alias accesses on origin memory region

2021-04-20 Thread Peter Xu
On Tue, Apr 20, 2021 at 11:10:26AM +0200, Philippe Mathieu-Daudé wrote: > On 4/20/21 9:00 AM, Mark Cave-Ayland wrote: > > On 19/04/2021 21:58, Philippe Mathieu-Daudé wrote: > > > >> Hi Mark, > >> > >> On 4/19/21 10:13 PM, Mark Cave-Ayland wrote: > >>> On 17/04/2021 15:02, Philippe Mathieu-Daudé

Re: [PATCH v3] memory: Directly dispatch alias accesses on origin memory region

2021-04-20 Thread Philippe Mathieu-Daudé
On 4/20/21 9:00 AM, Mark Cave-Ayland wrote: > On 19/04/2021 21:58, Philippe Mathieu-Daudé wrote: > >> Hi Mark, >> >> On 4/19/21 10:13 PM, Mark Cave-Ayland wrote: >>> On 17/04/2021 15:02, Philippe Mathieu-Daudé wrote: >>> Since commit 2cdfcf272d ("memory: assign MemoryRegionOps to all

Re: [PATCH v3] memory: Directly dispatch alias accesses on origin memory region

2021-04-20 Thread Mark Cave-Ayland
On 19/04/2021 22:11, Philippe Mathieu-Daudé wrote: My patch might not be the proper fix, but we need to figure out how to avoid others to hit the same problem, as it is very hard to debug. At least an assertion and a comment. Something like: -- >8 -- diff --git a/softmmu/memory.c

Re: [PATCH v3] memory: Directly dispatch alias accesses on origin memory region

2021-04-20 Thread Mark Cave-Ayland
On 19/04/2021 21:58, Philippe Mathieu-Daudé wrote: Hi Mark, On 4/19/21 10:13 PM, Mark Cave-Ayland wrote: On 17/04/2021 15:02, Philippe Mathieu-Daudé wrote: Since commit 2cdfcf272d ("memory: assign MemoryRegionOps to all regions"), all newly created regions are assigned with

Re: [PATCH v3] memory: Directly dispatch alias accesses on origin memory region

2021-04-19 Thread Philippe Mathieu-Daudé
On Mon, Apr 19, 2021 at 10:58 PM Philippe Mathieu-Daudé wrote: > On 4/19/21 10:13 PM, Mark Cave-Ayland wrote: > > On 17/04/2021 15:02, Philippe Mathieu-Daudé wrote: > > > >> Since commit 2cdfcf272d ("memory: assign MemoryRegionOps to all > >> regions"), all newly created regions are assigned with

Re: [PATCH v3] memory: Directly dispatch alias accesses on origin memory region

2021-04-19 Thread Philippe Mathieu-Daudé
Hi Mark, On 4/19/21 10:13 PM, Mark Cave-Ayland wrote: > On 17/04/2021 15:02, Philippe Mathieu-Daudé wrote: > >> Since commit 2cdfcf272d ("memory: assign MemoryRegionOps to all >> regions"), all newly created regions are assigned with >> unassigned_mem_ops (which might be then overwritten). >> >>

Re: [PATCH v3] memory: Directly dispatch alias accesses on origin memory region

2021-04-19 Thread Mark Cave-Ayland
On 17/04/2021 15:02, Philippe Mathieu-Daudé wrote: Since commit 2cdfcf272d ("memory: assign MemoryRegionOps to all regions"), all newly created regions are assigned with unassigned_mem_ops (which might be then overwritten). When using aliased container regions, and there is no region mapped at

[PATCH v3] memory: Directly dispatch alias accesses on origin memory region

2021-04-17 Thread Philippe Mathieu-Daudé
Since commit 2cdfcf272d ("memory: assign MemoryRegionOps to all regions"), all newly created regions are assigned with unassigned_mem_ops (which might be then overwritten). When using aliased container regions, and there is no region mapped at address 0 in the container, the