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] Guest-vs-Host MTRR/PAT conflict and a crash?

To: "Su, Disheng" <disheng.su@xxxxxxxxx>, "Keir Fraser" <Keir.Fraser@xxxxxxxxxxxx>, "Xen Developers" <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] Guest-vs-Host MTRR/PAT conflict and a crash?
From: "David Stone" <unclestoner@xxxxxxxxx>
Date: Thu, 3 Jan 2008 17:04:45 -0500
Delivery-date: Thu, 03 Jan 2008 14:05:23 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:received:message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; bh=3BrvVRdL3XkFiFlJzzc4JoB933/8+bHT4IwJP4PAdeU=; b=bJ9+UXKx8zqjsFTMhaA1uqTS3RhaFNFJyoXbRwQ2SOqUFOQMq5FhoF9sg9tAflgM/GLlYMyjOPTCdxgCH8a4qP7uDm4Mvn93enTp+7V5GwlN3XeZP6OoJR5RQg3GqCFzilmO3AvLmnzWD7isKAwDJamE7R2NssEvD2hZcipprAQ=
Domainkey-signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=message-id:date:from:to:subject:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=hww7tkCczoBJlGdZhZGZODBxvUO5YVijhXE932p77Kmdqe/p19gbYOLUzgzUtbQkCG356vlzq5kCr5nSg8do8tXETdQQPhlDLQRePPlr0PZdr14kfVscDIkwSxjDzJsuM3H8J83B8celBWlQ5HeeJToc4nE5CdbFQy3llam0/To=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <FF386CB4AE0E4648B0A96060EC00F36C66D6A9@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
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: <1a74a8410712121413g12f4d09dobef330bc8be1d98c@xxxxxxxxxxxxxx> <C3861918.1142C%Keir.Fraser@xxxxxxxxxxxx> <1a74a8410712141443r29e31582lccec97c6abc41dd0@xxxxxxxxxxxxxx> <FF386CB4AE0E4648B0A96060EC00F36C5FAC36@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <1a74a8410801021341u5327a6ai6d91784eebfbd847@xxxxxxxxxxxxxx> <FF386CB4AE0E4648B0A96060EC00F36C66D6A9@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Jan 2, 2008 11:55 PM, Su, Disheng <disheng.su@xxxxxxxxx> wrote:
>
> > So my first question is, does anyone have a guess as to what this 64KB
> > region assigned to the graphics card is for?  I assume the 256MB
> > region is the general-purpose video memory for textures, vertices,
> > etc.
> 64KB region is GART?(just guess:)
That would make sense, I had not thought of that.

> > The mtrr warning message happens when the shadow page table is getting
> > updated as the guest is trying to update his page tables.  But why
> > would the guest only update the PTE at the beginning of the 64KB
> > region, and not all 64KB/4KB=16 PTEs in the region?  I assume the
> > guest isn't updating them all, because then I would get 16 of the mtrr
> > warning messages?  I wonder if the guest is updating the page table
> > (causing the MTRR warning but succeeding), and then trying to
> > read/write from that page, and this is timing out causing the machine
> > check?
> Why the guest thinks this region as WB? Is it already wrong in there?

OK, I did some more tracing based on your question and now I think I
_may_ see a problem.  Anyway:

The guest thinks the memory is WB because the guest has a single
(virtual) variable-range MTRR that specifies the addresses
0x00000000-0x40000000 are WB.  0x10000000 falls in this range.  This
MTRR is coming from the guest's (emulated?) E820.
This in turn is coming from the "memory" directive in the domain's
configuration file...I am specifying memory='1024' which is 1GB which
is 0x00000000-0x40000000.  So, the emulated E820 is reporting the
bottom 1GB as available, and an MTRR is getting created to represent
this area as WB.

On the other hand the hypervisor says the memory is uncacheable
because the host has three variable range MTRRs:
 - The first specifies the entire 32-bit address range as WB
 - A second overrides the first for 0x7df00000-0x7dffffff as uncacheable
 - A third overrides the first for 0x80000000-0xfffffff s uncacheable.
These set of MTRRs seem to be standard for bare-metal Linux, Dom0
Linux, and the Xen hypervisor.

So, the guest address of 0x10000000 is WB according to the guest's
MTRRs.  The corresponding host address 0x80020000 is uncacheable
according to the hypervisor's MTRRs.

But hold on...this excercise made me realize that it appears the guest
is programming the graphics card's BAR with an address (guest-physical
address of 0x10000000) that is within the guest's system memory (lower
1GB of guest-physical address space, 0x00000000-0x40000000).  Can
someone out there throw me a bone and tell me that I'm right in
thinking this should never happen?

Dave

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