mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jason Wang <jasowang@redhat.com>
To: Simon Guo <wei.guo.simon@linux.alibaba.com>,
	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, Peter Xu <peterx@redhat.com>
Subject: Re: Can VFIO pin only a specific region of guest mem when use pass through devices?
Date: Mon, 29 Oct 2018 17:14:46 +0800	[thread overview]
Message-ID: <e4be89df-2bf9-76a2-497f-c6ba3256c95a@redhat.com> (raw)
In-Reply-To: <20181029024228.GA4279@simonLocalRHEL7.x64>


On 2018/10/29 上午10:42, Simon Guo wrote:
> 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


One possible method is to enable IOMMU of VM.

Peter (cced) may know more.

Thanks


  reply	other threads:[~2018-10-29  9:15 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-29  2:42 Simon Guo
2018-10-29  9:14 ` Jason Wang [this message]
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=e4be89df-2bf9-76a2-497f-c6ba3256c95a@redhat.com \
    --to=jasowang@redhat.com \
    --cc=alex.williamson@redhat.com \
    --cc=eric.auger@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peterx@redhat.com \
    --cc=qixuan.wu@linux.alibaba.com \
    --cc=wei.guo.simon@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

all inboxes | Powered by JetHome®