WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

Re: [Xen-devel] [PATCH] hvmloader: pci range cache policy

To: Jean Guyader <jean.guyader@xxxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] hvmloader: pci range cache policy
From: Keir Fraser <keir.fraser@xxxxxxxxxxxxx>
Date: Fri, 23 May 2008 17:00:08 +0100
Delivery-date: Fri, 23 May 2008 09:00:22 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <4836DB8E.6070503@xxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: Aci87hKUUQb9gCjhEd284wAWy6hiGQ==
Thread-topic: [Xen-devel] [PATCH] hvmloader: pci range cache policy
User-agent: Microsoft-Entourage/11.4.0.080122
The code is correct as it is. The frame number goes into bits 12 upwards of
the MSR, and this is equivalent to writing the full address into bits 0
upwards.

 -- Keir

On 23/5/08 15:58, "Jean Guyader" <jean.guyader@xxxxxxxxxxxxx> wrote:

> 
> 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 <jean.guyader@xxxxxxxxxxxxx>
> 
> 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));
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@xxxxxxxxxxxxxxxxxxx
> http://lists.xensource.com/xen-devel



_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>