From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space Date: Wed, 16 Feb 2011 10:20:21 -0500 Message-ID: <20110216152021.GA5894@dumpdata.com> References: <1A42CE6F5F474C41B63392A5F80372B2335E978C@shsmsx501.ccr.corp.intel.com> <20110216150638.GC12215@dumpdata.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Return-path: Content-Disposition: inline In-Reply-To: <20110216150638.GC12215@dumpdata.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Zhang, Fengzhe" Cc: xen-devel , "Dong, Eddie" , "Li, Xin" List-Id: xen-devel@lists.xenproject.org On Wed, Feb 16, 2011 at 10:06:38AM -0500, Konrad Rzeszutek Wilk wrote: > On Wed, Feb 16, 2011 at 10:26:20PM +0800, Zhang, Fengzhe wrote: > > iomem: Prevent Dom0 pci bus from allocating RAM as I/O space > > Is there a bug # associated with this? Is this associated with the intel-agp > driver trying to ioremap the scratch page and bombing out? > > > > > In Dom0, pci bus dynamically allocates I/O address resources from memory hole within 4GB physical space, which can be RAM space not allocated to Dom0. This patch set physical RAM space to be unusable in Dom0 E820 map if they are not owned by Dom0 to prevent them from being misused as I/O address space. Dom0 is assumed to look for MMIO space only below 4GB. If this assumption is broken, additional fixes are required. > > You mention "RAM space" and then "physical RAM" misused as "I/O" address space. Hmm, is the issue that we have this E820: (XEN) 000000000009d000 - 00000000000a0000 (reserved)^M (XEN) 00000000000e0000 - 0000000000100000 (reserved)^M (XEN) 0000000000100000 - 000000009cf67000 (usable)^M (XEN) 000000009cf67000 - 000000009d103000 (ACPI NVS)^M (XEN) 000000009d103000 - 000000009f6bd000 (usable)^M (XEN) 000000009f6bd000 - 000000009f6bf000 (reserved)^M (XEN) 000000009f6bf000 - 000000009f714000 (usable)^M (XEN) 000000009f714000 - 000000009f7bf000 (ACPI NVS)^M (XEN) 000000009f7bf000 - 000000009f7e0000 (usable)^M (XEN) 000000009f7e0000 - 000000009f7ff000 (ACPI data)^M (XEN) 000000009f7ff000 - 000000009f800000 (usable)^M (XEN) 000000009f800000 - 00000000a0000000 (reserved)^M with System RAM regions sprinkled around the reserved and when you use dom0_mem=1GB, the setup.c has made those regions size 0 (by subtracting the delta), so that when e820_santize gets called it will remove them altogether and end up converting those areas in gaps, as so: [ 0.000000] BIOS-provided physical RAM map:^M^M [ 0.000000] Xen: 0000000000000000 - 000000000009d000 (usable)^M^M [ 0.000000] Xen: 000000000009d000 - 0000000000100000 (reserved)^M^M [ 0.000000] Xen: 0000000000100000 - 0000000040000000 (usable)^M^M [ 0.000000] Xen: 000000009cf67000 - 000000009d103000 (ACPI NVS)^M^M [ 0.000000] Xen: 000000009f6bd000 - 000000009f6bf000 (reserved)^M^M [ 0.000000] Xen: 000000009f714000 - 000000009f7bf000 (ACPI NVS)^M^M [ 0.000000] Xen: 000000009f7e0000 - 000000009f7ff000 (ACPI data)^M^M [ 0.000000] Xen: 000000009f800000 - 00000000b0000000 (reserved)^M^M [ 0.000000] Xen: 00000000fc000000 - 00000000fd000000 (reserved)^M^M [ 0.000000] Xen: 00000000fec00000 - 00000000fec01000 (reserved)^M^M [ 0.000000] Xen: 00000000fee00000 - 00000000fee01000 (reserved)^M^M [ 0.000000] Xen: 00000000ffe00000 - 0000000100000000 (reserved)^M^M [ 0.000000] Xen: 0000000100000000 - 00000001bf598000 (usable)^M^M ?