WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

RE: [Xen-devel] Move some of the PCI device manage/control into pciback?

To: Shohei Fujiwara <fujiwara-sxa@xxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] Move some of the PCI device manage/control into pciback?
From: "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx>
Date: Fri, 16 Jan 2009 14:16:08 +0800
Accept-language: en-US
Acceptlanguage: en-US
Cc: "'xen-devel@xxxxxxxxxxxxxxxxxxx'" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Fraser' <keir.fraser@xxxxxxxxxxxxx>, "Cui, Dexuan" <dexuan.cui@xxxxxxxxx>
Delivery-date: Thu, 15 Jan 2009 22:17:36 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20090116140714.8EA7.CB716985@xxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <20090115191318.2D5A.CB716985@xxxxxxxxxxxxxxx> <E2263E4A5B2284449EEBD0AAB751098401C4F931F8@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20090116140714.8EA7.CB716985@xxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Acl3ngfpeCRoKs5URa20hKxLfXl8EwAAS2jw
Thread-topic: [Xen-devel] Move some of the PCI device manage/control into pciback?
Shohei Fujiwara <mailto:fujiwara-sxa@xxxxxxxxxxxxxxx> wrote:
> On Fri, 16 Jan 2009 11:26:10 +0800
> "Jiang, Yunhong" <yunhong.jiang@xxxxxxxxx> wrote:
> 
>>> I agree with you that there are two similar codes in pciback and
>>> ioemu. But I'm not happy if the code is removed from ioemu.
>>> 
>>> In case of HVM domain with stub domain, I'm considering direct access
>>> from ioemu to configuration space.  We can achieve this by mapping the
>>> subset of MMCFG to stub domain. This will improve the
>>> scalability of PCI
>>> pass-through and reduce the responsibility of dom0.
>>> 
>>> My model is the following.
>>> 
>>>    1. PCI back driver resets the device and setups it.
>>>    2. PCI back driver passes the responsibility of configuration
>>>       space of device to ioemu.
>>>    3. Ioemu reads/writes configuration space of the device, responding
>>> guest OS. 
>>>    4. When ioemu exits, pci back driver gets the responsibility of
>>>       configuration space of device.
>>>    5. PCI back driver resets device (and put D3hot state if possible)
>>> 
>>> As you know, current xend reads/writes configuration space. If xend
>>> doesn't reads/writes, the architecture becomes simpler.
>>> 
>>> What do you think about this?
>> 
>> Shohei, I think this model may have some issue.
>> a) The stubdomain/qemu is not trustable, so user may use a fake stub
>>  domain and try to programe some sensitive config space (like MSI).
> 
> My idea is to call XEN_DOMCTL_iomem_permission from domain 0.
> So my idea doesn't open a new hole.
> In addition to this, interrupt remapping of VT-d can block invalid MSI.

I suspect that feature is not enabled in all system.

Also what will happen if guest try to change the BAR value? Will be passed to 
hardware also? I'm not sure what will happen if two device under the same bus 
has the same BAR value. Maybe then it is possible one guest can write MMIO of 
another device.

> 
>> b) If there is no mmcfg support, to sync access to cf8/cfc will be
>> difficult. So you mean we have different implementation for
>> mmcfg/cf8 method?
> 
> If there is no mmcfg support, I'd like to use existing
> mechanism (pciback in dom0 and pcifront in stub domain).
> 
> If there is mmcfg support, I'd like to allow stub domain to access directly.

I'm not sure how difference between these two implementation and if we really 
want keep this implementation. Mostly I think it is ok since it should not be 
on data path (Or any special device will do that??)
But there is really one thing we need consider: The mask bit for MSI/MSI-X. 
Because guest may try to mask/unmask the interrupt. Maybe we need translate 
that operation to the mask/unmask of the virtual interrupt.

> 
> Thanks,
> --
> Shohei Fujiwara
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>