From: Ian Jackson Subject: Re: [PATCH v4 5/8] hvmloader: Correct bug in low mmio region accounting Date: Fri, 21 Jun 2013 14:32:17 +0100 Message-ID: <20932.21985.450763.345419@mariner.uk.xensource.com> References: <1371811594-31135-1-git-send-email-george.dunlap@eu.citrix.com> <1371811594-31135-6-git-send-email-george.dunlap@eu.citrix.com> <20932.14035.475814.607949@mariner.uk.xensource.com> <51C46A2902000078000DFA9A@nat28.tlf.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <51C46A2902000078000DFA9A@nat28.tlf.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich Cc: Keir Fraser , Ian Campbell , Hanweidong , George Dunlap , xen-devel@lists.xen.org, Stefano Stabellini List-Id: xen-devel@lists.xenproject.org Jan Beulich writes ("Re: [Xen-devel] [PATCH v4 5/8] hvmloader: Correct bug in low mmio region accounting"): > On 21.06.13 at 13:19, Ian Jackson wrote: > > But for the first device I think it may be possible for resource->base > > not to be a multiple of the bar_sz, and in that case it might be that > > the precalculation thinks it will fit when the actual placement > > calculation doesn't. > > > > Do you think this is possible ? > > This is possible only from an abstract perspective, not in reality: > PCI_MEM_START being 0x{f,e,c,8}0000000, PCI_MEM_END being > 0xfc000000, and allocations starting with the biggest BARs > (where you already correctly noted that BARs are always a power > of 2 in size), the current base address can be misaligned only > when the BAR size is too large to fit anyway. In which case it'll > go into the space above 4Gb, and to that range the precalculation > doesn't apply. Ah. Right. Err, OK. I'm convinced by this argument. It's not a good reflection on the clarity of this code, though. Perhaps, George, you could mention this issue in a comment or the commit message. But anyway, this, and 6/8, Acked-by: Ian Jackson