public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
From: Anthony Liguori <anthony@codemonkey.ws>
To: Muli Ben-Yehuda <muli@il.ibm.com>
Cc: "Kay, Allen M" <allen.m.kay@intel.com>,
	kvm@vger.kernel.org, Amit Shah <amit.shah@qumranet.com>,
	Ben-Ami Yassour1 <BENAMI@il.ibm.com>,
	Avi Kivity <avik@qumranet.com>, Chris Wright <chrisw@redhat.com>,
	"Han, Weidong" <weidong.han@intel.com>
Subject: Re: [PATCH 4/4][VTD] vt-d specific files in KVM
Date: Tue, 10 Jun 2008 10:24:06 -0500	[thread overview]
Message-ID: <484E9C96.7090502@codemonkey.ws> (raw)
In-Reply-To: <20080610151526.GG6702@il.ibm.com>

Muli Ben-Yehuda wrote:
> On Tue, Jun 10, 2008 at 10:02:45AM -0500, Anthony Liguori wrote:
>
>   
>> Why?  Wouldn't MMIO pages have to be mapped in the VT-d page table
>> in order to support pass-through?  It certainly can't hurt, can it?
>>     
>
> By MMIO pages we refer to pages which are mapped (or can mapped) to
> device MMIO regions. In other words, they are only relevant for host
> memory accesses. VT-d mappings are used for *device* memory
> accesses. I can't think of a good reason for a device to try to DMA to
> such a page (where would the DMA end? There is no backing RAM), hence
> the principal of least surprise says that we shouldn't map such pages
> in the IOMMU page tables so that *if* the device tries to DMA to them
> we will take an IOMMU fault rather than fail silently or machine check
> (I've seen both happen with DMAs to MMIO regions).
>   

If you add the MMIO page to the IOMMU table, then the behavior is going 
to be identical to what occurs on bare metal which IMHO is a good 
thing.  Why jump through hoops to change what may or may not be an error 
condition instead of letting the natural error behavior happen?  There 
may be some weird piece of hardware that relies on this behavior out there.

>> I don't think it's at all safe to assume that a slot is either
>> entirely MMIO or entirely RAM.  You could very easily construct a
>> slot that's a mix of both so if this is an attempt to skip MMIO
>> slots, it's broken.
>>     
>
> How would suc a slot be constructed with the current code base? (Note
> that you need Ben's direct MMIO patches to create an MMIO slot).
>   

There is no such thing as an MMIO slot.  All you would need to do is 
mmap(phys_ram_base + GPA, "/sys/bus/pci/.../region/0", MAP_SHARED | 
MAP_FIXED) and you'd have a mixed slot assuming GPA was within an 
existing RAM slot.  Without MMU-notifiers, you'd have to do this before 
the guest started.  With MMU-notifiers, you can do this during execution 
of the guest.

Regards,

Anthony Liguori

> Cheers,
> Muli
>   


  reply	other threads:[~2008-06-10 15:24 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-10  0:43 [PATCH 4/4][VTD] vt-d specific files in KVM Kay, Allen M
2008-06-10 10:27 ` Muli Ben-Yehuda
2008-06-10 14:26   ` Anthony Liguori
2008-06-10 14:56     ` Muli Ben-Yehuda
2008-06-10 15:02       ` Anthony Liguori
2008-06-10 15:15         ` Muli Ben-Yehuda
2008-06-10 15:24           ` Anthony Liguori [this message]
2008-06-10 16:07             ` Muli Ben-Yehuda
2008-06-20 18:24 ` Avi Kivity

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=484E9C96.7090502@codemonkey.ws \
    --to=anthony@codemonkey.ws \
    --cc=BENAMI@il.ibm.com \
    --cc=allen.m.kay@intel.com \
    --cc=amit.shah@qumranet.com \
    --cc=avik@qumranet.com \
    --cc=chrisw@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=muli@il.ibm.com \
    --cc=weidong.han@intel.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