From: "Zhao, Yu" <yu.zhao@intel.com>
To: Yuji Shimada <shimada-yxb@necst.nec.co.jp>
Cc: Keir Fraser <keir.fraser@citrix.com>,
"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH] dom0 linux: Reassign memory resources to device for pci passthrough.
Date: Thu, 09 Oct 2008 19:34:52 +0800 [thread overview]
Message-ID: <48EDEC5C.10809@intel.com> (raw)
In-Reply-To: <20081009175020.BF38.SHIMADA-YXB@necst.nec.co.jp>
Yuji Shimada wrote:
> On Thu, 9 Oct 2008 11:21:22 +0800
> "Zhao, Yu" <yu.zhao@intel.com> 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
next prev parent reply other threads:[~2008-10-09 11:34 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-10-08 23:43 [PATCH] dom0 linux: Reassign memory resources to device for pci passthrough Yuji Shimada
2008-10-09 1:04 ` Neo Jia
2008-10-09 8:04 ` Yuji Shimada
2008-10-09 3:21 ` Zhao, Yu
2008-10-09 8:54 ` Yuji Shimada
2008-10-09 11:34 ` Zhao, Yu [this message]
2008-10-09 7:20 ` Yuji Shimada
2008-10-10 7:05 ` Zhao, Yu
2008-10-10 10:13 ` Yuji Shimada
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=48EDEC5C.10809@intel.com \
--to=yu.zhao@intel.com \
--cc=keir.fraser@citrix.com \
--cc=shimada-yxb@necst.nec.co.jp \
--cc=xen-devel@lists.xensource.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.