From: Ian Campbell Subject: Re: [PATCH 2/2] hvmloader: PA range 0xfc000000-0xffffffff should be UC Date: Wed, 21 May 2014 13:26:06 +0100 Message-ID: <1400675166.4856.48.camel@kazak.uk.xensource.com> References: <537A1D1E0200007800013A2C@mail.emea.novell.com> <537A1F9E0200007800013A51@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Wn5b1-0001HH-3w for xen-devel@lists.xenproject.org; Wed, 21 May 2014 12:26:11 +0000 In-Reply-To: <537A1F9E0200007800013A51@mail.emea.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: xen-devel , Ian Jackson , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org On Mon, 2014-05-19 at 14:13 +0100, Jan Beulich wrote: > Rather than leaving the range from PCI_MEM_END (0xfc000000) to 4G > uncovered, we should include this in the UC range created for the (low) > PCI range. Besides being more correct, OOI why is this more correct? What is in here, APIC registers and stuff I think? (that may have answered my question...) > this also has the advantage that > with the way pci_setup() currently works the range will always be > mappable with a single variable range MTRR (rather than from 2 to 5 > depending on how much the lower boundary gets shifted down to > accommodate all devices). > > Signed-off-by: Jan Beulich Regardless of the above: Acked-by: Ian Campbell > > --- a/tools/firmware/hvmloader/cacheattr.c > +++ b/tools/firmware/hvmloader/cacheattr.c > @@ -99,12 +99,12 @@ void cacheattr_init(void) > { > uint64_t base = pci_mem_start, size; > > - for ( i = 0; (base != pci_mem_end) && (i < nr_var_ranges); i++ ) > + for ( i = 0; !(base >> 32) && (i < nr_var_ranges); i++ ) > { > size = PAGE_SIZE; > while ( !(base & size) ) > size <<= 1; > - while ( ((base + size) < base) || ((base + size) > pci_mem_end) ) > + while ( ((base + size) < base) || ((base + size - 1) >> 32) ) > size >>= 1; > > wrmsr(MSR_MTRRphysBase(i), base); > > >