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] [PATCH] dom0 linux: Reassign memory resources to device

To: Yuji Shimada <shimada-yxb@xxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] dom0 linux: Reassign memory resources to device for pci passthrough.
From: "Zhao, Yu" <yu.zhao@xxxxxxxxx>
Date: Thu, 09 Oct 2008 19:34:52 +0800
Cc: Keir Fraser <keir.fraser@xxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 09 Oct 2008 04:35:56 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20081009175020.BF38.SHIMADA-YXB@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: <20081009083706.BF13.SHIMADA-YXB@xxxxxxxxxxxxxxx> <D8078B8B3B09934AA9F8F2D5FB3F28CE08A3D7CD93@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20081009175020.BF38.SHIMADA-YXB@xxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Thunderbird 2.0.0.17 (Windows/20080914)
Yuji Shimada wrote:
On Thu, 9 Oct 2008 11:21:22 +0800
"Zhao, Yu" <yu.zhao@xxxxxxxxx> wrote:

On Thursday, October 09, 2008 7:44 AM, Yuji Shimada wrote:
There is a similar function enabled by pci-mem-align boot
parameter. Currently it is kept. But if many people agree with me, I'd
like to remove it from dom0 linux, because there are two problems.

   - pci-mem-align reassigns all devices' memory resources if they are
     not page-aligned. This is not safe, because some devices are
     used by firmware.
   - pci-mem-align can't expand resource window of PCI-PCI bridge.
Why the resource windows can't be expended? I think the
pci_bus_size_bridges takes care of this. So it shouldn't be a
problem and your pci_update_bridge appears unnecessary.

Current pci_bus_size_bridges calculates the size and minimal alignment
of resource window based on actual resource size. The values of them
will be not changed if pci-mem-align is enabled.

Yes, that's a problem in pbus_size_mem, and should be fixed there -- say, make it consistent with pci_bus_alloc_resource by fixing up the alignment.


But if we make memory resource page-aligned, we need more space. My
patch rounds up resource size to page size, on calculating the size
of resource windows.

The calculation of the window size is incorrect because it's still based on wrong values from pbus_size_mem. And the base addresses may be overwritten by pci_setup_bridge ultimately.



Regarding the first problem you mentioned, it could be easily fixed
by merging your "rassigndev=" parameter to quirk_align_mem_resources
so the function can selective twist the devices.

If my "rassigndev=" parameter is merged to quirk_align_mem_resources,
problem will occurs. Current quirk_align_mem_resources shifts
resources simply. Resources will conflict easily. If confliction
occurs, kernel reassigns conflicting resources. As a result, the
resources of device which are not specified are reassigned.

The quirk function should deassign the resource (set resource start to 0) instead of shifting it. Then it could fall into same scenario as your patch.

Additionally, the reassigned resource is not page-aligned.

Thanks,
--
Yuji Shimada


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel