[PATCH v8 5/8] memory: Allow disabling re-entrancy checking per-MR

Alexander Bulekov posted 8 patches 2 years, 9 months ago
Maintainers: Stefano Stabellini <sstabellini@kernel.org>, Anthony Perard <anthony.perard@citrix.com>, Paul Durrant <paul@xen.org>, Stefan Hajnoczi <stefanha@redhat.com>, Kevin Wolf <kwolf@redhat.com>, Hanna Reitz <hreitz@redhat.com>, "Michael S. Tsirkin" <mst@redhat.com>, Laurent Vivier <lvivier@redhat.com>, Amit Shah <amit@kernel.org>, "Marc-André Lureau" <marcandre.lureau@redhat.com>, Paolo Bonzini <pbonzini@redhat.com>, Gerd Hoffmann <kraxel@redhat.com>, John Snow <jsnow@redhat.com>, Peter Maydell <peter.maydell@linaro.org>, "Philippe Mathieu-Daudé" <philmd@linaro.org>, Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>, Jason Wang <jasowang@redhat.com>, Keith Busch <kbusch@kernel.org>, Klaus Jensen <its@irrelevant.dk>, Fam Zheng <fam@euphon.net>, Dmitry Fleytman <dmitry.fleytman@gmail.com>, David Hildenbrand <david@redhat.com>, "Gonglei (Arei)" <arei.gonglei@huawei.com>, Peter Xu <peterx@redhat.com>, "Daniel P. Berrangé" <berrange@redhat.com>, Eduardo Habkost <eduardo@habkost.net>
There is a newer version of this series
[PATCH v8 5/8] memory: Allow disabling re-entrancy checking per-MR
Posted by Alexander Bulekov 2 years, 9 months ago
Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
Reviewed-by: Thomas Huth <thuth@redhat.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
---
 include/exec/memory.h | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/include/exec/memory.h b/include/exec/memory.h
index 6c0a5e68d3..4e9531bd8a 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -793,6 +793,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 {
-- 
2.39.0
Re: [PATCH v8 5/8] memory: Allow disabling re-entrancy checking per-MR
Posted by Thomas Huth 2 years, 9 months ago
On 21/04/2023 16.27, Alexander Bulekov wrote:
> Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
> Reviewed-by: Thomas Huth <thuth@redhat.com>
> Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
> ---
>   include/exec/memory.h | 3 +++
>   1 file changed, 3 insertions(+)
> 
> diff --git a/include/exec/memory.h b/include/exec/memory.h
> index 6c0a5e68d3..4e9531bd8a 100644
> --- a/include/exec/memory.h
> +++ b/include/exec/memory.h
> @@ -793,6 +793,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 {

Oh, wait, that check for "!mr->disable_reentrancy_guard" has been squashed 
into the first patch now ... that's bad, I think you should squash this into 
the first patch now, too!

  Thomas
Re: [PATCH v8 5/8] memory: Allow disabling re-entrancy checking per-MR
Posted by Alexander Bulekov 2 years, 9 months ago
On 230425 0941, Thomas Huth wrote:
> On 21/04/2023 16.27, Alexander Bulekov wrote:
> > Signed-off-by: Alexander Bulekov <alxndr@bu.edu>
> > Reviewed-by: Thomas Huth <thuth@redhat.com>
> > Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
> > ---
> >   include/exec/memory.h | 3 +++
> >   1 file changed, 3 insertions(+)
> > 
> > diff --git a/include/exec/memory.h b/include/exec/memory.h
> > index 6c0a5e68d3..4e9531bd8a 100644
> > --- a/include/exec/memory.h
> > +++ b/include/exec/memory.h
> > @@ -793,6 +793,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 {
> 
> Oh, wait, that check for "!mr->disable_reentrancy_guard" has been squashed
> into the first patch now ... that's bad, I think you should squash this into
> the first patch now, too!
> 

Oh.. Thanks for catching that.