From: Keir Fraser <keir.fraser@eu.citrix.com>
To: "Han, Weidong" <weidong.han@intel.com>,
Espen Skoglund <espen.skoglund@netronome.com>
Cc: joshua.levasseur@netronome.com, xen-devel@lists.xensource.com,
"Li, Xin B" <xin.b.li@intel.com>,
"Jiang, Yunhong" <yunhong.jiang@intel.com>
Subject: Re: Dom0 hypercall for adding and removing PCI devices
Date: Thu, 24 Jul 2008 09:23:49 +0100 [thread overview]
Message-ID: <C4ADFAA5.1B80F%keir.fraser@eu.citrix.com> (raw)
In-Reply-To: <0122C7C995D32147B66BF4F440D30163016B6BE9@pdsmsx415.ccr.corp.intel.com>
If a device is assigned to a domain (in this case dom0) then that domain's
VT-d pagetables will contain the RMRR mappings for that device. Hence BIOS
can perform DMA in those RMRR-indicated regions without swapping to and fro
between domain tables and fallback RMRR tables. The new fallback RMRR table
would be just that -- a fallback table used for any device not currently
assigned to any domain (and hence those devices should only have DMAs
initiated by the BIOS, if at all).
-- Keir
On 24/7/08 09:20, "Han, Weidong" <weidong.han@intel.com> wrote:
> I have another concern, when BIOS is initiating DMA operation using
> RMRR, can we use RMRR VT-d page table to replace dom0 VT-d page table?
> Does it result in some DMA failures?
>
> Randy (weidong)
>
> Han, Weidong wrote:
>> Espen Skoglund wrote:
>>> [Keir Fraser]
>>>> On 23/7/08 10:26, "Han, Weidong" <weidong.han@intel.com> wrote:
>>>>>> So this would be one extra VT-d pagetable, for the whole system,
>>>>>> which would be the fallback location for RMRR mappings for devices
>>>>>> which are currently not assigned to any domain? Thus allowing
>>>>>> firmware to successfully initiate DMA operations on those devices?
>>>>>> Sounds sensible.
>>>
>>> Well, the VT-d page table for RMRR devices need not contain the whole
>>> system memory---only those regions specified in the DMAR tables.
>>>
>>>>> Is it possible that idle_domain owns the RMRR VT-d page table?
>>>
>>>> If that's a convenient place to stash it then why not? Either way,
>>>> seems you're going to have it special-cased in the code as fallback
>>>> owner for unassigned devices. It's possible that having it stashed
>>>> in the idle domain will simply make the code more confusing. I'm not
>>>> sure though.
>>>
>>> Right. I don't see any particular good reason to associate it with
>>> the idle domain. As noted above, the page table need not even cover
>>> the whole memory, and it will never change after being set up at boot
>>> time. If special case code is needed anyway, then one might as well
>>> install a custom VT-d page table.
>>
>> What does "custom VT-d page table" mean?
>>
>> Due to domain id is not the same with DID field in context, we can
>> reverse a DID for RMRR VT-d page table, it can avoid to associate
>> with idle domain.
>>
>> Currently we reassign the device from dom0 to target domain when
>> assign a device, and return the device to dom0 when target domain
>> tears down. It's not correct due to some devices may be not assigned
>> to any domain. Current device_assigned() also needs to be changed.
>> Maybe it needs more changes on VT-d.
>>
>> I have some concerns, maybe I missed something. Why did you use dom0
>> hypercall approach to replace original method? What's the main
>> benefit? I also wonder it's suitable to wrap pci_bus_probe()
>> function.
>>
>> Randy (Weidong)
>>
>>>
>>> If supported by hardware, the extra page tables can even be skipped
>>> altogether and the device marked as having passthrough access. That
>>> would give the RMRR device complete access to system memory, though.
>>>
>>> eSk
>
next prev parent reply other threads:[~2008-07-24 8:23 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-07-23 9:04 Dom0 hypercall for adding and removing PCI devices Han, Weidong
2008-07-23 9:10 ` Keir Fraser
2008-07-23 9:26 ` Han, Weidong
2008-07-23 9:28 ` Keir Fraser
2008-07-23 18:07 ` Espen Skoglund
[not found] ` <0122C7C995D32147B66BF4F440D301630159F319@pdsmsx415.ccr.corp.intel.com>
2008-07-24 8:20 ` Han, Weidong
2008-07-24 8:23 ` Keir Fraser [this message]
2008-07-24 8:32 ` Han, Weidong
2008-07-24 8:37 ` Keir Fraser
2008-07-24 8:43 ` Tian, Kevin
2008-07-24 8:47 ` Keir Fraser
2008-07-24 9:14 ` Han, Weidong
2008-07-24 9:27 ` Keir Fraser
2008-07-24 14:16 ` Espen Skoglund
2008-07-24 14:47 ` Tian, Kevin
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=C4ADFAA5.1B80F%keir.fraser@eu.citrix.com \
--to=keir.fraser@eu.citrix.com \
--cc=espen.skoglund@netronome.com \
--cc=joshua.levasseur@netronome.com \
--cc=weidong.han@intel.com \
--cc=xen-devel@lists.xensource.com \
--cc=xin.b.li@intel.com \
--cc=yunhong.jiang@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.