From mboxrd@z Thu Jan 1 00:00:00 1970 From: George Dunlap Subject: Re: [PATCH v4 5/8] hvmloader: Correct bug in low mmio region accounting Date: Fri, 21 Jun 2013 14:40:41 +0100 Message-ID: <51C457D9.4080209@eu.citrix.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> <20932.21985.450763.345419@mariner.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; Format="flowed" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <20932.21985.450763.345419@mariner.uk.xensource.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: Ian Jackson Cc: Keir Fraser , Ian Campbell , Hanweidong , xen-devel@lists.xen.org, Stefano Stabellini , Jan Beulich List-Id: xen-devel@lists.xenproject.org On 21/06/13 14:32, Ian Jackson wrote: > 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. Yes, I think I shall. It is, as Jan says, correct at the present moment, but it's not even clear whether that was by accident or by design; even if it was by design, there's no guarantee it will remain so in the future without at least a comment. We may want to try to clean this up long-term, but I would really like to investigate just punting this whole thing off to SeaBIOS, which is being tested and maintained by the KVM folks. > But anyway, this, and 6/8, > > Acked-by: Ian Jackson Great, thanks. Stefano pointed out some "development process" terminology leaking into the comment on the last patch -- I'll clean that up, add in some comments about the fragile accounting, and send v5. That should be it for this series, I think. -George