From: Alex Williamson <alex.williamson@redhat.com>
To: Cindy Lu <lulu@redhat.com>
Cc: jasowang@redhat.com, mst@redhat.com, pbonzini@redhat.com,
peterx@redhat.com, david@redhat.com, f4bug@amsat.org,
sgarzare@redhat.com, qemu-devel@nongnu.org
Subject: Re: [PATCH v3 1/2] vfio: move the function vfio_get_xlat_addr() to memory.c
Date: Tue, 25 Oct 2022 10:55:18 -0600 [thread overview]
Message-ID: <20221025105518.0a56c662.alex.williamson@redhat.com> (raw)
In-Reply-To: <20221025163734.965367-2-lulu@redhat.com>
On Wed, 26 Oct 2022 00:37:33 +0800
Cindy Lu <lulu@redhat.com> wrote:
> diff --git a/softmmu/memory.c b/softmmu/memory.c
> index 7ba2048836..03940c551d 100644
> --- a/softmmu/memory.c
> +++ b/softmmu/memory.c
...
> + /*
> + * Malicious VMs might trigger discarding of IOMMU-mapped memory. The
> + * pages will remain pinned inside vfio until unmapped, resulting in a
> + * higher memory consumption than expected. If memory would get
> + * populated again later, there would be an inconsistency between pages
> + * pinned by vfio and pages seen by QEMU. This is the case until
> + * unmapped from the IOMMU (e.g., during device reset).
> + *
> + * With malicious guests, we really only care about pinning more memory
> + * than expected. RLIMIT_MEMLOCK set for the user/process can never be
> + * exceeded and can be used to mitigate this problem.
> + */
> + warn_report_once("Using vfio with vIOMMUs and coordinated discarding of"
> + " RAM (e.g., virtio-mem) works, however, malicious"
> + " guests can trigger pinning of more memory than"
> + " intended via an IOMMU. It's possible to mitigate "
> + " by setting/adjusting RLIMIT_MEMLOCK.");
Looks like the comment and warning still need to be generalized for
shared use here. Thanks,
Alex
next prev parent reply other threads:[~2022-10-25 16:56 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-25 16:37 [PATCH v3 0/2] vhost-vdpa: add support for vIOMMU Cindy Lu
2022-10-25 16:37 ` [PATCH v3 1/2] vfio: move the function vfio_get_xlat_addr() to memory.c Cindy Lu
2022-10-25 16:55 ` Alex Williamson [this message]
2022-10-26 20:40 ` Michael S. Tsirkin
2022-10-27 6:27 ` Cindy Lu
2022-10-25 16:37 ` [PATCH v3 2/2] vhost-vdpa: add support for vIOMMU Cindy Lu
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=20221025105518.0a56c662.alex.williamson@redhat.com \
--to=alex.williamson@redhat.com \
--cc=david@redhat.com \
--cc=f4bug@amsat.org \
--cc=jasowang@redhat.com \
--cc=lulu@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=sgarzare@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).