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 0/2] MTRR/PAT virtualization

To: "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx>, <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: RE: [Xen-devel] [PATCH 0/2] MTRR/PAT virtualization
From: "Su, Disheng" <disheng.su@xxxxxxxxx>
Date: Mon, 8 Oct 2007 16:59:04 +0800
Delivery-date: Mon, 08 Oct 2007 02:00:10 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <C32FA17F.E879%Keir.Fraser@xxxxxxxxxxxx>
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>
References: <FF386CB4AE0E4648B0A96060EC00F36C3D22CB@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <C32FA17F.E879%Keir.Fraser@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Thread-index: AcgJfbiHYf5t3raCT5qrRGbrSVAc4gAAyqLhAAD146A=
Thread-topic: [Xen-devel] [PATCH 0/2] MTRR/PAT virtualization
Thanks for your comments.

Keir Fraser wrote:
> The second patch is a bit of a hack-and-slash job. New memory-type
> virtualisation code should go in a new file, instead of being put in
> host MTRR management files (which are mostly unmodified from Linux
> anyway, and shouldn't deviate more than necessary). There are various

How about add a new file called mtrr.c under xen/arch/x86/hvm/ ?

> other one-line changes in various MTRR source files that are
> unexplained (e.g., mask changes from |0xf00 to |0x7ff).

Ok, will add more comments about the changes.

> Initialisation of guest MTRR state will need to be moved to hvmloader
> -- we do not call setvcpucontext for HVM guests any more, so the

The problem here is to initialize MTRR MSRs of both BP and AP, in order 
to make sure MTRR MSRs are the same. Can do it in hvmloader? 
Another place to do it is in ROMBIOS, but there is lack of 
AP initialization logic. So what's your opinion about it? Do it in
hvmloader
, ROMBIOS or other place? 

> current hack won't work with current xen-unstable. Coding style needs
> cleaning up (looks like there is some spaces vs. tabs mixing up going
> on). 
> 
>   -- Keir
> 
> On 8/10/07 08:34, "Su, Disheng" <disheng.su@xxxxxxxxx> wrote:
> 
>> Hi,
>> The following 2 patches add basic MTRR/PAT support into
>> hypervisor. When vt-d enabled, direct IO and RAM
>> could be mapped to different cache attribute, such as UC or WC,
>> which will bring some trouble. xen.patch: some data structures of
>> MTRR in xen are exported. mtrr_pat.patch: The basic idea is listed
>>           below: a. MTRR/PAT MSRs are per vcpu. The value of guest
>> MTRR is 
>> initialized in host, after guest E820 table is build. The value of
>> guest PAT is initialized as default. The host PAT is initialized to
>>           cover all the page attributes. b. The guest page attribute
>> is virtualized through shadow page attribute. First, get the
>> effective guest page attribute, by calculating from the combination
>> of guest MTRR/PAT. Then the shadow page attribute is calculated from
>> effective guest page attribute and host MTRR. If conflict occurs(e.g
>> effective guest page attribute is WB, host MTRR of this range is UC,
>> can't set this page attribute as guest required), set this range as
>> UC. Some lookup tables are added to accelerate above procedure. 
>> 
>> Signed-off-by: Disheng Su <disheng.su@xxxxxxxxx>
>> 
>> Best Regards,
>> Disheng, Su
>> 
>> _______________________________________________
>> Xen-devel mailing list
>> Xen-devel@xxxxxxxxxxxxxxxxxxx
>> http://lists.xensource.com/xen-devel



Best Regards,
Disheng, Su

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