* [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space @ 2011-02-16 14:26 Zhang, Fengzhe 2011-02-16 15:06 ` Konrad Rzeszutek Wilk 2011-02-18 22:05 ` Konrad Rzeszutek Wilk 0 siblings, 2 replies; 16+ messages in thread From: Zhang, Fengzhe @ 2011-02-16 14:26 UTC (permalink / raw) To: xen-devel; +Cc: Dong, Eddie, Li, Xin [-- Attachment #1: Type: text/plain, Size: 1276 bytes --] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space 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. 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) [-- Attachment #2: pci_mem_bug.patch --] [-- Type: application/octet-stream, Size: 1276 bytes --] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space 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. 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) [-- Attachment #3: Type: text/plain, Size: 138 bytes --] _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space 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 2011-02-16 15:20 ` Konrad Rzeszutek Wilk 2011-02-17 4:11 ` Fengzhe Zhang 2011-02-18 22:05 ` Konrad Rzeszutek Wilk 1 sibling, 2 replies; 16+ messages in thread From: Konrad Rzeszutek Wilk @ 2011-02-16 15:06 UTC (permalink / raw) To: Zhang, Fengzhe; +Cc: xen-devel, Dong, Eddie, Li, Xin 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 ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space 2011-02-16 15:06 ` Konrad Rzeszutek Wilk @ 2011-02-16 15:20 ` Konrad Rzeszutek Wilk 2011-02-16 15:47 ` Konrad Rzeszutek Wilk 2011-02-17 4:11 ` Fengzhe Zhang 1 sibling, 1 reply; 16+ messages in thread From: Konrad Rzeszutek Wilk @ 2011-02-16 15:20 UTC (permalink / raw) To: Zhang, Fengzhe; +Cc: xen-devel, Dong, Eddie, Li, Xin 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 ? ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space 2011-02-16 15:20 ` Konrad Rzeszutek Wilk @ 2011-02-16 15:47 ` Konrad Rzeszutek Wilk 2011-02-17 5:32 ` Fengzhe Zhang 0 siblings, 1 reply; 16+ messages in thread From: Konrad Rzeszutek Wilk @ 2011-02-16 15:47 UTC (permalink / raw) To: Zhang, Fengzhe; +Cc: xen-devel, Dong, Eddie, Li, Xin [-- Attachment #1: Type: text/plain, Size: 550 bytes --] On Wed, Feb 16, 2011 at 10:20:21AM -0500, Konrad Rzeszutek Wilk wrote: > 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? Also did you try to revert 0b56d9994ebe34df77fa156d2068ad93b7877b44 and see how that works? Here is the revert attached [-- Attachment #2: b4a69e9649d393a911b4e006a5362ad6db407faf --] [-- Type: text/plain, Size: 2284 bytes --] commit b4a69e9649d393a911b4e006a5362ad6db407faf Author: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com> Date: Wed Feb 16 10:38:43 2011 -0500 Revert "xen: drop all the special iomap pte paths." This reverts commit 0b56d9994ebe34df77fa156d2068ad93b7877b44. Conflicts: arch/x86/xen/mmu.c diff --git a/arch/x86/xen/mmu.c b/arch/x86/xen/mmu.c index d9cc3a0..cac8386 100644 --- a/arch/x86/xen/mmu.c +++ b/arch/x86/xen/mmu.c @@ -637,7 +637,12 @@ static bool xen_page_pinned(void *ptr) return PagePinned(page); } -void xen_set_domain_pte(pte_t *ptep, pte_t pteval, unsigned domid) +static bool xen_iomap_pte(pte_t pte) +{ + return pte_flags(pte) & _PAGE_IOMAP; +} + +static void xen_set_iomap_pte(pte_t *ptep, pte_t pteval) { struct multicall_space mcs; struct mmu_update *u; @@ -649,11 +654,10 @@ void xen_set_domain_pte(pte_t *ptep, pte_t pteval, unsigned domid) u->ptr = arbitrary_virt_to_machine(ptep).maddr; u->val = pte_val_ma(pteval); - MULTI_mmu_update(mcs.mc, mcs.args, 1, NULL, domid); + MULTI_mmu_update(mcs.mc, mcs.args, 1, NULL, DOMID_IO); xen_mc_issue(PARAVIRT_LAZY_MMU); } -EXPORT_SYMBOL_GPL(xen_set_domain_pte); static void xen_extend_mmu_update(const struct mmu_update *update) { @@ -731,6 +735,11 @@ void set_pte_mfn(unsigned long vaddr, unsigned long mfn, pgprot_t flags) void xen_set_pte_at(struct mm_struct *mm, unsigned long addr, pte_t *ptep, pte_t pteval) { + if (xen_iomap_pte(pteval)) { + xen_set_iomap_pte(ptep, pteval); + goto out; + } + ADD_STATS(set_pte_at, 1); // ADD_STATS(set_pte_at_pinned, xen_page_pinned(ptep)); ADD_STATS(set_pte_at_current, mm == current->mm); @@ -962,6 +971,11 @@ void xen_set_pud(pud_t *ptr, pud_t val) void xen_set_pte(pte_t *ptep, pte_t pte) { + if (xen_iomap_pte(pte)) { + xen_set_iomap_pte(ptep, pte); + return; + } + ADD_STATS(pte_update, 1); // ADD_STATS(pte_update_pinned, xen_page_pinned(ptep)); ADD_STATS(pte_update_batched, paravirt_get_lazy_mode() == PARAVIRT_LAZY_MMU); @@ -978,6 +992,11 @@ void xen_set_pte(pte_t *ptep, pte_t pte) #ifdef CONFIG_X86_PAE void xen_set_pte_atomic(pte_t *ptep, pte_t pte) { + if (xen_iomap_pte(pte)) { + xen_set_iomap_pte(ptep, pte); + return; + } + set_64bit((u64 *)ptep, native_pte_val(pte)); } [-- Attachment #3: Type: text/plain, Size: 138 bytes --] _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel ^ permalink raw reply related [flat|nested] 16+ messages in thread
* Re: [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space 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-18 15:16 ` [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space Konrad Rzeszutek Wilk 0 siblings, 2 replies; 16+ messages in thread From: Fengzhe Zhang @ 2011-02-17 5:32 UTC (permalink / raw) To: Konrad Rzeszutek Wilk; +Cc: xen-devel, Dong, Eddie, Li, Xin, yunhong.jiang On 2011/2/16 23:47, Konrad Rzeszutek Wilk wrote: > On Wed, Feb 16, 2011 at 10:20:21AM -0500, Konrad Rzeszutek Wilk wrote: >> 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? > > Also did you try to revert 0b56d9994ebe34df77fa156d2068ad93b7877b44 and see > how that works? Here is the revert attached > I tried this patch and it can indeed avoid system crash. However, I still doubt if the igb device is working correctly. The sequence that igb driver do ioremap is like this: 1. igb calls function pci_ubs_alloc_resource to get some non-RAM pages. 2. igb sets the phys_addr of the pages in some BAR. 3. igb ioremaps these pages. After patching, it looks like ioremap gets some mfn allocated by Xen. But what set in BAR is still phys_addr. If igb device tries to access the pages directly, would Xen be able to intercept and translate it? And also, how the contiguity of mfns be guaranteed? -Fengzhe ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space in 2.6.32.27 tree. 2011-02-17 5:32 ` Fengzhe Zhang @ 2011-02-17 14:23 ` Konrad Rzeszutek Wilk 2011-02-17 15:07 ` Li, Xin 2011-02-18 15:16 ` [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space Konrad Rzeszutek Wilk 1 sibling, 1 reply; 16+ messages in thread From: Konrad Rzeszutek Wilk @ 2011-02-17 14:23 UTC (permalink / raw) To: Fengzhe Zhang, Jeremy Fitzhardinge Cc: xen-devel, Dong, Eddie, Li, Xin, yunhong.jiang On Thu, Feb 17, 2011 at 01:32:15PM +0800, Fengzhe Zhang wrote: > On 2011/2/16 23:47, Konrad Rzeszutek Wilk wrote: > >On Wed, Feb 16, 2011 at 10:20:21AM -0500, Konrad Rzeszutek Wilk wrote: > >>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? > > > >Also did you try to revert 0b56d9994ebe34df77fa156d2068ad93b7877b44 and see > >how that works? Here is the revert attached > > > > I tried this patch and it can indeed avoid system crash. Jeremy, Could you revert 0b56d9994ebe34df77fa156d2068ad93b7877b44 please? > > However, I still doubt if the igb device is working correctly. The OK, that is a different bug, if it is a bug. > sequence that igb driver do ioremap is like this: > > 1. igb calls function pci_ubs_alloc_resource to get some non-RAM pages. > 2. igb sets the phys_addr of the pages in some BAR. > 3. igb ioremaps these pages. > > After patching, it looks like ioremap gets some mfn allocated by > Xen. But what set in BAR is still phys_addr. If igb device tries to No. It just sets the PTE to the PFN. > access the pages directly, would Xen be able to intercept and > translate it? And also, how the contiguity of mfns be guaranteed? B/c we don't touch the P2M mapping. We bypass that altogether and set the PTE with the phys_addr (which is based on the BARs). We can do that since those PFN's belong to the DOMID_IO which has a different mechanism for checking the MFN continuity (it uses ranges). > > -Fengzhe > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xensource.com > http://lists.xensource.com/xen-devel ^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space in 2.6.32.27 tree. 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 0 siblings, 1 reply; 16+ messages in thread From: Li, Xin @ 2011-02-17 15:07 UTC (permalink / raw) To: Konrad Rzeszutek Wilk, Zhang, Fengzhe, Jeremy Fitzhardinge Cc: xen-devel, Dong, Eddie, Jiang, Yunhong > > However, I still doubt if the igb device is working correctly. The > > OK, that is a different bug, if it is a bug. > > > sequence that igb driver do ioremap is like this: > > > > 1. igb calls function pci_ubs_alloc_resource to get some non-RAM pages. > > 2. igb sets the phys_addr of the pages in some BAR. > > 3. igb ioremaps these pages. > > > > After patching, it looks like ioremap gets some mfn allocated by > > Xen. But what set in BAR is still phys_addr. If igb device tries to > > No. It just sets the PTE to the PFN. Then it's just a workaround to the crash. The PFN allocated in dom0 is actually Xen RAM page, thus the driver may corrupt the page which actually belongs to Xen or other domain. > > > access the pages directly, would Xen be able to intercept and > > translate it? And also, how the contiguity of mfns be guaranteed? > > B/c we don't touch the P2M mapping. We bypass that altogether > and set the PTE with the phys_addr (which is based on the BARs). > We can do that since those PFN's belong to the DOMID_IO which > has a different mechanism for checking the MFN continuity (it > uses ranges). I'm still not persuaded this is a reasonable fix. I'm still thinking Xen can't use the PFN from dom0, it's guest PFN allocated in dom0 according to its e820 which falls into host RAM range. Thanks! -Xin ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space in 2.6.32.27 tree. 2011-02-17 15:07 ` Li, Xin @ 2011-02-17 15:35 ` Konrad Rzeszutek Wilk 0 siblings, 0 replies; 16+ messages in thread From: Konrad Rzeszutek Wilk @ 2011-02-17 15:35 UTC (permalink / raw) To: Li, Xin Cc: Jeremy Fitzhardinge, xen-devel, Dong, Eddie, Jiang, Yunhong, Zhang, Fengzhe On Thu, Feb 17, 2011 at 11:07:35PM +0800, Li, Xin wrote: > > > However, I still doubt if the igb device is working correctly. The > > > > OK, that is a different bug, if it is a bug. > > > > > sequence that igb driver do ioremap is like this: > > > > > > 1. igb calls function pci_ubs_alloc_resource to get some non-RAM pages. > > > 2. igb sets the phys_addr of the pages in some BAR. > > > 3. igb ioremaps these pages. > > > > > > After patching, it looks like ioremap gets some mfn allocated by > > > Xen. But what set in BAR is still phys_addr. If igb device tries to > > > > No. It just sets the PTE to the PFN. > > Then it's just a workaround to the crash. The PFN allocated in dom0 is actually Xen RAM page, thus the driver may corrupt the page which actually belongs to Xen or other domain. Are we taking about the crash that is fixed if you revert 0b56d9994ebe34df77fa156d2068ad93b7877b44? Or is this about the igb - if so can you create a new thread with the serial output for that crash. > > > > > > access the pages directly, would Xen be able to intercept and > > > translate it? And also, how the contiguity of mfns be guaranteed? > > > > B/c we don't touch the P2M mapping. We bypass that altogether > > and set the PTE with the phys_addr (which is based on the BARs). > > We can do that since those PFN's belong to the DOMID_IO which > > has a different mechanism for checking the MFN continuity (it > > uses ranges). > > I'm still not persuaded this is a reasonable fix. I'm still thinking Xen can't use the PFN from dom0, it's guest PFN allocated in dom0 according to its e820 which falls into host RAM range. Looking at the crash serial output, the Xen hypervisor thinks from looking at its M2P list that this is a DOMID_IO page.... ? So it wouldn't be shared by other guests? ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space 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-18 15:16 ` Konrad Rzeszutek Wilk 2011-02-20 13:58 ` Fengzhe Zhang 1 sibling, 1 reply; 16+ messages in thread From: Konrad Rzeszutek Wilk @ 2011-02-18 15:16 UTC (permalink / raw) To: Fengzhe Zhang; +Cc: xen-devel, Dong, Eddie, Li, Xin, yunhong.jiang On Thu, Feb 17, 2011 at 01:32:15PM +0800, Fengzhe Zhang wrote: > On 2011/2/16 23:47, Konrad Rzeszutek Wilk wrote: > >On Wed, Feb 16, 2011 at 10:20:21AM -0500, Konrad Rzeszutek Wilk wrote: > >>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? > > > >Also did you try to revert 0b56d9994ebe34df77fa156d2068ad93b7877b44 and see > >how that works? Here is the revert attached > > > > I tried this patch and it can indeed avoid system crash. > What happens if you use the revert _and_ don't use dom0_mem? Does the machine not crash on the igb? ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space 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 0 siblings, 0 replies; 16+ messages in thread From: Fengzhe Zhang @ 2011-02-20 13:58 UTC (permalink / raw) To: Konrad Rzeszutek Wilk; +Cc: xen-devel, Dong, Eddie, Li, Xin, Jiang, Yunhong On 2011/2/18 23:16, Konrad Rzeszutek Wilk wrote: > On Thu, Feb 17, 2011 at 01:32:15PM +0800, Fengzhe Zhang wrote: >> On 2011/2/16 23:47, Konrad Rzeszutek Wilk wrote: >>> On Wed, Feb 16, 2011 at 10:20:21AM -0500, Konrad Rzeszutek Wilk wrote: >>>> 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? >>> >>> Also did you try to revert 0b56d9994ebe34df77fa156d2068ad93b7877b44 and see >>> how that works? Here is the revert attached >>> >> >> I tried this patch and it can indeed avoid system crash. >> > > What happens if you use the revert _and_ don't use dom0_mem? Does > the machine not crash on the igb? > If dom0_mem is not used, no visible system error is observed even without the revert. -Fengzhe ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space 2011-02-16 15:06 ` Konrad Rzeszutek Wilk 2011-02-16 15:20 ` Konrad Rzeszutek Wilk @ 2011-02-17 4:11 ` Fengzhe Zhang 1 sibling, 0 replies; 16+ messages in thread From: Fengzhe Zhang @ 2011-02-17 4:11 UTC (permalink / raw) To: Konrad Rzeszutek Wilk; +Cc: xen-devel, Dong, Eddie, Li, Xin [-- Attachment #1: Type: text/plain, Size: 2513 bytes --] 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@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 > [-- Attachment #2: dump-full.txt --] [-- Type: text/plain, Size: 47562 bytes --] __ __ _ _ _ ___ _____ \ \/ /___ _ __ | || | / | / _ \ _ __ ___|___ / _ __ _ __ ___ \ // _ \ '_ \ | || |_ | || | | |__| '__/ __| |_ \ __| '_ \| '__/ _ \ / \ __/ | | | |__ _|| || |_| |__| | | (__ ___) |__| |_) | | | __/ /_/\_\___|_| |_| |_|(_)_(_)___/ |_| \___|____/ | .__/|_| \___| |_| (XEN) Xen version 4.1.0-rc3-pre (zfz@(none)) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) Sun Jan 30 21:54:34 CST 2011 (XEN) Latest ChangeSet: Fri Jan 28 19:37:49 2011 +0000 22846:52e928af3637 (XEN) Console output is synchronous. (XEN) Bootloader: GNU GRUB 0.97 (XEN) Command line: dom0_mem=1G console=com1,vga com1=115200,8n1 loglvl=all guest_loglvl=all sync_console (XEN) Video information: (XEN) VGA is text mode 80x25, font 8x16 (XEN) VBE/DDC methods: none; EDID transfer time: 0 seconds (XEN) EDID info not retrieved because no DDC retrieval method detected (XEN) Disc information: (XEN) Found 1 MBR signatures (XEN) Found 1 EDD information structures (XEN) Xen-e820 RAM map: (XEN) 0000000000000000 - 0000000000097c00 (usable) (XEN) 0000000000097c00 - 00000000000a0000 (reserved) (XEN) 00000000000e8000 - 0000000000100000 (reserved) (XEN) 0000000000100000 - 00000000defafe00 (usable) (XEN) 00000000defafe00 - 00000000defb1ea0 (ACPI NVS) (XEN) 00000000defb1ea0 - 00000000e0000000 (reserved) (XEN) 00000000f4000000 - 00000000f8000000 (reserved) (XEN) 00000000fec00000 - 00000000fed40000 (reserved) (XEN) 00000000fed45000 - 0000000100000000 (reserved) (XEN) 0000000100000000 - 000000011c000000 (usable) (XEN) ACPI: RSDP 000E5C10, 0014 (r0 COMPAQ) (XEN) ACPI: RSDT DEFC1E40, 0044 (r1 HPQOEM SLIC-BPC 20090226 0) (XEN) ACPI: FACP DEFC1EE8, 0074 (r1 COMPAQ BEARLAKE 1 0) (XEN) ACPI: DSDT DEFC2427, 9EEA (r1 COMPAQ DSDT_PRJ 1 MSFT 100000E) (XEN) ACPI: FACS DEFC1E00, 0040 (XEN) ACPI: APIC DEFC1F5C, 0084 (r1 COMPAQ BEARLAKE 1 0) (XEN) ACPI: ASF! DEFC1FE0, 0063 (r32 COMPAQ BEARLAKE 1 0) (XEN) ACPI: MCFG DEFC2043, 003C (r1 COMPAQ BEARLAKE 1 0) (XEN) ACPI: TCPA DEFC207F, 0032 (r1 COMPAQ BEARLAKE 1 0) (XEN) ACPI: SLIC DEFC20B1, 0176 (r1 HPQOEM SLIC-BPC 1 0) (XEN) ACPI: HPET DEFC2227, 0038 (r1 COMPAQ BEARLAKE 1 0) (XEN) ACPI: DMAR DEFC225F, 01A8 (r1 COMPAQ BEARLAKE 1 0) (XEN) System RAM: 4015MB (4111640kB) (XEN) No NUMA configuration found (XEN) Faking a node at 0000000000000000-000000011c000000 (XEN) Domain heap initialised (XEN) found SMP MP-table at 000f9bf0 (XEN) DMI 2.5 present. (XEN) Using APIC driver default (XEN) ACPI: PM-Timer IO Port: 0xf808 (XEN) ACPI: ACPI SLEEP INFO: pm1x_cnt[f804,460], pm1x_evt[f800,0] (XEN) ACPI: wakeup_vec[defc1e0c], vec_size[20] (XEN) ACPI: Local APIC address 0xfee00000 (XEN) ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled) (XEN) Processor #0 6:15 APIC version 20 (XEN) ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled) (XEN) Processor #1 6:15 APIC version 20 (XEN) ACPI: LAPIC (acpi_id[0x03] lapic_id[0x00] disabled) (XEN) ACPI: LAPIC (acpi_id[0x04] lapic_id[0x00] disabled) (XEN) ACPI: LAPIC_NMI (acpi_id[0x01] high edge lint[0x1]) (XEN) ACPI: LAPIC_NMI (acpi_id[0x02] high edge lint[0x1]) (XEN) ACPI: LAPIC_NMI (acpi_id[0x03] high edge lint[0x1]) (XEN) ACPI: LAPIC_NMI (acpi_id[0x04] high edge lint[0x1]) (XEN) ACPI: IOAPIC (id[0x01] address[0xfec00000] gsi_base[0]) (XEN) IOAPIC[0]: apic_id 1, version 32, address 0xfec00000, GSI 0-23 (XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl) (XEN) ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level) (XEN) ACPI: IRQ0 used by override. (XEN) ACPI: IRQ2 used by override. (XEN) ACPI: IRQ9 used by override. (XEN) Enabling APIC mode: Flat. Using 1 I/O APICs (XEN) ACPI: HPET id: 0x8086a201 base: 0xfed00000 (XEN) [VT-D]iommu.c:1119: IOMMU: unsupported (XEN) ---- print_iommu_regs ---- (XEN) drhd->address = fed90000 (XEN) VER = ffffffff (XEN) CAP = ffffffffffffffff (XEN) n_fault_reg = 100 (XEN) fault_recording_offset = 3ff0 (XEN) ECAP = ffffffffffffffff (XEN) GCMD = ffffffff (XEN) GSTS = ffffffff (XEN) RTADDR = ffffffffffffffff (XEN) CCMD = ffffffffffffffff (XEN) FSTS = ffffffff (XEN) FECTL = ffffffff (XEN) FEDATA = ffffffff (XEN) FEADDR = ffffffff (XEN) FEUADDR = ffffffff (XEN) Failed to parse ACPI DMAR. Disabling VT-d. (XEN) PCI: MCFG configuration 0: base f4000000 segment 0 buses 0 - 63 (XEN) PCI: MCFG area at f4000000 reserved in E820 (XEN) Table is not found! (XEN) Using ACPI (MADT) for SMP configuration information (XEN) IRQ limits: 24 GSI, 376 MSI/MSI-X (XEN) Using scheduler: SMP Credit Scheduler (credit) (XEN) Detected 2660.024 MHz processor. (XEN) Initing memory sharing. (XEN) mce_intel.c:1162: MCA Capability: BCAST 1 SER 0 CMCI 0 firstbank 1 extended MCE MSR 0 (XEN) Intel machine check reporting enabled (XEN) I/O virtualisation disabled (XEN) ENABLING IO-APIC IRQs (XEN) -> Using new ACK method (XEN) ..TIMER: vector=0xF0 apic1=0 pin1=2 apic2=-1 pin2=-1 (XEN) Platform timer is 14.318MHz HPET ?(XEN) Allocated console ring of 16 KiB. (XEN) VMX: Supported advanced features: (XEN) - APIC MMIO access virtualisation (XEN) - APIC TPR shadow (XEN) - Virtual NMI (XEN) - MSR direct-access bitmap (XEN) HVM: ASIDs disabled. (XEN) HVM: VMX enabled (XEN) Brought up 2 CPUs (XEN) HPET: 4 timers in total, 0 timers will be used for broadcast (XEN) ACPI sleep modes: S3 (XEN) mcheck_poll: Machine check polling timer started. (XEN) *** LOADING DOMAIN 0 *** (XEN) elf_parse_binary: phdr: paddr=0x1000000 memsz=0x7a2000 (XEN) elf_parse_binary: phdr: paddr=0x17a2000 memsz=0xcf3d8 (XEN) elf_parse_binary: phdr: paddr=0x1872000 memsz=0x888 (XEN) elf_parse_binary: phdr: paddr=0x1873000 memsz=0x15d18 (XEN) elf_parse_binary: phdr: paddr=0x1889000 memsz=0x26b000 (XEN) elf_parse_binary: memory: 0x1000000 -> 0x1af4000 (XEN) elf_xen_parse_note: GUEST_OS = "linux" (XEN) elf_xen_parse_note: GUEST_VERSION = "2.6" (XEN) elf_xen_parse_note: XEN_VERSION = "xen-3.0" (XEN) elf_xen_parse_note: VIRT_BASE = 0xffffffff80000000 (XEN) elf_xen_parse_note: ENTRY = 0xffffffff81889200 (XEN) elf_xen_parse_note: HYPERCALL_PAGE = 0xffffffff81009000 (XEN) elf_xen_parse_note: FEATURES = "!writable_page_tables|pae_pgdir_above_4gb" (XEN) elf_xen_parse_note: PAE_MODE = "yes" (XEN) elf_xen_parse_note: LOADER = "generic" (XEN) elf_xen_parse_note: unknown xen elf note (0xd) (XEN) elf_xen_parse_note: SUSPEND_CANCEL = 0x1 (XEN) elf_xen_parse_note: HV_START_LOW = 0xffff800000000000 (XEN) elf_xen_parse_note: PADDR_OFFSET = 0x0 (XEN) elf_xen_addr_calc_check: addresses: (XEN) virt_base = 0xffffffff80000000 (XEN) elf_paddr_offset = 0x0 (XEN) virt_offset = 0xffffffff80000000 (XEN) virt_kstart = 0xffffffff81000000 (XEN) virt_kend = 0xffffffff81af4000 (XEN) virt_entry = 0xffffffff81889200 (XEN) p2m_base = 0xffffffffffffffff (XEN) Xen kernel: 64-bit, lsb, compat32 (XEN) Dom0 kernel: 64-bit, PAE, lsb, paddr 0x1000000 -> 0x1af4000 (XEN) PHYSICAL MEMORY ARRANGEMENT: (XEN) Dom0 alloc.: 0000000110000000->0000000114000000 (244800 pages to be allocated) (XEN) Init. ramdisk: 000000011bc40000->000000011bfff600 (XEN) VIRTUAL MEMORY ARRANGEMENT: (XEN) Loaded kernel: ffffffff81000000->ffffffff81af4000 (XEN) Init. ramdisk: ffffffff81af4000->ffffffff81eb3600 (XEN) Phys-Mach map: ffffffff81eb4000->ffffffff820b4000 (XEN) Start info: ffffffff820b4000->ffffffff820b44b4 (XEN) Page tables: ffffffff820b5000->ffffffff820ca000 (XEN) Boot stack: ffffffff820ca000->ffffffff820cb000 (XEN) TOTAL: ffffffff80000000->ffffffff82400000 (XEN) ENTRY ADDRESS: ffffffff81889200 (XEN) Dom0 has maximum 2 VCPUs (XEN) elf_load_binary: phdr 0 at 0xffffffff81000000 -> 0xffffffff817a2000 (XEN) elf_load_binary: phdr 1 at 0xffffffff817a2000 -> 0xffffffff818713d8 (XEN) elf_load_binary: phdr 2 at 0xffffffff81872000 -> 0xffffffff81872888 (XEN) elf_load_binary: phdr 3 at 0xffffffff81873000 -> 0xffffffff81888d18 (XEN) elf_load_binary: phdr 4 at 0xffffffff81889000 -> 0xffffffff818fa000 (XEN) Scrubbing Free RAM: .............................done. (XEN) Xen trace buffers: disabled (XEN) Std. Loglevel: All (XEN) Guest Loglevel: All (XEN) ********************************************** (XEN) ******* WARNING: CONSOLE OUTPUT IS SYNCHRONOUS (XEN) ******* This option is intended to aid debugging of Xen by ensuring (XEN) ******* that all output is synchronously delivered on the serial line. (XEN) ******* However it can introduce SIGNIFICANT latencies and affect (XEN) ******* timekeeping. It is NOT recommended for production use! (XEN) ********************************************** (XEN) 3... 2... 1... (XEN) Xen is relinquishing VGA console. (XEN) *** Serial input -> DOM0 (type 'CTRL-a' three times to switch input to Xen) (XEN) Freed 216kB init memory. mapping kernel into physical memory Xen: setup ISA identity maps about to get started... [ 0.000000] Initializing cgroup subsys cpuset [ 0.000000] Initializing cgroup subsys cpu [ 0.000000] Linux version 2.6.32.27 (zfz@localhost.localdomain) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #25 SMP Thu Feb 10 21:16:16 CST 2011 [ 0.000000] Command line: ro root=/dev/sda3 pci=assign-busses console=tty console=hvc0 earlyprintk=xen [ 0.000000] KERNEL supported cpus: [ 0.000000] Intel GenuineIntel [ 0.000000] AMD AuthenticAMD [ 0.000000] Centaur CentaurHauls [ 0.000000] released 0 pages of unused memory [ 0.000000] BIOS-provided physical RAM map: [ 0.000000] Xen: 0000000000000000 - 0000000000097c00 (usable) [ 0.000000] Xen: 0000000000097c00 - 0000000000100000 (reserved) [ 0.000000] Xen: 0000000000100000 - 0000000040000000 (usable) [ 0.000000] Xen: 00000000defafe00 - 00000000defb1ea0 (ACPI NVS) [ 0.000000] Xen: 00000000defb1ea0 - 00000000e0000000 (reserved) [ 0.000000] Xen: 00000000f4000000 - 00000000f8000000 (reserved) [ 0.000000] Xen: 00000000fec00000 - 00000000fed40000 (reserved) [ 0.000000] Xen: 00000000fed45000 - 0000000100000000 (reserved) [ 0.000000] Xen: 0000000100000000 - 00000001bafaf000 (usable) [ 0.000000] bootconsole [xenboot0] enabled [ 0.000000] DMI 2.5 present. [ 0.000000] last_pfn = 0x1bafaf max_arch_pfn = 0x400000000 [ 0.000000] x86 PAT enabled: cpu 0, old 0x50100070406, new 0x7010600070106 [ 0.000000] last_pfn = 0x40000 max_arch_pfn = 0x400000000 [ 0.000000] Scanning 1 areas for low memory corruption [ 0.000000] modified physical RAM map: [ 0.000000] modified: 0000000000000000 - 0000000000001000 (usable) [ 0.000000] modified: 0000000000001000 - 0000000000006000 (reserved) [ 0.000000] modified: 0000000000006000 - 0000000000097c00 (usable) [ 0.000000] modified: 0000000000097c00 - 0000000000100000 (reserved) [ 0.000000] modified: 0000000000100000 - 0000000040000000 (usable) [ 0.000000] modified: 00000000defafe00 - 00000000defb1ea0 (ACPI NVS) [ 0.000000] modified: 00000000defb1ea0 - 00000000e0000000 (reserved) [ 0.000000] modified: 00000000f4000000 - 00000000f8000000 (reserved) [ 0.000000] modified: 00000000fec00000 - 00000000fed40000 (reserved) [ 0.000000] modified: 00000000fed45000 - 0000000100000000 (reserved) [ 0.000000] modified: 0000000100000000 - 00000001bafaf000 (usable) [ 0.000000] init_memory_mapping: 0000000000000000-0000000040000000 [ 0.000000] init_memory_mapping: 0000000100000000-00000001bafaf000 [ 0.000000] RAMDISK: 01af4000 - 01eb3600 [ 0.000000] ACPI: RSDP 00000000000e5c10 00014 (v00 COMPAQ) [ 0.000000] ACPI: RSDT 00000000defc1e40 00044 (v01 HPQOEM SLIC-BPC 20090226 00000000) [ 0.000000] ACPI: FACP 00000000defc1ee8 00074 (v01 COMPAQ BEARLAKE 00000001 00000000) [ 0.000000] ACPI: DSDT 00000000defc2427 09EEA (v01 COMPAQ DSDT_PRJ 00000001 MSFT 0100000E) [ 0.000000] ACPI: FACS 00000000defc1e00 00040 [ 0.000000] ACPI: APIC 00000000defc1f5c 00084 (v01 COMPAQ BEARLAKE 00000001 00000000) [ 0.000000] ACPI: ASF! 00000000defc1fe0 00063 (v32 COMPAQ BEARLAKE 00000001 00000000) [ 0.000000] ACPI: MCFG 00000000defc2043 0003C (v01 COMPAQ BEARLAKE 00000001 00000000) [ 0.000000] ACPI: TCPA 00000000defc207f 00032 (v01 COMPAQ BEARLAKE 00000001 00000000) [ 0.000000] ACPI: SLIC 00000000defc20b1 00176 (v01 HPQOEM SLIC-BPC 00000001 00000000) [ 0.000000] ACPI: HPET 00000000defc2227 00038 (v01 COMPAQ BEARLAKE 00000001 00000000) [ 0.000000] ACPI: XMAR 00000000defc225f 001A8 (v01 COMPAQ BEARLAKE 00000001 00000000) [ 0.000000] (10 early reservations) ==> bootmem [0000000000 - 01bafaf000] [ 0.000000] #0 [0000000000 - 0000001000] BIOS data page ==> [0000000000 - 0000001000] [ 0.000000] #1 [00020b5000 - 00020ca000] XEN PAGETABLES ==> [00020b5000 - 00020ca000] [ 0.000000] #2 [0000006000 - 0000008000] TRAMPOLINE ==> [0000006000 - 0000008000] [ 0.000000] #3 [0001000000 - 00019c9484] TEXT DATA BSS ==> [0001000000 - 00019c9484] [ 0.000000] #4 [0001af4000 - 0001eb3600] RAMDISK ==> [0001af4000 - 0001eb3600] [ 0.000000] #5 [0001eb4000 - 00020b5000] XEN START INFO ==> [0001eb4000 - 00020b5000] [ 0.000000] #6 [0100000000 - 01bafaf000] XEN EXTRA ==> [0100000000 - 01bafaf000] [ 0.000000] #7 [00019ca000 - 00019d6148] BRK ==> [00019ca000 - 00019d6148] [ 0.000000] #8 [0000100000 - 00002ea000] PGTABLE ==> [0000100000 - 00002ea000] [ 0.000000] #9 [00020ca000 - 00026a5000] PGTABLE ==> [00020ca000 - 00026a5000] [ 0.000000] found SMP MP-table at [ffff8800000f9bf0] f9bf0 [ 0.000000] Zone PFN ranges: [ 0.000000] DMA 0x00000000 -> 0x00001000 [ 0.000000] DMA32 0x00001000 -> 0x00100000 [ 0.000000] Normal 0x00100000 -> 0x001bafaf [ 0.000000] Movable zone start PFN for each node [ 0.000000] early_node_map[4] active PFN ranges [ 0.000000] 0: 0x00000000 -> 0x00000001 [ 0.000000] 0: 0x00000006 -> 0x00000097 [ 0.000000] 0: 0x00000100 -> 0x00040000 [ 0.000000] 0: 0x00100000 -> 0x001bafaf [ 0.000000] ACPI: PM-Timer IO Port: 0xf808 [ 0.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled) [ 0.000000] ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled) [ 0.000000] ACPI: LAPIC (acpi_id[0x03] lapic_id[0x00] disabled) [ 0.000000] ACPI: LAPIC (acpi_id[0x04] lapic_id[0x00] disabled) [ 0.000000] ACPI: LAPIC_NMI (acpi_id[0x01] high edge lint[0x1]) [ 0.000000] ACPI: LAPIC_NMI (acpi_id[0x02] high edge lint[0x1]) [ 0.000000] ACPI: LAPIC_NMI (acpi_id[0x03] high edge lint[0x1]) [ 0.000000] ACPI: LAPIC_NMI (acpi_id[0x04] high edge lint[0x1]) [ 0.000000] ACPI: IOAPIC (id[0x01] address[0xfec00000] gsi_base[0]) [ 0.000000] IOAPIC[0]: apic_id 1, version 0, address 0xfec00000, GSI 0-0 [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl) [ 0.000000] ERROR: Unable to locate IOAPIC for GSI 2 [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level) [ 0.000000] ERROR: Unable to locate IOAPIC for GSI 9 [ 0.000000] Using ACPI (MADT) for SMP configuration information [ 0.000000] ACPI: HPET id: 0x8086a201 base: 0xfed00000 [ 0.000000] SMP: Allowing 2 CPUs, 0 hotplug CPUs [ 0.000000] Allocating PCI resources starting at 40000000 (gap: 40000000:9efafe00) [ 0.000000] Booting paravirtualized kernel on Xen [ 0.000000] Xen version: 4.1.0-rc3-pre (preserve-AD) (dom0) [ 0.000000] NR_CPUS:64 nr_cpumask_bits:64 nr_cpu_ids:2 nr_node_ids:1 [ 0.000000] PERCPU: Embedded 29 pages/cpu @ffff88002804f000 s89368 r8192 d21224 u118784 [ 0.000000] pcpu-alloc: s89368 r8192 d21224 u118784 alloc=29*4096 [ 0.000000] pcpu-alloc: [0] 0 [0] 1 [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 1002605 [ 0.000000] Kernel command line: ro root=/dev/sda3 pci=assign-busses console=tty console=hvc0 earlyprintk=xen [ 0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes) [ 0.000000] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes) [ 0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes) [ 0.000000] Initializing CPU#0 [ 0.000000] DMA: Placing 64MB software IO TLB between ffff880020000000 - ffff880024000000 [ 0.000000] DMA: software IO TLB at phys 0x20000000 - 0x24000000 [ 0.000000] xen_swiotlb_fixup: buf=ffff880020000000 size=67108864 [ 0.000000] xen_swiotlb_fixup: buf=ffff880024060000 size=32768 [ 0.000000] Memory: 893432k/7257788k available (5196k kernel code, 3146168k absent, 3217548k reserved, 3448k data, 508k init) [ 0.000000] SLUB: Genslabs=13, HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1 [ 0.000000] Hierarchical RCU implementation. [ 0.000000] NR_IRQS:4352 nr_irqs:768 [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl) [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level) [ 0.000000] xen: sci override: source_irq=9 global_irq=9 trigger=c polarity=1 [ 0.000000] xen_allocate_pirq: returning irq 9 for gsi 9 [ 0.000000] xen: acpi sci 9 [ 0.000000] Console: colour VGA+ 80x25 [ 0.000000] Initializing cgroup subsys cpuset [ 0.000000] Initializing cgroup subsys cpu [ 0.000000] Linux version 2.6.32.27 (zfz@localhost.localdomain) (gcc version 4.1.2 20080704 (Red Hat 4.1.2-48)) #25 SMP Thu Feb 10 21:16:16 CST 2011 [ 0.000000] Command line: ro root=/dev/sda3 pci=assign-busses console=tty console=hvc0 earlyprintk=xen [ 0.000000] KERNEL supported cpus: [ 0.000000] Intel GenuineIntel [ 0.000000] AMD AuthenticAMD [ 0.000000] Centaur CentaurHauls [ 0.000000] released 0 pages of unused memory [ 0.000000] BIOS-provided physical RAM map: [ 0.000000] Xen: 0000000000000000 - 0000000000097c00 (usable) [ 0.000000] Xen: 0000000000097c00 - 0000000000100000 (reserved) [ 0.000000] Xen: 0000000000100000 - 0000000040000000 (usable) [ 0.000000] Xen: 00000000defafe00 - 00000000defb1ea0 (ACPI NVS) [ 0.000000] Xen: 00000000defb1ea0 - 00000000e0000000 (reserved) [ 0.000000] Xen: 00000000f4000000 - 00000000f8000000 (reserved) [ 0.000000] Xen: 00000000fec00000 - 00000000fed40000 (reserved) [ 0.000000] Xen: 00000000fed45000 - 0000000100000000 (reserved) [ 0.000000] Xen: 0000000100000000 - 00000001bafaf000 (usable) [ 0.000000] bootconsole [xenboot0] enabled [ 0.000000] DMI 2.5 present. [ 0.000000] last_pfn = 0x1bafaf max_arch_pfn = 0x400000000 [ 0.000000] x86 PAT enabled: cpu 0, old 0x50100070406, new 0x7010600070106 [ 0.000000] last_pfn = 0x40000 max_arch_pfn = 0x400000000 [ 0.000000] Scanning 1 areas for low memory corruption [ 0.000000] modified physical RAM map: [ 0.000000] modified: 0000000000000000 - 0000000000001000 (usable) [ 0.000000] modified: 0000000000001000 - 0000000000006000 (reserved) [ 0.000000] modified: 0000000000006000 - 0000000000097c00 (usable) [ 0.000000] modified: 0000000000097c00 - 0000000000100000 (reserved) [ 0.000000] modified: 0000000000100000 - 0000000040000000 (usable) [ 0.000000] modified: 00000000defafe00 - 00000000defb1ea0 (ACPI NVS) [ 0.000000] modified: 00000000defb1ea0 - 00000000e0000000 (reserved) [ 0.000000] modified: 00000000f4000000 - 00000000f8000000 (reserved) [ 0.000000] modified: 00000000fec00000 - 00000000fed40000 (reserved) [ 0.000000] modified: 00000000fed45000 - 0000000100000000 (reserved) [ 0.000000] modified: 0000000100000000 - 00000001bafaf000 (usable) [ 0.000000] init_memory_mapping: 0000000000000000-0000000040000000 [ 0.000000] init_memory_mapping: 0000000100000000-00000001bafaf000 [ 0.000000] RAMDISK: 01af4000 - 01eb3600 [ 0.000000] ACPI: RSDP 00000000000e5c10 00014 (v00 COMPAQ) [ 0.000000] ACPI: RSDT 00000000defc1e40 00044 (v01 HPQOEM SLIC-BPC 20090226 00000000) [ 0.000000] ACPI: FACP 00000000defc1ee8 00074 (v01 COMPAQ BEARLAKE 00000001 00000000) [ 0.000000] ACPI: DSDT 00000000defc2427 09EEA (v01 COMPAQ DSDT_PRJ 00000001 MSFT 0100000E) [ 0.000000] ACPI: FACS 00000000defc1e00 00040 [ 0.000000] ACPI: APIC 00000000defc1f5c 00084 (v01 COMPAQ BEARLAKE 00000001 00000000) [ 0.000000] ACPI: ASF! 00000000defc1fe0 00063 (v32 COMPAQ BEARLAKE 00000001 00000000) [ 0.000000] ACPI: MCFG 00000000defc2043 0003C (v01 COMPAQ BEARLAKE 00000001 00000000) [ 0.000000] ACPI: TCPA 00000000defc207f 00032 (v01 COMPAQ BEARLAKE 00000001 00000000) [ 0.000000] ACPI: SLIC 00000000defc20b1 00176 (v01 HPQOEM SLIC-BPC 00000001 00000000) [ 0.000000] ACPI: HPET 00000000defc2227 00038 (v01 COMPAQ BEARLAKE 00000001 00000000) [ 0.000000] ACPI: XMAR 00000000defc225f 001A8 (v01 COMPAQ BEARLAKE 00000001 00000000) [ 0.000000] (10 early reservations) ==> bootmem [0000000000 - 01bafaf000] [ 0.000000] #0 [0000000000 - 0000001000] BIOS data page ==> [0000000000 - 0000001000] [ 0.000000] #1 [00020b5000 - 00020ca000] XEN PAGETABLES ==> [00020b5000 - 00020ca000] [ 0.000000] #2 [0000006000 - 0000008000] TRAMPOLINE ==> [0000006000 - 0000008000] [ 0.000000] #3 [0001000000 - 00019c9484] TEXT DATA BSS ==> [0001000000 - 00019c9484] [ 0.000000] #4 [0001af4000 - 0001eb3600] RAMDISK ==> [0001af4000 - 0001eb3600] [ 0.000000] #5 [0001eb4000 - 00020b5000] XEN START INFO ==> [0001eb4000 - 00020b5000] [ 0.000000] #6 [0100000000 - 01bafaf000] XEN EXTRA ==> [0100000000 - 01bafaf000] [ 0.000000] #7 [00019ca000 - 00019d6148] BRK ==> [00019ca000 - 00019d6148] [ 0.000000] #8 [0000100000 - 00002ea000] PGTABLE ==> [0000100000 - 00002ea000] [ 0.000000] #9 [00020ca000 - 00026a5000] PGTABLE ==> [00020ca000 - 00026a5000] [ 0.000000] found SMP MP-table at [ffff8800000f9bf0] f9bf0 [ 0.000000] Zone PFN ranges: [ 0.000000] DMA 0x00000000 -> 0x00001000 [ 0.000000] DMA32 0x00001000 -> 0x00100000 [ 0.000000] Normal 0x00100000 -> 0x001bafaf [ 0.000000] Movable zone start PFN for each node [ 0.000000] early_node_map[4] active PFN ranges [ 0.000000] 0: 0x00000000 -> 0x00000001 [ 0.000000] 0: 0x00000006 -> 0x00000097 [ 0.000000] 0: 0x00000100 -> 0x00040000 [ 0.000000] 0: 0x00100000 -> 0x001bafaf [ 0.000000] ACPI: PM-Timer IO Port: 0xf808 [ 0.000000] ACPI: LAPIC (acpi_id[0x01] lapic_id[0x00] enabled) [ 0.000000] ACPI: LAPIC (acpi_id[0x02] lapic_id[0x01] enabled) [ 0.000000] ACPI: LAPIC (acpi_id[0x03] lapic_id[0x00] disabled) [ 0.000000] ACPI: LAPIC (acpi_id[0x04] lapic_id[0x00] disabled) [ 0.000000] ACPI: LAPIC_NMI (acpi_id[0x01] high edge lint[0x1]) [ 0.000000] ACPI: LAPIC_NMI (acpi_id[0x02] high edge lint[0x1]) [ 0.000000] ACPI: LAPIC_NMI (acpi_id[0x03] high edge lint[0x1]) [ 0.000000] ACPI: LAPIC_NMI (acpi_id[0x04] high edge lint[0x1]) [ 0.000000] ACPI: IOAPIC (id[0x01] address[0xfec00000] gsi_base[0]) [ 0.000000] IOAPIC[0]: apic_id 1, version 0, address 0xfec00000, GSI 0-0 [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl) [ 0.000000] ERROR: Unable to locate IOAPIC for GSI 2 [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level) [ 0.000000] ERROR: Unable to locate IOAPIC for GSI 9 [ 0.000000] Using ACPI (MADT) for SMP configuration information [ 0.000000] ACPI: HPET id: 0x8086a201 base: 0xfed00000 [ 0.000000] SMP: Allowing 2 CPUs, 0 hotplug CPUs [ 0.000000] Allocating PCI resources starting at 40000000 (gap: 40000000:9efafe00) [ 0.000000] Booting paravirtualized kernel on Xen [ 0.000000] Xen version: 4.1.0-rc3-pre (preserve-AD) (dom0) [ 0.000000] NR_CPUS:64 nr_cpumask_bits:64 nr_cpu_ids:2 nr_node_ids:1 [ 0.000000] PERCPU: Embedded 29 pages/cpu @ffff88002804f000 s89368 r8192 d21224 u118784 [ 0.000000] pcpu-alloc: s89368 r8192 d21224 u118784 alloc=29*4096 [ 0.000000] pcpu-alloc: [0] 0 [0] 1 [ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 1002605 [ 0.000000] Kernel command line: ro root=/dev/sda3 pci=assign-busses console=tty console=hvc0 earlyprintk=xen [ 0.000000] PID hash table entries: 4096 (order: 3, 32768 bytes) [ 0.000000] Dentry cache hash table entries: 524288 (order: 10, 4194304 bytes) [ 0.000000] Inode-cache hash table entries: 262144 (order: 9, 2097152 bytes) [ 0.000000] Initializing CPU#0 [ 0.000000] DMA: Placing 64MB software IO TLB between ffff880020000000 - ffff880024000000 [ 0.000000] DMA: software IO TLB at phys 0x20000000 - 0x24000000 [ 0.000000] xen_swiotlb_fixup: buf=ffff880020000000 size=67108864 [ 0.000000] xen_swiotlb_fixup: buf=ffff880024060000 size=32768 [ 0.000000] Memory: 893432k/7257788k available (5196k kernel code, 3146168k absent, 3217548k reserved, 3448k data, 508k init) [ 0.000000] SLUB: Genslabs=13, HWalign=64, Order=0-3, MinObjects=0, CPUs=2, Nodes=1 [ 0.000000] Hierarchical RCU implementation. [ 0.000000] NR_IRQS:4352 nr_irqs:768 [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 0 global_irq 2 dfl dfl) [ 0.000000] ACPI: INT_SRC_OVR (bus 0 bus_irq 9 global_irq 9 high level) [ 0.000000] xen: sci override: source_irq=9 global_irq=9 trigger=c polarity=1 [ 0.000000] xen_allocate_pirq: returning irq 9 for gsi 9 [ 0.000000] xen: acpi sci 9 [ 0.000000] Console: colour VGA+ 80x25 [ 0.000000] console [tty0] enabled [ 0.000000] console [hvc0] enabled, bootconsole disabled [ 0.000000] console [hvc0] enabled, bootconsole disabled [ 0.000000] installing Xen timer for CPU 0 [ 0.000000] Detected 2660.024 MHz processor. [ 0.000999] Calibrating delay loop (skipped), value calculated using timer frequency.. 5320.04 BogoMIPS (lpj=2660024) [ 0.000999] Security Framework initialized [ 0.000999] SELinux: Initializing. [ 0.000999] Mount-cache hash table entries: 256 [ 0.001255] Initializing cgroup subsys ns [ 0.001999] Initializing cgroup subsys cpuacct [ 0.001999] Initializing cgroup subsys freezer [ 0.002027] CPU: L1 I cache: 32K, L1 D cache: 32K [ 0.002999] CPU: L2 cache: 4096K [ 0.003007] CPU: Physical Processor ID: 0 [ 0.003999] CPU: Processor Core ID: 0 [ 0.004006] mce: CPU supports 6 MCE banks [ 0.005018] Performance Events: unsupported p6 CPU model 15 no PMU driver, software events only. [ 0.005999] SMP alternatives: switching to UP code [ 0.005999] ACPI: Core revision 20090903 [ 0.019085] cpu 0 spinlock event irq 766 [ 0.020243] installing Xen timer for CPU 1 [ 0.021018] cpu 1 spinlock event irq 760 [ 0.022020] SMP alternatives: switching to SMP code [ 0.000999] Initializing CPU#1 [ 0.000999] CPU: L1 I cache: 32K, L1 D cache: 32K [ 0.000999] CPU: L2 cache: 4096K [ 0.000999] CPU: Physical Processor ID: 0 [ 0.000999] CPU: Processor Core ID: 1 [ 0.023143] Brought up 2 CPUs [ 0.031247] Grant table initialized [ 0.031995] Time: 13:19:04 Date: 02/10/11 [ 0.032303] NET: Registered protocol family 16 [ 0.033095] ACPI: bus type pci registered [ 0.034093] PCI: MCFG configuration 0: base f4000000 segment 0 buses 0 - 63 [ 0.034994] PCI: MCFG area at f4000000 reserved in E820 [ 0.048403] PCI: Using MMCONFIG at f4000000 - f7ffffff [ 0.048992] PCI: Using configuration type 1 for base access [ 0.063171] bio: create slab <bio-0> at 0 [ 0.065370] ERROR: Unable to locate IOAPIC for GSI 9 [ 0.078035] ACPI: Interpreter enabled [ 0.078987] ACPI: (supports S0 S3 S5) [ 0.084896] ACPI: Using IOAPIC for interrupt routing [ 0.104984] ACPI: No dock devices found. [ 0.109122] ACPI Error (dsfield-0143): [CAPD] Namespace lookup failure, AE_ALREADY_EXISTS [ 0.109983] ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PCI0._OSC] (Node ffff88003fc15ba0), AE_ALREADY_EXISTS [ 0.109983] ACPI: Marking method _OSC as Serialized because of AE_ALREADY_EXISTS error [ 0.109983] ACPI Warning for \_SB_.PCI0._OSC: Parameter count mismatch - ASL declared 5, ACPI requires 4 (20090903/nspredef-336) [ 0.109983] ACPI: PCI Root Bridge [PCI0] (0000:00) [ 0.150324] pci 0000:00:03.0: PME# supported from D0 D3hot D3cold [ 0.150977] pci 0000:00:03.0: PME# disabled [ 0.150977] pci 0000:00:19.0: PME# supported from D0 D3hot D3cold [ 0.150977] pci 0000:00:19.0: PME# disabled [ 0.150977] pci 0000:00:1a.7: PME# supported from D0 D3hot D3cold [ 0.150977] pci 0000:00:1a.7: PME# disabled [ 0.150977] pci 0000:00:1b.0: PME# supported from D0 D3hot D3cold [ 0.150977] pci 0000:00:1b.0: PME# disabled [ 0.150977] pci 0000:00:1c.0: PME# supported from D0 D3hot D3cold [ 0.150977] pci 0000:00:1c.0: PME# disabled [ 0.150977] pci 0000:00:1c.1: PME# supported from D0 D3hot D3cold [ 0.150977] pci 0000:00:1c.1: PME# disabled [ 0.150977] pci 0000:00:1d.7: PME# supported from D0 D3hot D3cold [ 0.150977] pci 0000:00:1d.7: PME# disabled [ 0.221120] pci 0000:00:1f.0: quirk: region f800-f87f claimed by ICH6 ACPI/GPIO/TCO [ 0.221966] pci 0000:00:1f.0: quirk: region fa00-fa3f claimed by ICH6 GPIO [ 0.221966] pci 0000:00:1f.0: ICH7 LPC Generic IO decode 1 PIO at 0400 (mask 007f) [ 0.221966] pci 0000:00:1f.0: ICH7 LPC Generic IO decode 2 PIO at 0480 (mask 000f) [ 0.221966] pci 0000:00:1f.0: ICH7 LPC Generic IO decode 3 PIO at 0cb0 (mask 000f) [ 0.221966] pci 0000:00:1f.2: PME# supported from D3hot [ 0.221966] pci 0000:00:1f.2: PME# disabled [ 0.221966] pci 0000:03:04.0: PME# supported from D0 D1 D2 D3hot D3cold [ 0.221966] pci 0000:03:04.0: PME# disabled [ 0.221966] pci 0000:00:1e.0: transparent bridge [ 0.279972] ACPI Error (dsfield-0143): [CAPD] Namespace lookup failure, AE_ALREADY_EXISTS [ 0.280957] ACPI Error (psparse-0537): Method parse/execution failed [\_SB_.PCI0._OSC] (Node ffff88003fc15ba0), AE_ALREADY_EXISTS [ 0.280957] ACPI Warning for \_SB_.PCI0._OSC: Parameter count mismatch - ASL declared 5, ACPI requires 4 (20090903/nspredef-336) (XEN) PCI add device 00:00.0 (XEN) PCI add device 00:02.0 (XEN) PCI add device 00:02.1 (XEN) PCI add device 00:03.0 (XEN) PCI add device 00:03.2 (XEN) PCI add device 00:03.3 (XEN) PCI add device 00:19.0 (XEN) PCI add device 00:1a.0 (XEN) PCI add device 00:1a.1 (XEN) PCI add device 00:1a.7 (XEN) PCI add device 00:1b.0 (XEN) PCI add device 00:1c.0 (XEN) PCI add device 00:1c.1 (XEN) PCI add device 00:1d.0 (XEN) PCI add device 00:1d.1 (XEN) PCI add device 00:1d.2 (XEN) PCI add device 00:1d.7 (XEN) PCI add device 00:1e.0 (XEN) PCI add device 00:1f.0 (XEN) PCI add device 00:1f.2 (XEN) PCI add device 03:04.0 [ 0.397073] ACPI: PCI Interrupt Link [LNKA] (IRQs 3 4 *5 6 7 10 11 14 15) [ 0.397951] ACPI: PCI Interrupt Link [LNKB] (IRQs 3 4 5 6 7 *10 11 14 15) [ 0.397951] ACPI: PCI Interrupt Link [LNKC] (IRQs 3 4 5 6 7 *10 11 14 15) [ 0.397951] ACPI: PCI Interrupt Link [LNKD] (IRQs 3 4 *5 6 7 10 11 14 15) [ 0.397951] ACPI: PCI Interrupt Link [LNKE] (IRQs 3 4 *5 6 7 10 11 14 15) [ 0.397951] ACPI: PCI Interrupt Link [LNKF] (IRQs 3 4 5 6 7 10 *11 14 15) [ 0.397951] ACPI: PCI Interrupt Link [LNKG] (IRQs 3 4 *5 6 7 10 11 14 15) [ 0.397951] ACPI: PCI Interrupt Link [LNKH] (IRQs 3 4 5 6 7 10 11 14 15) *0, disabled. [ 0.448008] xen_balloon: Initialising balloon driver with page order 0. [ 0.455001] last_pfn = 0x1bafaf max_arch_pfn = 0x400000000 [ 0.478986] vgaarb: device added: PCI:0000:00:02.0,decodes=io+mem,owns=io+mem,locks=none [ 0.479951] vgaarb: loaded [ 0.489058] usbcore: registered new interface driver usbfs [ 0.490053] usbcore: registered new interface driver hub [ 0.491014] usbcore: registered new device driver usb [ 0.492030] PCI: Using ACPI for IRQ routing [ 0.493148] cfg80211: Using static regulatory domain info [ 0.493951] cfg80211: Regulatory domain: US [ 0.493951] (start_freq - end_freq @ bandwidth), (max_antenna_gain, max_eirp) [ 0.493951] (2402000 KHz - 2472000 KHz @ 40000 KHz), (600 mBi, 2700 mBm) [ 0.493951] (5170000 KHz - 5190000 KHz @ 40000 KHz), (600 mBi, 2300 mBm) [ 0.493951] (5190000 KHz - 5210000 KHz @ 40000 KHz), (600 mBi, 2300 mBm) [ 0.493951] (5210000 KHz - 5230000 KHz @ 40000 KHz), (600 mBi, 2300 mBm) [ 0.493951] (5230000 KHz - 5330000 KHz @ 40000 KHz), (600 mBi, 2300 mBm) [ 0.493951] (5735000 KHz - 5835000 KHz @ 40000 KHz), (600 mBi, 3000 mBm) [ 0.493986] cfg80211: Calling CRDA for country: US [ 0.495002] NetLabel: Initializing [ 0.495951] NetLabel: domain hash size = 128 [ 0.495951] NetLabel: protocols = UNLABELED CIPSOv4 [ 0.495951] NetLabel: unlabeled traffic allowed by default [ 0.496321] Switching to clocksource xen [ 0.497986] pnp: PnP ACPI init [ 0.497986] ACPI: bus type pnp registered [ 0.510007] xen_allocate_pirq: returning irq 13 for gsi 13 [ 0.515796] xen_allocate_pirq: returning irq 8 for gsi 8 [ 0.521403] xen_allocate_pirq: returning irq 12 for gsi 12 [ 0.527036] xen_allocate_pirq: returning irq 1 for gsi 1 [ 0.533067] xen_allocate_pirq: returning irq 7 for gsi 7 [ 0.539064] xen_allocate_pirq: returning irq 4 for gsi 4 [ 0.544370] Already setup the GSI :4 [ 0.548592] xen_allocate_pirq: returning irq 6 for gsi 6 [ 0.555694] pnp 00:0e: io resource (0xf800-0xf81f) overlaps 0000:00:1f.0 BAR 13 (0xf800-0xf87f), disabling [ 0.556597] pnp 00:0e: io resource (0xf820-0xf83f) overlaps 0000:00:1f.0 BAR 13 (0xf800-0xf87f), disabling [ 0.556597] pnp 00:0e: io resource (0xf840-0xf85f) overlaps 0000:00:1f.0 BAR 13 (0xf800-0xf87f), disabling [ 0.556597] pnp 00:0e: io resource (0xf860-0xf87f) overlaps 0000:00:1f.0 BAR 13 (0xf800-0xf87f), disabling [ 0.595745] pnp 00:10: mem resource (0x0-0x9ffff) overlaps 0000:03:04.0 BAR 6 (0x0-0xfffff), disabling [ 0.596303] pnp 00:10: mem resource (0xe4000-0xfffff) overlaps 0000:03:04.0 BAR 6 (0x0-0xfffff), disabling [ 0.596303] pnp 00:10: mem resource (0xcd400-0xe3fff) overlaps 0000:03:04.0 BAR 6 (0x0-0xfffff), disabling [ 0.624662] pnp: PnP ACPI: found 17 devices [ 0.625626] ACPI: ACPI bus type pnp unregistered [ 0.625626] system 00:0e: ioport range 0x400-0x41f has been reserved [ 0.625626] system 00:0e: ioport range 0x420-0x43f has been reserved [ 0.625626] system 00:0e: ioport range 0x440-0x45f has been reserved [ 0.625626] system 00:0e: ioport range 0x460-0x47f has been reserved [ 0.625626] system 00:0e: ioport range 0x480-0x48f has been reserved [ 0.625626] system 00:0e: ioport range 0xfa00-0xfa3f has been reserved [ 0.625626] system 00:0e: ioport range 0xfc00-0xfc7f has been reserved [ 0.625626] system 00:0e: ioport range 0xfc80-0xfcff has been reserved [ 0.625626] system 00:0e: ioport range 0xfe00-0xfe7f has been reserved [ 0.625626] system 00:0e: ioport range 0xfe80-0xfeff has been reserved [ 0.625626] system 00:0f: ioport range 0x4d0-0x4d1 has been reserved [ 0.625626] system 00:10: iomem range 0x100000-0xdfffffff could not be reserved [ 0.625626] system 00:10: iomem range 0xfec01000-0xfecfffff has been reserved [ 0.625626] system 00:10: iomem range 0xfed00400-0xfed3ffff has been reserved [ 0.625626] system 00:10: iomem range 0xfed45000-0xffffffff has been reserved [ 0.625626] system 00:10: iomem range 0xf4000000-0xf7ffffff has been reserved [ 0.747353] PM-Timer failed consistency check (0x0xffffff) - aborting. [ 0.748302] pci 0000:00:1c.0: PCI bridge, secondary bus 0000:01 [ 0.748302] pci 0000:00:1c.0: IO window: 0x3000-0x3fff [ 0.748302] pci 0000:00:1c.0: MEM window: 0x40000000-0x401fffff [ 0.748302] pci 0000:00:1c.0: PREFETCH window: 0x00000040200000-0x000000403fffff [ 0.748302] pci 0000:00:1c.1: PCI bridge, secondary bus 0000:02 [ 0.748302] pci 0000:00:1c.1: IO window: 0x4000-0x4fff [ 0.748302] pci 0000:00:1c.1: MEM window: 0x40400000-0x405fffff [ 0.748302] pci 0000:00:1c.1: PREFETCH window: 0x00000040600000-0x000000407fffff [ 0.748302] pci 0000:00:1e.0: PCI bridge, secondary bus 0000:03 [ 0.748302] pci 0000:00:1e.0: IO window: 0x1000-0x1fff [ 0.748302] pci 0000:00:1e.0: MEM window: 0xf0000000-0xf01fffff [ 0.748302] pci 0000:00:1e.0: PREFETCH window: 0x40800000-0x408fffff [ 0.828321] pci 0000:00:1c.1: PCI INT B -> GSI 21 (level, low) -> IRQ 21 [ 0.835160] NET: Registered protocol family 2 [ 0.836094] IP route cache hash table entries: 131072 (order: 8, 1048576 bytes) [ 0.847939] TCP established hash table entries: 262144 (order: 10, 4194304 bytes) [ 0.848795] TCP bind hash table entries: 65536 (order: 8, 1048576 bytes) [ 0.864240] TCP: Hash tables configured (established 262144 bind 65536) [ 0.864765] TCP reno registered [ 0.874217] NET: Registered protocol family 1 [ 0.878924] pci 0000:03:04.0: Firmware left e100 interrupts enabled; disabling [ 0.886299] Trying to unpack rootfs image as initramfs... [ 0.896947] Freeing initrd memory: 3837k freed [ 0.897305] PCI-DMA: Using software bounce buffering for IO (SWIOTLB) [ 0.897305] DMA: Placing 64MB software IO TLB between ffff880020000000 - ffff880024000000 [ 0.897305] DMA: software IO TLB at phys 0x20000000 - 0x24000000 [ 0.923462] kvm: no hardware support [ 0.924429] has_svm: not amd [ 0.927059] kvm: no hardware support [ 0.935225] Machine check injector initialized [ 0.940673] Microcode Update Driver: v2.00 <tigran@aivazian.fsnet.co.uk>, Peter Oruba [ 0.941657] Scanning for low memory corruption every 60 seconds [ 0.954899] audit: initializing netlink socket (disabled) [ 0.960303] type=2000 audit(1297343945.987:1): initialized [ 0.973729] HugeTLB registered 2 MB page size, pre-allocated 0 pages [ 0.986016] VFS: Disk quotas dquot_6.5.2 [ 0.990142] Dquot-cache hash table entries: 512 (order 0, 4096 bytes) [ 0.998074] msgmni has been set to 1753 [ 1.003126] alg: No test for stdrng (krng) [ 1.007446] Block layer SCSI generic (bsg) driver version 0.4 loaded (major 252) [ 1.008428] io scheduler noop registered [ 1.008428] io scheduler anticipatory registered [ 1.008428] io scheduler deadline registered [ 1.027945] io scheduler cfq registered (default) [ 1.034136] pci_hotplug: PCI Hot Plug PCI Core version: 0.5 [ 1.039806] pci-stub: invalid id string "" [ 1.044639] input: Power Button as /class/input/input0 [ 1.045621] ACPI: Power Button [PBTN] [ 1.053770] input: Power Button as /class/input/input1 [ 1.054754] ACPI: Power Button [PWRF] [ 1.063134] ACPI: SSDT 00000000defcd42b 003AC (v01 COMPAQ CPU_TM2 00000001 MSFT 0100000E) [ 1.072474] ACPI: SSDT 00000000defcd2af 0017C (v01 COMPAQ CST 00000001 MSFT 0100000E) [ 1.085233] Marking TSC unstable due to TSC halts in idle [ 1.090656] ACPI: CPU-1 (power states: C1[C1] C2[C2]) [ 1.096536] ACPI: CPU-1 (power states: C1[C1] C2[C2]) [ 1.110485] Event-channel device installed. [ 1.116519] registering netback [ 1.128180] hpet_acpi_add: no address or irqs in _CRS [ 1.133445] Non-volatile memory driver v1.3 [ 1.139544] Linux agpgart interface v0.103 [ 1.140304] agpgart-intel 0000:00:00.0: Intel Q35 Chipset [ 1.150358] agpgart-intel 0000:00:00.0: detected 6140K stolen memory (XEN) mm.c:889:d0 Error getting mfn 40900 (pfn 5555555555555555) from L1 entry 8000000040900473 for l1e_owner=0, pg_owner=0 (XEN) mm.c:889:d0 Error getting mfn 40900 (pfn 5555555555555555) from L1 entry 8000000040900473 for l1e_owner=0, pg_owner=0 (XEN) mm.c:4951:d0 ptwr_emulate: could not get_page_from_l1e() [ 1.175442] BUG: unable to handle kernel paging request at ffff88003fc10340 [ 1.175442] IP: [<ffffffff81037151>] xen_set_pte+0x3e/0x4b [ 1.175442] PGD 1002067 PUD 1006067 PMD 2e8067 PTE 801000003fc10065 [ 1.175442] Oops: 0003 [#1] SMP [ 1.175442] last sysfs file: [ 1.175442] CPU 0 [ 1.175442] Modules linked in: [ 1.175442] Pid: 1, comm: swapper Not tainted 2.6.32.27 #25 HP Compaq dc7800p Convertible Minitower [ 1.175442] RIP: e030:[<ffffffff81037151>] [<ffffffff81037151>] xen_set_pte+0x3e/0x4b [ 1.175442] RSP: e02b:ffff88003fc71ab0 EFLAGS: 00010246 [ 1.175442] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 8000000040900473 [ 1.175442] RDX: 0000000000000000 RSI: 8000000040900473 RDI: ffff88003fc10340 [ 1.175442] RBP: ffff88003fc71ad0 R08: 0000000000000000 R09: ffffffff818687d0 [ 1.175442] R10: 8000000000000573 R11: 800000000000056b R12: 8000000040900473 [ 1.175442] R13: ffff88003fc10340 R14: ffffc90000068000 R15: ffff88003fc10340 [ 1.175442] FS: 0000000000000000(0000) GS:ffff88002804f000(0000) knlGS:0000000000000000 [ 1.175442] CS: e033 DS: 0000 ES: 0000 CR0: 000000008005003b [ 1.175442] CR2: ffff88003fc10340 CR3: 0000000001001000 CR4: 0000000000002660 [ 1.175442] DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000 [ 1.175442] DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400 [ 1.175442] Process swapper (pid: 1, threadinfo ffff88003fc70000, task ffff88003fc68000) [ 1.175442] Stack: [ 1.175442] ffffffff811e6d84 ffff88003fc68000 ffffffff817b9180 8000000040900473 [ 1.175442] <0> ffff88003fc71b30 ffffffff81038a71 ffff88003fc71b30 ffffffff8103627b [ 1.175442] <0> 800000000000056b 8000000000000573 ffffffff818687d0 ffff88003fc10340 [ 1.175442] Call Trace: [ 1.175442] [<ffffffff811e6d84>] ? rb_insert_color+0x68/0xe3 [ 1.175442] [<ffffffff81038a71>] xen_set_pte_at+0xdb/0xea [ 1.175442] [<ffffffff8103627b>] ? __raw_callee_save_xen_make_pte+0x15/0x23 [ 1.175442] [<ffffffff811e3c03>] ioremap_page_range+0x283/0x2f0 [ 1.175442] [<ffffffff810619c9>] ? change_page_attr_set+0x27/0x29 [ 1.175442] [<ffffffff81060450>] __ioremap_caller+0x274/0x2ee [ 1.175442] [<ffffffff81287615>] ? intel_i915_configure+0x2e0/0x320 [ 1.175442] [<ffffffff811f2819>] ? pci_bus_write_config_dword+0x64/0x73 [ 1.175442] [<ffffffff8106059c>] ioremap_nocache+0x12/0x14 [ 1.175442] [<ffffffff81287615>] intel_i915_configure+0x2e0/0x320 [ 1.175442] [<ffffffff8128102c>] agp_add_bridge+0x377/0x5c2 [ 1.175442] [<ffffffff814f156d>] agp_intel_probe+0x2a4/0x2c4 [ 1.175442] [<ffffffff811f7e76>] local_pci_probe+0x12/0x16 [ 1.175442] [<ffffffff811f8676>] pci_device_probe+0x5c/0x88 [ 1.175442] [<ffffffff812d3ddd>] ? driver_sysfs_add+0x4d/0x73 [ 1.175442] [<ffffffff812d3f2e>] driver_probe_device+0xb2/0x136 [ 1.175442] [<ffffffff812d4006>] __driver_attach+0x54/0x78 [ 1.175442] [<ffffffff812d3fb2>] ? __driver_attach+0x0/0x78 [ 1.175442] [<ffffffff812d3fb2>] ? __driver_attach+0x0/0x78 [ 1.175442] [<ffffffff812d3491>] bus_for_each_dev+0x49/0x78 [ 1.175442] [<ffffffff812d3d8e>] driver_attach+0x1c/0x1e [ 1.175442] [<ffffffff812d2f98>] bus_add_driver+0xba/0x228 [ 1.175442] [<ffffffff812d42c6>] driver_register+0x9e/0x115 [ 1.175442] [<ffffffff818b2dc2>] ? agp_intel_init+0x0/0x29 [ 1.175442] [<ffffffff811f88e9>] __pci_register_driver+0x50/0xac [ 1.175442] [<ffffffff818b2dc2>] ? agp_intel_init+0x0/0x29 [ 1.175442] [<ffffffff818b2de9>] agp_intel_init+0x27/0x29 [ 1.175442] [<ffffffff8100a0e8>] do_one_initcall+0x5a/0x151 [ 1.175442] [<ffffffff81889d79>] kernel_init+0x142/0x198 [ 1.175442] [<ffffffff8103dcea>] child_rip+0xa/0x20 [ 1.175442] [<ffffffff8103cea1>] ? int_ret_from_sys_call+0x7/0x1b [ 1.175442] [<ffffffff8103d65d>] ? retint_restore_args+0x5/0x6 [ 1.175442] [<ffffffff8103dce0>] ? child_rip+0x0/0x20 [ 1.175442] Code: e8 3c ff ff ff ff 05 93 c1 8c 00 e8 31 ff ff ff 8b 1d 90 c1 8c 00 e8 1f 48 02 00 ff c8 0f 94 c0 0f b6 c0 01 d8 89 05 7b c1 8c 00 <4d> 89 65 00 41 58 5b 41 5c 41 5d c9 c3 55 48 89 e5 53 89 fb 48 [ 1.175442] RIP [<ffffffff81037151>] xen_set_pte+0x3e/0x4b [ 1.175442] RSP <ffff88003fc71ab0> [ 1.175442] CR2: ffff88003fc10340 [ 1.175442] ---[ end trace 7e4ae6af5bb6cc49 ]--- [ 1.579194] Kernel panic - not syncing: Attempted to kill init! [ 1.580174] Pid: 1, comm: swapper Tainted: G D 2.6.32.27 #25 [ 1.580174] Call Trace: [ 1.580174] [<ffffffff81079357>] panic+0xa0/0x168 [ 1.580174] [<ffffffff810ad913>] ? atomic_add_unless+0x29/0x42 [ 1.580174] [<ffffffff810a2b7a>] ? raw_local_irq_disable+0x19/0x1b [ 1.580174] [<ffffffff81082058>] ? raw_local_irq_enable+0x19/0x1b [ 1.580174] [<ffffffff8108206a>] ? __write_unlock_irq+0x10/0x12 [ 1.580174] [<ffffffff81082a05>] ? exit_ptrace+0x9c/0x10d [ 1.580174] [<ffffffff810a2b7a>] ? raw_local_irq_disable+0x19/0x1b [ 1.580174] [<ffffffff8107ac4d>] ? raw_local_irq_enable+0x19/0x1b [ 1.580174] [<ffffffff8107c37c>] do_exit+0x79/0x670 [ 1.580174] [<ffffffff81030051>] ? vmx_handle_exit+0x15f/0x1ad [ 1.580174] [<ffffffff8150db1f>] oops_end+0xdd/0xe5 [ 1.580174] [<ffffffff8105fb05>] no_context+0x1eb/0x1fa [ 1.580174] [<ffffffff81030051>] ? vmx_handle_exit+0x15f/0x1ad [ 1.580174] [<ffffffff8105fd55>] __bad_area_nosemaphore+0x185/0x1a8 [ 1.580174] [<ffffffff8105f2fc>] ? spurious_fault_check+0x1b/0x42 [ 1.580174] [<ffffffff8105fdee>] bad_area_nosemaphore+0xe/0x10 [ 1.580174] [<ffffffff8150ef7d>] do_page_fault+0x14c/0x271 [ 1.580174] [<ffffffff8150d025>] page_fault+0x25/0x30 [ 1.580174] [<ffffffff81037151>] ? xen_set_pte+0x3e/0x4b [ 1.580174] [<ffffffff811e6d84>] ? rb_insert_color+0x68/0xe3 [ 1.580174] [<ffffffff81038a71>] xen_set_pte_at+0xdb/0xea [ 1.580174] [<ffffffff8103627b>] ? __raw_callee_save_xen_make_pte+0x15/0x23 [ 1.580174] [<ffffffff811e3c03>] ioremap_page_range+0x283/0x2f0 [ 1.580174] [<ffffffff810619c9>] ? change_page_attr_set+0x27/0x29 [ 1.580174] [<ffffffff81060450>] __ioremap_caller+0x274/0x2ee [ 1.580174] [<ffffffff81287615>] ? intel_i915_configure+0x2e0/0x320 [ 1.580174] [<ffffffff811f2819>] ? pci_bus_write_config_dword+0x64/0x73 [ 1.580174] [<ffffffff8106059c>] ioremap_nocache+0x12/0x14 [ 1.580174] [<ffffffff81287615>] intel_i915_configure+0x2e0/0x320 [ 1.580174] [<ffffffff8128102c>] agp_add_bridge+0x377/0x5c2 [ 1.580174] [<ffffffff814f156d>] agp_intel_probe+0x2a4/0x2c4 [ 1.580174] [<ffffffff811f7e76>] local_pci_probe+0x12/0x16 [ 1.580174] [<ffffffff811f8676>] pci_device_probe+0x5c/0x88 [ 1.580174] [<ffffffff812d3ddd>] ? driver_sysfs_add+0x4d/0x73 [ 1.580174] [<ffffffff812d3f2e>] driver_probe_device+0xb2/0x136 [ 1.580174] [<ffffffff812d4006>] __driver_attach+0x54/0x78 [ 1.580174] [<ffffffff812d3fb2>] ? __driver_attach+0x0/0x78 [ 1.580174] [<ffffffff812d3fb2>] ? __driver_attach+0x0/0x78 [ 1.580174] [<ffffffff812d3491>] bus_for_each_dev+0x49/0x78 [ 1.580174] [<ffffffff812d3d8e>] driver_attach+0x1c/0x1e [ 1.580174] [<ffffffff812d2f98>] bus_add_driver+0xba/0x228 [ 1.580174] [<ffffffff812d42c6>] driver_register+0x9e/0x115 [ 1.580174] [<ffffffff818b2dc2>] ? agp_intel_init+0x0/0x29 [ 1.580174] [<ffffffff811f88e9>] __pci_register_driver+0x50/0xac [ 1.580174] [<ffffffff818b2dc2>] ? agp_intel_init+0x0/0x29 [ 1.580174] [<ffffffff818b2de9>] agp_intel_init+0x27/0x29 [ 1.580174] [<ffffffff8100a0e8>] do_one_initcall+0x5a/0x151 [ 1.580174] [<ffffffff81889d79>] kernel_init+0x142/0x198 [ 1.580174] [<ffffffff8103dcea>] child_rip+0xa/0x20 [ 1.580174] [<ffffffff8103cea1>] ? int_ret_from_sys_call+0x7/0x1b [ 1.580174] [<ffffffff8103d65d>] ? retint_restore_args+0x5/0x6 [ 1.580174] [<ffffffff8103dce0>] ? child_rip+0x0/0x20 (XEN) Domain 0 crashed: rebooting machine in 5 seconds. [-- Attachment #3: Type: text/plain, Size: 138 bytes --] _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space 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 @ 2011-02-18 22:05 ` Konrad Rzeszutek Wilk 2011-02-20 14:14 ` Fengzhe Zhang 1 sibling, 1 reply; 16+ messages in thread From: Konrad Rzeszutek Wilk @ 2011-02-18 22:05 UTC (permalink / raw) To: Zhang, Fengzhe; +Cc: xen-devel, Dong, Eddie, Li, Xin 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 > > 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. So I am coming back to your patch trying to understand how it makes the intel-agp crash go away. What this patch in effect does is inhibit ioremap from inadvertly mapping System RAM, which it could do before this - b/c it considered the "zapped" System RAM (so e820->size = 0) as gap. But looking at the intel-agp.c code works, it seems like it wouldn't really care about it initially. It figures out where to physical GTT is by poking the "intel_private.registers+I810_PGETBL_CTL". Earlier we also make a call in "agp_intel_probe" to do "pci_assign_resource(pdev, 0)" which irregardless of this patch or not, would work (since the BARs don't change with this patch? or do they?). The ioremap which is done in "intel_i9xx_setup_flush" would now potentially _not_ work since the region the GTT might be in the RAM region, and ioremap would consult the e820 table and find it is "UNUSABLE".. We then would continue on without the flush page with "can't ioremap flush page - no chipset flushing" Is that really what this patch achieves? How is this related to the igb driver? Can you provide a serial output of before this patch, and after this patch? I am really curious to see how the intel agp functions. > > 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 ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space 2011-02-18 22:05 ` Konrad Rzeszutek Wilk @ 2011-02-20 14:14 ` Fengzhe Zhang 2011-02-21 10:35 ` Li, Xin 0 siblings, 1 reply; 16+ messages in thread From: Fengzhe Zhang @ 2011-02-20 14:14 UTC (permalink / raw) To: Konrad Rzeszutek Wilk; +Cc: xen-devel, Dong, Eddie, Li, Xin On 2011/2/19 6:05, 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 >> >> 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. > > So I am coming back to your patch trying to understand how it makes > the intel-agp crash go away. What this patch in effect does is > inhibit ioremap from inadvertly mapping System RAM, which it could do > before this - b/c it considered the "zapped" System RAM (so e820->size = 0) > as gap. > > But looking at the intel-agp.c code works, it seems like it wouldn't > really care about it initially. It figures out where to physical GTT is by > poking the "intel_private.registers+I810_PGETBL_CTL". Earlier we also make a > call in "agp_intel_probe" to do "pci_assign_resource(pdev, 0)" which > irregardless of this patch or not, would work (since the BARs don't change > with this patch? or do they?). > > The ioremap which is done in "intel_i9xx_setup_flush" would now potentially > _not_ work since the region the GTT might be in the RAM region, and ioremap > would consult the e820 table and find it is "UNUSABLE".. We then would > continue on without the flush page with "can't ioremap flush page - no chipset flushing" intel_i9xx_setup_flush checks IFP(Intel Flush Page) BAR is 0 on machine bootup and calls pci_bus_alloc_resource to get an iommu page. pci_bus_alloc_resource allocates io address resource from the largest hole it finds in e820 map. Before patching, the hole would be from the top of dom0 RAM to ACPI space, which overlaps with real RAM. After patching, the hole would no longer overlap with any real RAM. The following is the E820 map on the test machine with 4GB memory: (XEN) Xen-e820 RAM map: (XEN) 0000000000000000 - 0000000000097c00 (usable) (XEN) 0000000000097c00 - 00000000000a0000 (reserved) (XEN) 00000000000e8000 - 0000000000100000 (reserved) (XEN) 0000000000100000 - 00000000defafe00 (usable) (XEN) 00000000defafe00 - 00000000defb1ea0 (ACPI NVS) (XEN) 00000000defb1ea0 - 00000000e0000000 (reserved) (XEN) 00000000f4000000 - 00000000f8000000 (reserved) (XEN) 00000000fec00000 - 00000000fed40000 (reserved) (XEN) 00000000fed45000 - 0000000100000000 (reserved) (XEN) 0000000100000000 - 000000011c000000 (usable) The following is the E820 map seen in Dom0 before patching: (Dom0 assigned with 1GB mem) [ 0.000000] BIOS-provided physical RAM map: [ 0.000000] Xen: 0000000000000000 - 0000000000097c00 (usable) [ 0.000000] Xen: 0000000000097c00 - 0000000000100000 (reserved) [ 0.000000] Xen: 0000000000100000 - 0000000040000000 (usable) [ 0.000000] Xen: 00000000defafe00 - 00000000defb1ea0 (ACPI NVS) [ 0.000000] Xen: 00000000defb1ea0 - 00000000e0000000 (reserved) [ 0.000000] Xen: 00000000f4000000 - 00000000f8000000 (reserved) [ 0.000000] Xen: 00000000fec00000 - 00000000fed40000 (reserved) [ 0.000000] Xen: 00000000fed45000 - 0000000100000000 (reserved) [ 0.000000] Xen: 0000000100000000 - 00000001bafaf000 (usable) The following is the E820 map seen in Dom0 after patching: (Dom0 assigned with 1GB mem) [ 0.000000] BIOS-provided physical RAM map: [ 0.000000] Xen: 0000000000000000 - 0000000000097c00 (usable) [ 0.000000] Xen: 0000000000097c00 - 0000000000100000 (reserved) [ 0.000000] Xen: 0000000000100000 - 0000000040000000 (usable) [ 0.000000] Xen: 0000000040000000 - 00000000defafe00 (unusable) [ 0.000000] Xen: 00000000defafe00 - 00000000defb1ea0 (ACPI NVS) [ 0.000000] Xen: 00000000defb1ea0 - 00000000e0000000 (reserved) [ 0.000000] Xen: 00000000f4000000 - 00000000f8000000 (reserved) [ 0.000000] Xen: 00000000fec00000 - 00000000fed40000 (reserved) [ 0.000000] Xen: 00000000fed45000 - 0000000100000000 (reserved) [ 0.000000] Xen: 0000000100000000 - 00000001bafaf000 (usable) The following is the /proc/iomem layout before patching: (Dom0 assigned with 1GB mem) 00000000-00000fff : System RAM 00001000-00005fff : reserved 00006000-00097bff : System RAM 00097c00-000fffff : reserved 00100000-7fffffff : System RAM 01000000-01513391 : Kernel code 01513392-018713d7 : Kernel data 018fa000-019c9483 : Kernel bss 40000000-401fffff : PCI Bus 0000:01 40200000-403fffff : PCI Bus 0000:01 40400000-405fffff : PCI Bus 0000:02 40600000-407fffff : PCI Bus 0000:02 40800000-408fffff : PCI Bus 0000:03 40800000-408fffff : 0000:03:04.0 40900000-40900fff : Intel Flush Page //notice this line defafe00-defb1e9f : ACPI Non-volatile Storage defb1ea0-dfffffff : reserved e0000000-efffffff : 0000:00:02.0 f0000000-f01fffff : PCI Bus 0000:03 f0000000-f00fffff : 0000:03:04.0 f0000000-f00fffff : e100 f0100000-f0100fff : 0000:03:04.0 f0100000-f0100fff : e100 f0200000-f02fffff : 0000:00:02.0 f0300000-f037ffff : 0000:00:02.0 f0380000-f03fffff : 0000:00:02.1 f0400000-f041ffff : 0000:00:19.0 f0400000-f041ffff : e1000e f0420000-f0423fff : 0000:00:1b.0 f0420000-f0423fff : ICH HD audio f0424000-f0424fff : 0000:00:03.3 f0425000-f0425fff : 0000:00:19.0 f0425000-f0425fff : e1000e f0426000-f04267ff : 0000:00:1f.2 f0426000-f04267ff : ahci f0426800-f0426bff : 0000:00:1a.7 f0426800-f0426bff : ehci_hcd f0426c00-f0426fff : 0000:00:1d.7 f0426c00-f0426fff : ehci_hcd f0427100-f042710f : 0000:00:03.0 f4000000-f7ffffff : PCI MMCONFIG 0 [00-3f] f4000000-f7ffffff : reserved f4000000-f7ffffff : pnp 00:10 fec00000-fed3ffff : reserved fec00000-fec00fff : IOAPIC 0 fec01000-fecfffff : pnp 00:10 fed00000-fed003ff : HPET 0 fed00400-fed3ffff : pnp 00:10 fed45000-ffffffff : reserved fed45000-ffffffff : pnp 00:10 100000000-17afaefff : System RAM 17afaf000-17bffffff : RAM buffer The following is the /proc/iomem layout after patching: (Dom0 assigned with 1GB mem) 00000000-00000fff : System RAM 00001000-00005fff : reserved 00006000-00097bff : System RAM 00097c00-000fffff : reserved 00100000-3fffffff : System RAM 01000000-015134f1 : Kernel code 015134f2-018713d7 : Kernel data 018fa000-019c9483 : Kernel bss 40000000-defafdff : Unusable memory defafe00-defb1e9f : ACPI Non-volatile Storage defb1ea0-dfffffff : reserved e0000000-efffffff : 0000:00:02.0 f0000000-f01fffff : PCI Bus 0000:03 f0000000-f00fffff : 0000:03:04.0 f0000000-f00fffff : e100 f0100000-f0100fff : 0000:03:04.0 f0100000-f0100fff : e100 f0200000-f02fffff : 0000:00:02.0 f0300000-f037ffff : 0000:00:02.0 f0380000-f03fffff : 0000:00:02.1 f0400000-f041ffff : 0000:00:19.0 f0400000-f041ffff : e1000e f0420000-f0423fff : 0000:00:1b.0 f0420000-f0423fff : ICH HD audio f0424000-f0424fff : 0000:00:03.3 f0425000-f0425fff : 0000:00:19.0 f0425000-f0425fff : e1000e f0426000-f04267ff : 0000:00:1f.2 f0426000-f04267ff : ahci f0426800-f0426bff : 0000:00:1a.7 f0426800-f0426bff : ehci_hcd f0426c00-f0426fff : 0000:00:1d.7 f0426c00-f0426fff : ehci_hcd f0427100-f042710f : 0000:00:03.0 f0428000-f0428fff : Intel Flush Page //notice this line f0500000-f06fffff : PCI Bus 0000:01 f0700000-f08fffff : PCI Bus 0000:01 f0900000-f0afffff : PCI Bus 0000:02 f0b00000-f0cfffff : PCI Bus 0000:02 f0d00000-f0dfffff : PCI Bus 0000:03 f0d00000-f0dfffff : 0000:03:04.0 f4000000-f7ffffff : PCI MMCONFIG 0 [00-3f] f4000000-f7ffffff : reserved f4000000-f7ffffff : pnp 00:10 fec00000-fed3ffff : reserved fec00000-fec00fff : IOAPIC 0 fec01000-fecfffff : pnp 00:10 fed00000-fed003ff : HPET 0 fed00400-fed3ffff : pnp 00:10 fed45000-ffffffff : reserved fed45000-ffffffff : pnp 00:10 100000000-1bafaefff : System RAM 1bafaf000-1bbffffff : RAM buffer -Fengzhe > > Is that really what this patch achieves? How is this related > to the igb driver? > > Can you provide a serial output of before this patch, and after this > patch? I am really curious to see how the intel agp functions. > > >> >> 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 > ^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space 2011-02-20 14:14 ` Fengzhe Zhang @ 2011-02-21 10:35 ` Li, Xin 2011-02-21 19:20 ` Konrad Rzeszutek Wilk 0 siblings, 1 reply; 16+ messages in thread From: Li, Xin @ 2011-02-21 10:35 UTC (permalink / raw) To: Zhang, Fengzhe, Konrad Rzeszutek Wilk; +Cc: xen-devel, Dong, Eddie 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. 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. I don't know if I missed something important here, please correct me if you find any. Also any other proposals? Thanks! -Xin > -----Original Message----- > From: Zhang, Fengzhe > Sent: Sunday, February 20, 2011 10:14 PM > To: Konrad Rzeszutek Wilk > Cc: xen-devel; Dong, Eddie; Li, Xin > Subject: Re: [Xen-devel] [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM > as I/O space > > On 2011/2/19 6:05, 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 > >> > >> 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. > > > > So I am coming back to your patch trying to understand how it makes > > the intel-agp crash go away. What this patch in effect does is > > inhibit ioremap from inadvertly mapping System RAM, which it could do > > before this - b/c it considered the "zapped" System RAM (so e820->size = 0) > > as gap. > > > > But looking at the intel-agp.c code works, it seems like it wouldn't > > really care about it initially. It figures out where to physical GTT is by > > poking the "intel_private.registers+I810_PGETBL_CTL". Earlier we also make a > > call in "agp_intel_probe" to do "pci_assign_resource(pdev, 0)" which > > irregardless of this patch or not, would work (since the BARs don't change > > with this patch? or do they?). > > > > The ioremap which is done in "intel_i9xx_setup_flush" would now potentially > > _not_ work since the region the GTT might be in the RAM region, and ioremap > > would consult the e820 table and find it is "UNUSABLE".. We then would > > continue on without the flush page with "can't ioremap flush page - no chipset > flushing" > > intel_i9xx_setup_flush checks IFP(Intel Flush Page) BAR is 0 on machine > bootup and calls pci_bus_alloc_resource to get an iommu page. > pci_bus_alloc_resource allocates io address resource from the largest > hole it finds in e820 map. Before patching, the hole would be from the > top of dom0 RAM to ACPI space, which overlaps with real RAM. After > patching, the hole would no longer overlap with any real RAM. > > The following is the E820 map on the test machine with 4GB memory: > (XEN) Xen-e820 RAM map: > (XEN) 0000000000000000 - 0000000000097c00 (usable) > (XEN) 0000000000097c00 - 00000000000a0000 (reserved) > (XEN) 00000000000e8000 - 0000000000100000 (reserved) > (XEN) 0000000000100000 - 00000000defafe00 (usable) > (XEN) 00000000defafe00 - 00000000defb1ea0 (ACPI NVS) > (XEN) 00000000defb1ea0 - 00000000e0000000 (reserved) > (XEN) 00000000f4000000 - 00000000f8000000 (reserved) > (XEN) 00000000fec00000 - 00000000fed40000 (reserved) > (XEN) 00000000fed45000 - 0000000100000000 (reserved) > (XEN) 0000000100000000 - 000000011c000000 (usable) > > The following is the E820 map seen in Dom0 before patching: > (Dom0 assigned with 1GB mem) > [ 0.000000] BIOS-provided physical RAM map: > [ 0.000000] Xen: 0000000000000000 - 0000000000097c00 (usable) > [ 0.000000] Xen: 0000000000097c00 - 0000000000100000 (reserved) > [ 0.000000] Xen: 0000000000100000 - 0000000040000000 (usable) > [ 0.000000] Xen: 00000000defafe00 - 00000000defb1ea0 (ACPI NVS) > [ 0.000000] Xen: 00000000defb1ea0 - 00000000e0000000 (reserved) > [ 0.000000] Xen: 00000000f4000000 - 00000000f8000000 (reserved) > [ 0.000000] Xen: 00000000fec00000 - 00000000fed40000 (reserved) > [ 0.000000] Xen: 00000000fed45000 - 0000000100000000 (reserved) > [ 0.000000] Xen: 0000000100000000 - 00000001bafaf000 (usable) > > The following is the E820 map seen in Dom0 after patching: > (Dom0 assigned with 1GB mem) > [ 0.000000] BIOS-provided physical RAM map: > [ 0.000000] Xen: 0000000000000000 - 0000000000097c00 (usable) > [ 0.000000] Xen: 0000000000097c00 - 0000000000100000 (reserved) > [ 0.000000] Xen: 0000000000100000 - 0000000040000000 (usable) > [ 0.000000] Xen: 0000000040000000 - 00000000defafe00 (unusable) > [ 0.000000] Xen: 00000000defafe00 - 00000000defb1ea0 (ACPI NVS) > [ 0.000000] Xen: 00000000defb1ea0 - 00000000e0000000 (reserved) > [ 0.000000] Xen: 00000000f4000000 - 00000000f8000000 (reserved) > [ 0.000000] Xen: 00000000fec00000 - 00000000fed40000 (reserved) > [ 0.000000] Xen: 00000000fed45000 - 0000000100000000 (reserved) > [ 0.000000] Xen: 0000000100000000 - 00000001bafaf000 (usable) > > The following is the /proc/iomem layout before patching: > (Dom0 assigned with 1GB mem) > 00000000-00000fff : System RAM > 00001000-00005fff : reserved > 00006000-00097bff : System RAM > 00097c00-000fffff : reserved > 00100000-7fffffff : System RAM > 01000000-01513391 : Kernel code > 01513392-018713d7 : Kernel data > 018fa000-019c9483 : Kernel bss > 40000000-401fffff : PCI Bus 0000:01 > 40200000-403fffff : PCI Bus 0000:01 > 40400000-405fffff : PCI Bus 0000:02 > 40600000-407fffff : PCI Bus 0000:02 > 40800000-408fffff : PCI Bus 0000:03 > 40800000-408fffff : 0000:03:04.0 > 40900000-40900fff : Intel Flush Page //notice this line > defafe00-defb1e9f : ACPI Non-volatile Storage > defb1ea0-dfffffff : reserved > e0000000-efffffff : 0000:00:02.0 > f0000000-f01fffff : PCI Bus 0000:03 > f0000000-f00fffff : 0000:03:04.0 > f0000000-f00fffff : e100 > f0100000-f0100fff : 0000:03:04.0 > f0100000-f0100fff : e100 > f0200000-f02fffff : 0000:00:02.0 > f0300000-f037ffff : 0000:00:02.0 > f0380000-f03fffff : 0000:00:02.1 > f0400000-f041ffff : 0000:00:19.0 > f0400000-f041ffff : e1000e > f0420000-f0423fff : 0000:00:1b.0 > f0420000-f0423fff : ICH HD audio > f0424000-f0424fff : 0000:00:03.3 > f0425000-f0425fff : 0000:00:19.0 > f0425000-f0425fff : e1000e > f0426000-f04267ff : 0000:00:1f.2 > f0426000-f04267ff : ahci > f0426800-f0426bff : 0000:00:1a.7 > f0426800-f0426bff : ehci_hcd > f0426c00-f0426fff : 0000:00:1d.7 > f0426c00-f0426fff : ehci_hcd > f0427100-f042710f : 0000:00:03.0 > f4000000-f7ffffff : PCI MMCONFIG 0 [00-3f] > f4000000-f7ffffff : reserved > f4000000-f7ffffff : pnp 00:10 > fec00000-fed3ffff : reserved > fec00000-fec00fff : IOAPIC 0 > fec01000-fecfffff : pnp 00:10 > fed00000-fed003ff : HPET 0 > fed00400-fed3ffff : pnp 00:10 > fed45000-ffffffff : reserved > fed45000-ffffffff : pnp 00:10 > 100000000-17afaefff : System RAM > 17afaf000-17bffffff : RAM buffer > > The following is the /proc/iomem layout after patching: > (Dom0 assigned with 1GB mem) > 00000000-00000fff : System RAM > 00001000-00005fff : reserved > 00006000-00097bff : System RAM > 00097c00-000fffff : reserved > 00100000-3fffffff : System RAM > 01000000-015134f1 : Kernel code > 015134f2-018713d7 : Kernel data > 018fa000-019c9483 : Kernel bss > 40000000-defafdff : Unusable memory > defafe00-defb1e9f : ACPI Non-volatile Storage > defb1ea0-dfffffff : reserved > e0000000-efffffff : 0000:00:02.0 > f0000000-f01fffff : PCI Bus 0000:03 > f0000000-f00fffff : 0000:03:04.0 > f0000000-f00fffff : e100 > f0100000-f0100fff : 0000:03:04.0 > f0100000-f0100fff : e100 > f0200000-f02fffff : 0000:00:02.0 > f0300000-f037ffff : 0000:00:02.0 > f0380000-f03fffff : 0000:00:02.1 > f0400000-f041ffff : 0000:00:19.0 > f0400000-f041ffff : e1000e > f0420000-f0423fff : 0000:00:1b.0 > f0420000-f0423fff : ICH HD audio > f0424000-f0424fff : 0000:00:03.3 > f0425000-f0425fff : 0000:00:19.0 > f0425000-f0425fff : e1000e > f0426000-f04267ff : 0000:00:1f.2 > f0426000-f04267ff : ahci > f0426800-f0426bff : 0000:00:1a.7 > f0426800-f0426bff : ehci_hcd > f0426c00-f0426fff : 0000:00:1d.7 > f0426c00-f0426fff : ehci_hcd > f0427100-f042710f : 0000:00:03.0 > f0428000-f0428fff : Intel Flush Page //notice this line > f0500000-f06fffff : PCI Bus 0000:01 > f0700000-f08fffff : PCI Bus 0000:01 > f0900000-f0afffff : PCI Bus 0000:02 > f0b00000-f0cfffff : PCI Bus 0000:02 > f0d00000-f0dfffff : PCI Bus 0000:03 > f0d00000-f0dfffff : 0000:03:04.0 > f4000000-f7ffffff : PCI MMCONFIG 0 [00-3f] > f4000000-f7ffffff : reserved > f4000000-f7ffffff : pnp 00:10 > fec00000-fed3ffff : reserved > fec00000-fec00fff : IOAPIC 0 > fec01000-fecfffff : pnp 00:10 > fed00000-fed003ff : HPET 0 > fed00400-fed3ffff : pnp 00:10 > fed45000-ffffffff : reserved > fed45000-ffffffff : pnp 00:10 > 100000000-1bafaefff : System RAM > 1bafaf000-1bbffffff : RAM buffer > > -Fengzhe > > > > > Is that really what this patch achieves? How is this related > > to the igb driver? > > > > Can you provide a serial output of before this patch, and after this > > patch? I am really curious to see how the intel agp functions. > > > > > >> > >> 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 > > ^ permalink raw reply [flat|nested] 16+ messages in thread
* Re: [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space 2011-02-21 10:35 ` Li, Xin @ 2011-02-21 19:20 ` Konrad Rzeszutek Wilk 2011-02-22 4:55 ` Li, Xin 0 siblings, 1 reply; 16+ messages in thread From: Konrad Rzeszutek Wilk @ 2011-02-21 19:20 UTC (permalink / raw) To: Li, Xin; +Cc: xen-devel, Dong, Eddie, Zhang, Fengzhe 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@oracle.com> > 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. ^ permalink raw reply [flat|nested] 16+ messages in thread
* RE: [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space 2011-02-21 19:20 ` Konrad Rzeszutek Wilk @ 2011-02-22 4:55 ` Li, Xin 0 siblings, 0 replies; 16+ messages in thread From: Li, Xin @ 2011-02-22 4:55 UTC (permalink / raw) To: Konrad Rzeszutek Wilk; +Cc: xen-devel, Dong, Eddie, Zhang, Fengzhe > 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@oracle.com> > > > > 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. That is great, thanks a lot for your help :) -Xin ^ permalink raw reply [flat|nested] 16+ messages in thread
end of thread, other threads:[~2011-02-22 4:55 UTC | newest] Thread overview: 16+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 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 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
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.