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: Konrad Rzeszutek Wilk <konrad.wilk@xxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space
From: Fengzhe Zhang <fengzhe.zhang@xxxxxxxxx>
Date: Thu, 17 Feb 2011 12:11:36 +0800
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, "Dong, Eddie" <eddie.dong@xxxxxxxxx>, "Li, Xin" <xin.li@xxxxxxxxx>
Delivery-date: Wed, 16 Feb 2011 20:12:46 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <20110216150638.GC12215@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/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> <20110216150638.GC12215@xxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101207 Thunderbird/3.1.7
On 2011/2/16 23:06, 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?

Yes, BZ #1726. Attached serial output when system crashes. The failure is inside Xen hypervisor when trying to translate a pte_val from M to P.



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.

It sounds to me that you are trying to fix the symptomps but not the actual 
failure - which
is a driver trying to ioremap System RAM?

Or is it that the PCI system does something like this:

[    0.000000] Allocating PCI resources starting at d0000000 (gap: 
d0000000:2ec00000)

While that gap is in System RAM?

Yes.


Can you provide the E820 that Xen sees?

What does the E820 look when you boot the kernel in baremetal stage (and use 
the mem= argument
to make it less than normal).

Attached serial output log.



Signed-off-by: Fengzhe Zhang<fengzhe.zhang@xxxxxxxxx>

diff --git a/arch/x86/xen/setup.c b/arch/x86/xen/setup.c
index 1a1934a..f1a3896 100644
--- a/arch/x86/xen/setup.c
+++ b/arch/x86/xen/setup.c
@@ -189,6 +189,16 @@ char * __init xen_memory_setup(void)
                        end -= delta;

                        extra_pages += PFN_DOWN(delta);
+
+                       /*
+                        * Set RAM below 4GB that are not owned by Dom0 to be 
unusable.
+                        * This prevents RAM-backed address space from being 
used as
+                        * I/O address in Dom0. Dom0 is assumed to look for MMIO
+                        * space only below 4GB. If this assumption is broken, 
additional
+                        * fixes are required.
+                        */
+                       if (delta&&  end<  0x100000000UL)
+                               e820_add_region(end, delta, E820_UNUSABLE);
                }

                if (map[i].size>  0&&  end>  xen_extra_mem_start)


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


Attachment: dump-full.txt
Description: Text document

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel
<Prev in Thread] Current Thread [Next in Thread>