From: Matthew Rosato <mjrosato@linux.ibm.com>
To: Cornelia Huck <cohuck@redhat.com>
Cc: alex.williamson@redhat.com, pmorel@linux.ibm.com,
schnelle@linux.ibm.com, kvm@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] vfio iommu: Add dma available capability
Date: Tue, 15 Sep 2020 09:22:13 -0400 [thread overview]
Message-ID: <1e4ff5b6-f2de-228c-3cfb-5dee833000aa@linux.ibm.com> (raw)
In-Reply-To: <20200915114401.4db5e009.cohuck@redhat.com>
On 9/15/20 5:44 AM, Cornelia Huck wrote:
> On Mon, 14 Sep 2020 18:25:31 -0400
> Matthew Rosato <mjrosato@linux.ibm.com> wrote:
>
>> Commit 492855939bdb ("vfio/type1: Limit DMA mappings per container")
>> added the ability to limit the number of memory backed DMA mappings.
>> However on s390x, when lazy mapping is in use, we use a very large
>> number of concurrent mappings. Let's provide the current allowable
>> number of DMA mappings to userspace via the IOMMU info chain so that
>> userspace can take appropriate mitigation.
>>
>> Signed-off-by: Matthew Rosato <mjrosato@linux.ibm.com>
>> ---
>> drivers/vfio/vfio_iommu_type1.c | 17 +++++++++++++++++
>> include/uapi/linux/vfio.h | 16 ++++++++++++++++
>> 2 files changed, 33 insertions(+)
>
> (...)
>
>> diff --git a/include/uapi/linux/vfio.h b/include/uapi/linux/vfio.h
>> index 9204705..a8cc4a5 100644
>> --- a/include/uapi/linux/vfio.h
>> +++ b/include/uapi/linux/vfio.h
>> @@ -1039,6 +1039,22 @@ struct vfio_iommu_type1_info_cap_migration {
>> __u64 max_dirty_bitmap_size; /* in bytes */
>> };
>>
>> +/*
>> + * The DMA available capability allows to report the current number of
>> + * simultaneously outstanding DMA mappings that are allowed.
>> + *
>> + * The structures below define version 1 of this capability.
>
> "The structure below defines..." ?
>
OK
>> + *
>> + * max: specifies the maximum number of outstanding DMA mappings allowed.
>
> I think you forgot to tweak that one:
>
> "avail: specifies the current number of outstanding DMA mappings allowed."
>
> ?
Yep, that's a leftover from v1 :(
>
>> + */
>> +#define VFIO_IOMMU_TYPE1_INFO_DMA_AVAIL 3
>> +
>> +struct vfio_iommu_type1_info_dma_avail {
>> + struct vfio_info_cap_header header;
>> + __u32 avail;
>> +};
>> +
>> +
>> #define VFIO_IOMMU_GET_INFO _IO(VFIO_TYPE, VFIO_BASE + 12)
>>
>> /**
>
next prev parent reply other threads:[~2020-09-15 14:24 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-14 22:25 Matthew Rosato
2020-09-14 22:25 ` Matthew Rosato
2020-09-15 9:44 ` Cornelia Huck
2020-09-15 13:22 ` Matthew Rosato [this message]
2020-09-14 22:32 ` Matthew Rosato
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=1e4ff5b6-f2de-228c-3cfb-5dee833000aa@linux.ibm.com \
--to=mjrosato@linux.ibm.com \
--cc=alex.williamson@redhat.com \
--cc=cohuck@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pmorel@linux.ibm.com \
--cc=schnelle@linux.ibm.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
all inboxes | Powered by JetHome®