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

xen-devel

[Top] [All Lists]

[Xen-devel] Re: [PATCH][VTD] pci mmcfg patch for x86-64 - version 2

To: "Allen M Kay" <allen.m.kay@xxxxxxxxx>
Subject: [Xen-devel] Re: [PATCH][VTD] pci mmcfg patch for x86-64 - version 2
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: 2008年12月09日 10:50:21 +0000
Cc: Espen Skoglund <espen.skoglund@xxxxxxxxxxxxx>, "xen-devel@xxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxx>, Weidong Han <weidong.han@xxxxxxxxx>, Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Delivery-date: 2008年12月09日 02:50:33 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <57C9024A16AD2D4C97DC78E552063EA35C77DA3B@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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: <57C9024A16AD2D4C97DC78E552063EA35C77DA3B@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
>>> "Kay, Allen M" <allen.m.kay@xxxxxxxxx> 08.12.08 23:33 >>>
>+#define PCI_MCFG_VIRT_START (PML4_ADDR(257))
>+#define PCI_MCFG_VIRT_END (RDWR_MPT_VIRT_START + PML4_ENTRY_BYTES)
The latter line is certainly wrong.
>+static void __iomem * __init mcfg_ioremap(struct acpi_mcfg_allocation *cfg)
>+{
>+ void __iomem *addr;
>+ unsigned long virt;
>+ unsigned long mfn;
>+ unsigned long size, nr_mfn;
>+
>+ /* see asm-x86/config.h, only 2048 PCI segments are supported) */
>+ BUG_ON(cfg->pci_segment >= 2048);
This seems an inappropriate use of BUG_ON() - should either return NULL
here or map just the first 2048 segments (and check in other places
accordingly). Also, I'd say you shouldn't have a literal 2048 here, but rather
calculate the number from PCI_MCFG_VIRT_END.
>+ virt = PCI_MCFG_VIRT_START + (cfg->pci_segment * (1 << 22)) +
>+ (cfg->start_bus_number * (1 << 20));
Isn't the first (segment) shift value supposed to be 28? Also, you have to
use 1UL there, otherwise the multiplication will get truncated to 32 bits.
>+ mfn = cfg->address >> PAGE_SHIFT;
>+ size = (cfg->end_bus_number - cfg->start_bus_number) << 20;
Since end_bus_number is the last valid number, you need to add 1 here
I would think.
Jan
_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>
Previous by Date: Re: [PATCH] fix ia64 breakage with PHYSDEVOP_pirq_eoi_mfn (was Re: [Xen-devel] [PATCH 2/2] linux/x86: use shared page indicating the need for an EOI notification) , Isaku Yamahata
Next by Date: Re: [PATCH] fix ia64 breakage with PHYSDEVOP_pirq_eoi_mfn (was Re: [Xen-devel] [PATCH 2/2] linux/x86: use shared page indicating the need for an EOI notification) , Jan Beulich
Previous by Thread: [Xen-devel] [PATCH][VTD] pci mmcfg patch for x86-64 - version 2 , Kay, Allen M
Next by Thread: [Xen-devel] RE: [PATCH][VTD] pci mmcfg patch for x86-64 - version 2 , Kay, Allen M
Indexes: [Date] [Thread] [Top] [All Lists]

Copyright ©, Citrix Systems Inc. All rights reserved. Legal and Privacy
Citrix This site is hosted by Citrix

AltStyle によって変換されたページ (->オリジナル) /