Re: [RFC PATCH] memory: Fix dma-reentrancy issues at the MMIO level

2021-12-17 Thread Alexander Bulekov
On 211217 1625, Philippe Mathieu-Daudé wrote: > On 12/17/21 15:30, Alexander Bulekov wrote: > > On 211217 1458, Philippe Mathieu-Daudé wrote: > >> On 12/17/21 04:08, Alexander Bulekov wrote: > >>> Here's my shot at fixing dma-reentracy issues. This patch adds a flag to > >>> the DeviceState, which

Re: [RFC PATCH] memory: Fix dma-reentrancy issues at the MMIO level

2021-12-17 Thread Philippe Mathieu-Daudé
On 12/17/21 15:30, Alexander Bulekov wrote: > On 211217 1458, Philippe Mathieu-Daudé wrote: >> On 12/17/21 04:08, Alexander Bulekov wrote: >>> Here's my shot at fixing dma-reentracy issues. This patch adds a flag to >>> the DeviceState, which is set/checked when we call an accessor >>> associated w

Re: [RFC PATCH] memory: Fix dma-reentrancy issues at the MMIO level

2021-12-17 Thread Alexander Bulekov
On 211217 1458, Philippe Mathieu-Daudé wrote: > On 12/17/21 04:08, Alexander Bulekov wrote: > > Here's my shot at fixing dma-reentracy issues. This patch adds a flag to > > the DeviceState, which is set/checked when we call an accessor > > associated with the device's IO MRs. > > Your approach is

Re: [RFC PATCH] memory: Fix dma-reentrancy issues at the MMIO level

2021-12-17 Thread Alexander Bulekov
gt; ; David Hildenbrand ; Gerd Hoffmann > ; Peter Maydell ; Li Qiang > ; Thomas Huth ; Laurent Vivier > ; Bandan Das ; Edgar E . Iglesias > ; Darren Kenny ; Bin Meng > ; Paolo Bonzini ; Stefan > Hajnoczi ; Daniel P. Berrangé ; > Eduardo Habkost > Subject: [RFC PATCH]

Re: [RFC PATCH] memory: Fix dma-reentrancy issues at the MMIO level

2021-12-17 Thread Philippe Mathieu-Daudé
On 12/17/21 04:08, Alexander Bulekov wrote: > Here's my shot at fixing dma-reentracy issues. This patch adds a flag to > the DeviceState, which is set/checked when we call an accessor > associated with the device's IO MRs. Your approach is exactly what Gerd suggested: https://www.mail-archive.com/

Re: [RFC PATCH] memory: Fix dma-reentrancy issues at the MMIO level

2021-12-17 Thread Mauro Matteo Cascella
On Fri, Dec 17, 2021 at 7:28 AM Qiuhao Li wrote: > > Thanks Alex. It seems this patch sets and checks if the destination device is > busy. But how about the data transfers not triggered directly by PMIO/MMIO > handlers? For example: > > 1. Device A Timer's callback -> Device A MMIO handler > 2.

Re: [RFC PATCH] memory: Fix dma-reentrancy issues at the MMIO level

2021-12-17 Thread Qiuhao Li
Eduardo Habkost; Darren Kenny; Bandan Das; Gerd Hoffmann; Stefan Hajnoczi; Paolo Bonzini; Edgar E . Iglesias; Philippe Mathieu-Daudé Subject: Re: [RFC PATCH] memory: Fix dma-reentrancy issues at the MMIO level On Dec 17 06:27, Qiuhao Li wrote: > Thanks Alex. It seems this patch sets and checks

Re: [RFC PATCH] memory: Fix dma-reentrancy issues at the MMIO level

2021-12-17 Thread Klaus Jensen
On Dec 17 06:27, Qiuhao Li wrote: > Thanks Alex. It seems this patch sets and checks if the destination device is > busy. But how about the data transfers not triggered directly by PMIO/MMIO > handlers? For example: > > 1. Device A Timer's callback -> Device A MMIO handler > 2. Device A BH's cal

Re: [RFC PATCH] memory: Fix dma-reentrancy issues at the MMIO level

2021-12-16 Thread Qiuhao Li
ascella ; Qiuhao Li ; Peter Xu ; Jason Wang ; David Hildenbrand ; Gerd Hoffmann ; Peter Maydell ; Li Qiang ; Thomas Huth ; Laurent Vivier ; Bandan Das ; Edgar E . Iglesias ; Darren Kenny ; Bin Meng ; Paolo Bonzini ; Stefan Hajnoczi ; Daniel P. Berrangé ; Eduardo Habkost Subject: [RFC PATC

[RFC PATCH] memory: Fix dma-reentrancy issues at the MMIO level

2021-12-16 Thread Alexander Bulekov
Here's my shot at fixing dma-reentracy issues. This patch adds a flag to the DeviceState, which is set/checked when we call an accessor associated with the device's IO MRs. The problem, in short, as I understand it: For the vast majority of cases, we want to prevent a device from accessing it's ow