Re: [PATCH v2] memory: prevent dma-reentracy issues

2022-10-25 Thread Peter Maydell
On Mon, 24 Oct 2022 at 19:46, Stefan Hajnoczi wrote: > > On Thu, Oct 20, 2022 at 06:11:06PM -0400, Alexander Bulekov wrote: > > Taking a stab at this. Here is the list of DMA APIs that appear to need > > changes: > > dma_memory_valid (1 usage) > > dma_memory_rw (~5 uses) > > dma_memory_read (~92 u

Re: [PATCH v2] memory: prevent dma-reentracy issues

2022-10-24 Thread Stefan Hajnoczi
On Thu, Oct 20, 2022 at 06:11:06PM -0400, Alexander Bulekov wrote: > On 220712 1034, Stefan Hajnoczi wrote: > > On Tue, Jun 21, 2022 at 11:53:06AM -0400, Alexander Bulekov wrote: > > > On 220621 1630, Peter Maydell wrote: > > > > On Thu, 9 Jun 2022 at 14:59, Alexander Bulekov wrote: > > > > > diff

Re: [PATCH v2] memory: prevent dma-reentracy issues

2022-10-20 Thread Alexander Bulekov
On 220712 1034, Stefan Hajnoczi wrote: > On Tue, Jun 21, 2022 at 11:53:06AM -0400, Alexander Bulekov wrote: > > On 220621 1630, Peter Maydell wrote: > > > On Thu, 9 Jun 2022 at 14:59, Alexander Bulekov wrote: > > > > diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h > > > > index 44dacfa224

Re: [PATCH v2] memory: prevent dma-reentracy issues

2022-07-13 Thread Stefan Hajnoczi
On Wed, 13 Jul 2022 at 16:51, Alexander Bulekov wrote: > > On 220712 1034, Stefan Hajnoczi wrote: > > On Tue, Jun 21, 2022 at 11:53:06AM -0400, Alexander Bulekov wrote: > > > On 220621 1630, Peter Maydell wrote: > > > > On Thu, 9 Jun 2022 at 14:59, Alexander Bulekov wrote: > > > > > diff --git a/

Re: [PATCH v2] memory: prevent dma-reentracy issues

2022-07-13 Thread Alexander Bulekov
On 220712 1034, Stefan Hajnoczi wrote: > On Tue, Jun 21, 2022 at 11:53:06AM -0400, Alexander Bulekov wrote: > > On 220621 1630, Peter Maydell wrote: > > > On Thu, 9 Jun 2022 at 14:59, Alexander Bulekov wrote: > > > > diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h > > > > index 44dacfa224

Re: [PATCH v2] memory: prevent dma-reentracy issues

2022-07-12 Thread Stefan Hajnoczi
On Tue, Jun 21, 2022 at 11:53:06AM -0400, Alexander Bulekov wrote: > On 220621 1630, Peter Maydell wrote: > > On Thu, 9 Jun 2022 at 14:59, Alexander Bulekov wrote: > > > diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h > > > index 44dacfa224..ab1ad0f7a8 100644 > > > --- a/include/hw/pci/pc

Re: [PATCH v2] memory: prevent dma-reentracy issues

2022-06-21 Thread Alexander Bulekov
On 220621 1630, Peter Maydell wrote: > On Thu, 9 Jun 2022 at 14:59, Alexander Bulekov wrote: > > > > Add a flag to the DeviceState, when a device is engaged in PIO/MMIO/DMA. > > This flag is set/checked prior to calling a device's MemoryRegion > > handlers, and set when device code initiates DMA.

Re: [PATCH v2] memory: prevent dma-reentracy issues

2022-06-21 Thread Peter Maydell
On Thu, 9 Jun 2022 at 14:59, Alexander Bulekov wrote: > > Add a flag to the DeviceState, when a device is engaged in PIO/MMIO/DMA. > This flag is set/checked prior to calling a device's MemoryRegion > handlers, and set when device code initiates DMA. The purpose of this > flag is to prevent two t

Re: [PATCH v2] memory: prevent dma-reentracy issues

2022-06-21 Thread Alexander Bulekov
On 220621 1034, David Hildenbrand wrote: > On 09.06.22 15:58, Alexander Bulekov wrote: > > Add a flag to the DeviceState, when a device is engaged in PIO/MMIO/DMA. > > This flag is set/checked prior to calling a device's MemoryRegion > > handlers, and set when device code initiates DMA. The purpos

Re: [PATCH v2] memory: prevent dma-reentracy issues

2022-06-21 Thread David Hildenbrand
On 09.06.22 15:58, Alexander Bulekov wrote: > Add a flag to the DeviceState, when a device is engaged in PIO/MMIO/DMA. > This flag is set/checked prior to calling a device's MemoryRegion > handlers, and set when device code initiates DMA. The purpose of this > flag is to prevent two types of DMA-b

Re: [PATCH v2] memory: prevent dma-reentracy issues

2022-06-20 Thread Alexander Bulekov
On 220609 0958, Alexander Bulekov wrote: > Add a flag to the DeviceState, when a device is engaged in PIO/MMIO/DMA. > This flag is set/checked prior to calling a device's MemoryRegion > handlers, and set when device code initiates DMA. The purpose of this > flag is to prevent two types of DMA-base

[PATCH v2] memory: prevent dma-reentracy issues

2022-06-09 Thread Alexander Bulekov
Add a flag to the DeviceState, when a device is engaged in PIO/MMIO/DMA. This flag is set/checked prior to calling a device's MemoryRegion handlers, and set when device code initiates DMA. The purpose of this flag is to prevent two types of DMA-based reentrancy issues: 1.) mmio -> dma -> mmio cas