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] iomem: Prevent Dom0 pci bus from allocating RAM

To: "Li, Xin" <xin.li@xxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space
From: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Date: Mon, 21 Feb 2011 14:20:32 -0500
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, "Dong, Eddie" <eddie.dong@xxxxxxxxx>, "Zhang, Fengzhe" <fengzhe.zhang@xxxxxxxxx>
Delivery-date: Mon, 21 Feb 2011 11:21:44 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <FC2FB65B4D919844ADE4BE3C2BB739AD36B1ED05@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/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
References: <1A42CE6F5F474C41B63392A5F80372B2335E978C@xxxxxxxxxxxxxxxxxxxxxxxxxxxx> <20110218220558.GA18213@xxxxxxxxxxxx> <4D6121B6.2060109@xxxxxxxxx> <FC2FB65B4D919844ADE4BE3C2BB739AD36B1ED05@xxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mutt/1.5.20 (2009-06-14)
On Mon, Feb 21, 2011 at 06:35:05PM +0800, Li, Xin wrote:
> I'm thinking how this issue happened.
> 
> For most devices, their MMIO resources are allocated in BIOS, thus it's ok 
> for dom0 to use PFN as MFN, because dom0 is trusted.
> 
> However for devices like i915, whose drivers need to allocate MMIO when 
> running in dom0, the issue Fengzhe is trying to fix may pop up, because dom0 
> kernel tries to allocate the MMIO resource from holes in its e820 table (not 
> real hardware e820), which is RAM actually in below Fengzhe's case when 
> limiting dom0 memory to a smaller value.

Found a nice back history of why this is needed: 
http://lwn.net/Articles/256335/ 
> 
> So for such cases the assumption of MFN == PFN is broken, possible solutions 
> are:
> 1) use a hypercall to allocate MMIO from Xen/real hardware when dom0 
> allocates MMIO, also add the mappings into p2m of dom0.  But this needs to 
> hack the dom0 driver when it tries to program the PFN into device.
> 2) Fengzhe's solution to mark hardware RAM as reserved in dom0's e820 table, 
> to avoid conflict and make MFN == PFN true again.  No driver changes required.
> 

Fengzhe's solution works fine. I've tested it on a box with G33 chipset and it 
makes the boot
problem disappear (if I set dom0_mem=1500MB I would hit this, otherwise it 
booted fined).

Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>


> I don't know if I missed something important here, please correct me if you 
> find any.
> 
> Also any other proposals?

Also sticking this patch for 2.6.38-rc5 train.

I am going to rename the title of the patch to

"xen/setup: Inhibit resource API from using System RAM E820 gaps as PCI mem 
gaps."

and expand the description with snippets from this discussion.

Thank you for tracking this bug down and proposing a patch.

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