From: "Jan Beulich" Subject: Re: [PATCH,RFC 5/7] PCI multi-seg: AMD-IOMMU specificadjustments Date: Tue, 06 Sep 2011 12:47:21 +0100 Message-ID: <4E6624690200007800054CDC@nat28.tlf.novell.com> References: <4E567F2A0200007800053475@nat28.tlf.novell.com> <201108261357.57885.wei.wang2@amd.com> <4E64E7BE0200007800054AD6@nat28.tlf.novell.com> <201109061303.11919.wei.wang2@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Return-path: In-Reply-To: <201109061303.11919.wei.wang2@amd.com> Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: Wei Wang2 Cc: "xen-devel@lists.xensource.com" List-Id: xen-devel@lists.xenproject.org >>> On 06.09.11 at 13:03, Wei Wang2 wrote: > On Monday 05 September 2011 15:16:14 Jan Beulich wrote: >> I don't really follow: The two cases where I can't spot where to get = the >> segment number from are register_exclusion_range_for_all_devices() >> and register_exclusion_range_for_device(), both called in the context >> of struct acpi_ivmd_block_header(), which only gets a struct >> acpi_ivmd_block_header (not having a segment number afaict). >=20 > OK, now I understand your question. I thought you are question about = iommu=20 > specification. For these two functions, I think seg =3D 0 is fine, since = amd=20 > iommu does not support multiple pci segment other than 0. So I'll leave the code unchanged then, also because ... > Also, You could=20 > pass acpi_ivhd_block_header to parse_ivmd_block() in function=20 > parse_ivrs_block(), since both ivhd and ivmd entries shares the same = ivhd=20 > header. ... this I cannot make sense of: parse_ivrs_block() casts its input (of type struct acpi_ivrs_block_header *) to either struct acpi_ivhd_block_header * (on which path I'm already using the available segment number) or struct acpi_ivmd_block_header * (which doesn't have a segment number, and which has its start_addr member located at the offset where pci_segment would be in acpi_ivhd_block_header, so casting to both types in a single function invocation is clearly = wrong). Jan