All of lore.kernel.org
 help / color / mirror / Atom feed
From: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
To: "Zhang, Fengzhe" <fengzhe.zhang@intel.com>
Cc: xen-devel <xen-devel@lists.xensource.com>,
	"Dong, Eddie" <eddie.dong@intel.com>,
	"Li, Xin" <xin.li@intel.com>
Subject: Re: [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space
Date: Wed, 16 Feb 2011 10:06:38 -0500	[thread overview]
Message-ID: <20110216150638.GC12215@dumpdata.com> (raw)
In-Reply-To: <1A42CE6F5F474C41B63392A5F80372B2335E978C@shsmsx501.ccr.corp.intel.com>

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.

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?

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).

> 
> Signed-off-by: Fengzhe Zhang <fengzhe.zhang@intel.com>
> 
> 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@lists.xensource.com
> http://lists.xensource.com/xen-devel

  reply	other threads:[~2011-02-16 15:06 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-02-16 14:26 [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space Zhang, Fengzhe
2011-02-16 15:06 ` Konrad Rzeszutek Wilk [this message]
2011-02-16 15:20   ` Konrad Rzeszutek Wilk
2011-02-16 15:47     ` Konrad Rzeszutek Wilk
2011-02-17  5:32       ` Fengzhe Zhang
2011-02-17 14:23         ` [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space in 2.6.32.27 tree Konrad Rzeszutek Wilk
2011-02-17 15:07           ` Li, Xin
2011-02-17 15:35             ` Konrad Rzeszutek Wilk
2011-02-18 15:16         ` [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space Konrad Rzeszutek Wilk
2011-02-20 13:58           ` Fengzhe Zhang
2011-02-17  4:11   ` Fengzhe Zhang
2011-02-18 22:05 ` Konrad Rzeszutek Wilk
2011-02-20 14:14   ` Fengzhe Zhang
2011-02-21 10:35     ` Li, Xin
2011-02-21 19:20       ` Konrad Rzeszutek Wilk
2011-02-22  4:55         ` Li, Xin

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110216150638.GC12215@dumpdata.com \
    --to=konrad.wilk@oracle.com \
    --cc=eddie.dong@intel.com \
    --cc=fengzhe.zhang@intel.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=xin.li@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.