From: "Jan Beulich" Subject: [PATCH 2/2] hvmloader: PA range 0xfc000000-0xffffffff should be UC Date: Mon, 19 May 2014 14:13:34 +0100 Message-ID: <537A1F9E0200007800013A51@mail.emea.novell.com> References: <537A1D1E0200007800013A2C@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__Part2C1E086E.1__=" Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1WmNNr-0005IL-A3 for xen-devel@lists.xenproject.org; Mon, 19 May 2014 13:13:39 +0000 In-Reply-To: <537A1D1E0200007800013A2C@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: xen-devel Cc: Ian Campbell , Ian Jackson , Stefano Stabellini List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__Part2C1E086E.1__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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, 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 --- a/tools/firmware/hvmloader/cacheattr.c +++ b/tools/firmware/hvmloader/cacheattr.c @@ -99,12 +99,12 @@ void cacheattr_init(void) { uint64_t base =3D pci_mem_start, size; =20 - for ( i =3D 0; (base !=3D pci_mem_end) && (i < nr_var_ranges); = i++ ) + for ( i =3D 0; !(base >> 32) && (i < nr_var_ranges); i++ ) { size =3D PAGE_SIZE; while ( !(base & size) ) size <<=3D 1; - while ( ((base + size) < base) || ((base + size) > pci_mem_end= ) ) + while ( ((base + size) < base) || ((base + size - 1) >> 32) ) size >>=3D 1; =20 wrmsr(MSR_MTRRphysBase(i), base); --=__Part2C1E086E.1__= Content-Type: text/plain; name="hvmloader-UC-up-to-4G.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="hvmloader-UC-up-to-4G.patch" hvmloader: PA range 0xfc000000-0xffffffff should be UC=0A=0ARather than = leaving the range from PCI_MEM_END (0xfc000000) to 4G=0Auncovered, we = should include this in the UC range created for the (low)=0APCI range. = Besides being more correct, this also has the advantage that=0Awith the = way pci_setup() currently works the range will always be=0Amappable with a = single variable range MTRR (rather than from 2 to 5=0Adepending on how = much the lower boundary gets shifted down to=0Aaccommodate all devices).=0A= =0ASigned-off-by: Jan Beulich =0A=0A--- a/tools/firmware= /hvmloader/cacheattr.c=0A+++ b/tools/firmware/hvmloader/cacheattr.c=0A@@ = -99,12 +99,12 @@ void cacheattr_init(void)=0A {=0A uint64_t = base =3D pci_mem_start, size;=0A =0A- for ( i =3D 0; (base !=3D = pci_mem_end) && (i < nr_var_ranges); i++ )=0A+ for ( i =3D 0; = !(base >> 32) && (i < nr_var_ranges); i++ )=0A {=0A = size =3D PAGE_SIZE;=0A while ( !(base & size) )=0A = size <<=3D 1;=0A- while ( ((base + size) < base) || ((base = + size) > pci_mem_end) )=0A+ while ( ((base + size) < base) || = ((base + size - 1) >> 32) )=0A size >>=3D 1;=0A =0A = wrmsr(MSR_MTRRphysBase(i), base);=0A --=__Part2C1E086E.1__= Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --=__Part2C1E086E.1__=--