[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v7 5/6] memory: Allow disabling re-entrancy checking per-MR
From: |
Darren Kenny |
Subject: |
Re: [PATCH v7 5/6] memory: Allow disabling re-entrancy checking per-MR |
Date: |
Mon, 13 Mar 2023 12:21:29 +0000 |
On Monday, 2023-03-13 at 04:24:16 -04, Alexander Bulekov wrote:
> Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
> ---
> include/exec/memory.h | 3 +++
> softmmu/memory.c | 2 +-
> 2 files changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/include/exec/memory.h b/include/exec/memory.h
> index 6fa0b071f0..5154b123d8 100644
> --- a/include/exec/memory.h
> +++ b/include/exec/memory.h
> @@ -791,6 +791,9 @@ struct MemoryRegion {
> unsigned ioeventfd_nb;
> MemoryRegionIoeventfd *ioeventfds;
> RamDiscardManager *rdm; /* Only for RAM */
> +
> + /* For devices designed to perform re-entrant IO into their own IO MRs */
> + bool disable_reentrancy_guard;
> };
>
> struct IOMMUMemoryRegion {
> diff --git a/softmmu/memory.c b/softmmu/memory.c
> index 57bf18a257..3018fa2edb 100644
> --- a/softmmu/memory.c
> +++ b/softmmu/memory.c
> @@ -544,7 +544,7 @@ static MemTxResult access_with_adjusted_size(hwaddr addr,
> }
>
> /* Do not allow more than one simultanous access to a device's IO
> Regions */
> - if (mr->owner &&
> + if (mr->owner && !mr->disable_reentrancy_guard &&
> !mr->ram_device && !mr->ram && !mr->rom_device && !mr->readonly) {
> dev = (DeviceState *) object_dynamic_cast(mr->owner, TYPE_DEVICE);
> if (dev) {
> --
> 2.39.0
- [PATCH v7 0/6] memory: prevent dma-reentracy issues, Alexander Bulekov, 2023/03/13
- [PATCH v7 2/6] async: Add an optional reentrancy guard to the BH API, Alexander Bulekov, 2023/03/13
- [PATCH v7 3/6] checkpatch: add qemu_bh_new/aio_bh_new checks, Alexander Bulekov, 2023/03/13
- [PATCH v7 5/6] memory: Allow disabling re-entrancy checking per-MR, Alexander Bulekov, 2023/03/13
- [PATCH v7 4/6] hw: replace most qemu_bh_new calls with qemu_bh_new_guarded, Alexander Bulekov, 2023/03/13
- [PATCH v7 6/6] lsi53c895a: disable reentrancy detection for script RAM, Alexander Bulekov, 2023/03/13
- Re: [PATCH v7 0/6] memory: prevent dma-reentracy issues, Thomas Huth, 2023/03/13