From: Simon Guo <wei.guo.simon@linux.alibaba.com>
To: Alex Williamson <alex.williamson@redhat.com>,
Eric Auger <eric.auger@redhat.com>
Cc: qixuan.wu@linux.alibaba.com, linux-kernel@vger.kernel.org,
kvm@vger.kernel.org
Subject: Can VFIO pin only a specific region of guest mem when use pass through devices?
Date: Mon, 29 Oct 2018 10:42:28 +0800 [thread overview]
Message-ID: <20181029024228.GA4279@simonLocalRHEL7.x64> (raw)
Hi,
I am using network device pass through mode with qemu x86(-device vfio-pci,host=0000:xx:yy.z)
and “intel_iommu=on” in host kernel command line, and it shows the whole guest memory
were pinned(vfio_pin_pages()), viewed by the “top” RES memory output. I understand it is due
to device can DMA to any guest memory address and it cannot be swapped.
However can we just pin a rang of address space allowed by iommu group of that device,
instead of pin whole address space? I do notice some code like vtd_host_dma_iommu().
Maybe there is already some way to enable that?
Sorry if I missed some basics. I googled some but no luck to find the answer yet. Please
let me know if any discussion already raised on that.
Any other suggestion will also be appreciated. For example, can we modify the guest network
card driver to allocate only from a specific memory region(zone), and qemu advises guest
kernel to only pin that memory region(zone) accordingly?
Thanks,
- Simon
next reply other threads:[~2018-10-29 2:42 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-10-29 2:42 Simon Guo [this message]
2018-10-29 9:14 ` Can VFIO pin only a specific region of guest mem when use pass through devices? Jason Wang
2018-10-29 18:29 ` Alex Williamson
2018-10-30 3:00 ` Peter Xu
2018-10-30 11:22 ` Simon Guo
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=20181029024228.GA4279@simonLocalRHEL7.x64 \
--to=wei.guo.simon@linux.alibaba.com \
--cc=alex.williamson@redhat.com \
--cc=eric.auger@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=qixuan.wu@linux.alibaba.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