From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jean Guyader Subject: [PATCH] hvmloader: pci range cache policy Date: Fri, 23 May 2008 15:58:22 +0100 Message-ID: <4836DB8E.6070503@eu.citrix.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------020203080307040503030004" Return-path: List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org This is a multi-part message in MIME format. --------------020203080307040503030004 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit hvmloader: pci range cache policy Use frame number instead address when we write the msr for the mtrr of the pci range. Signed-off-by: Jean Guyader --------------020203080307040503030004 Content-Type: text/plain; name="msr_pci_range.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="msr_pci_range.patch" diff -r ef7525e87030 tools/firmware/hvmloader/cacheattr.c --- a/tools/firmware/hvmloader/cacheattr.c Fri May 23 11:58:08 2008 +0100 +++ b/tools/firmware/hvmloader/cacheattr.c Fri May 23 15:53:32 2008 +0100 @@ -89,9 +89,9 @@ void cacheattr_init(void) if ( nr_var_ranges != 0 ) { /* A single UC range covering PCI space. */ - wrmsr(MSR_MTRRphysBase(0), PCI_MEMBASE); + wrmsr(MSR_MTRRphysBase(0), PCI_MEMBASE >> PAGE_SHIFT); wrmsr(MSR_MTRRphysMask(0), - ((uint64_t)(int32_t)PCI_MEMBASE & addr_mask) | (1u << 11)); + (((uint64_t)(int32_t)PCI_MEMBASE & addr_mask) | (1u << 11)) >> PAGE_SHIFT); printf("var MTRRs ... "); } diff -r ef7525e87030 tools/firmware/hvmloader/util.h --- a/tools/firmware/hvmloader/util.h Fri May 23 11:58:08 2008 +0100 +++ b/tools/firmware/hvmloader/util.h Fri May 23 15:53:32 2008 +0100 @@ -9,6 +9,8 @@ #undef NULL #define NULL ((void*)0) + +#define PAGE_SHIFT 12 void __assert_failed(char *assertion, char *file, int line) __attribute__((noreturn)); --------------020203080307040503030004 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.xensource.com http://lists.xensource.com/xen-devel --------------020203080307040503030004--