From: David Hildenbrand <david@redhat.com>
To: Alexander Bulekov <alxndr@bu.edu>, qemu-devel@nongnu.org
Cc: "Philippe Mathieu-Daudé" <philmd@redhat.com>,
"Mauro Matteo Cascella" <mcascell@redhat.com>,
"Qiuhao Li" <Qiuhao.Li@outlook.com>,
"Peter Xu" <peterx@redhat.com>,
"Jason Wang" <jasowang@redhat.com>,
"Gerd Hoffmann" <kraxel@redhat.com>,
"Peter Maydell" <peter.maydell@linaro.org>,
"Li Qiang" <liq3ea@gmail.com>, "Thomas Huth" <thuth@redhat.com>,
"Laurent Vivier" <lvivier@redhat.com>,
"Bandan Das" <bsd@redhat.com>,
"Edgar E . Iglesias" <edgar.iglesias@gmail.com>,
"Darren Kenny" <darren.kenny@oracle.com>,
"Bin Meng" <bin.meng@windriver.com>,
"Paolo Bonzini" <pbonzini@redhat.com>,
"Stefan Hajnoczi" <stefanha@redhat.com>,
"Daniel P. Berrangé" <berrange@redhat.com>,
"Eduardo Habkost" <eduardo@habkost.net>
Subject: Re: [PATCH v2 1/3] memory: Track whether a Device is engaged in IO
Date: Mon, 30 May 2022 14:13:22 +0200 [thread overview]
Message-ID: <82fc8909-bf73-f2e6-0810-eea8761a417b@redhat.com> (raw)
In-Reply-To: <20220527161937.328754-2-alxndr@bu.edu>
On 27.05.22 18:19, Alexander Bulekov wrote:
> Add a flag to the DeviceState, when a device is engaged in PIO/MMIO/DMA.
> This flag should be 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 DMA reentrancy issues. E.g.:
> sdhci pio -> dma write -> sdhci mmio
> nvme bh -> dma write -> nvme mmio
>
> These issues have led to problems such as stack-exhaustion and
> use-after-frees.
>
> Assumptions:
> * Devices do not interact with their own PIO/MMIO memory-regions using
> DMA.
>
> * There is now way for there to be multiple simultaneous accesses to a
> device's PIO/MMIO memory-regions, or for multiple threads to perform
> DMA accesses simultaneously on behalf of a single device.
>
> Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
I think this patch should be squashed into the other ones, it doesn't
make particular sense without any actual users.
--
Thanks,
David / dhildenb
next prev parent reply other threads:[~2022-05-30 12:17 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-27 16:19 [PATCH v2 0/3] Fix dma-reentrancy issues Alexander Bulekov
2022-05-27 16:19 ` [PATCH v2 1/3] memory: Track whether a Device is engaged in IO Alexander Bulekov
2022-05-30 9:58 ` Darren Kenny
2022-05-30 11:19 ` Peter Maydell
2022-05-30 13:09 ` Alexander Bulekov
2022-05-30 13:28 ` Peter Maydell
2022-05-30 13:39 ` Philippe Mathieu-Daudé via
2022-05-30 14:04 ` Alexander Bulekov
2022-05-30 13:41 ` Alexander Bulekov
2022-05-30 12:13 ` David Hildenbrand [this message]
2022-05-27 16:19 ` [PATCH v2 2/3] memory: fix PIO/MMIO-initiated dma-reentracy issues Alexander Bulekov
2022-05-27 16:19 ` [PATCH v2 3/3] memory: fix bh-initiated " Alexander Bulekov
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=82fc8909-bf73-f2e6-0810-eea8761a417b@redhat.com \
--to=david@redhat.com \
--cc=Qiuhao.Li@outlook.com \
--cc=alxndr@bu.edu \
--cc=berrange@redhat.com \
--cc=bin.meng@windriver.com \
--cc=bsd@redhat.com \
--cc=darren.kenny@oracle.com \
--cc=edgar.iglesias@gmail.com \
--cc=eduardo@habkost.net \
--cc=jasowang@redhat.com \
--cc=kraxel@redhat.com \
--cc=liq3ea@gmail.com \
--cc=lvivier@redhat.com \
--cc=mcascell@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=peterx@redhat.com \
--cc=philmd@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=stefanha@redhat.com \
--cc=thuth@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).