From mboxrd@z Thu Jan 1 00:00:00 1970 From: Konrad Rzeszutek Wilk Subject: Re: [PATCH] iomem: Prevent Dom0 pci bus from allocating RAM as I/O space Date: Wed, 16 Feb 2011 10:47:59 -0500 Message-ID: <20110216154759.GA3921@dumpdata.com> References: <1A42CE6F5F474C41B63392A5F80372B2335E978C@shsmsx501.ccr.corp.intel.com> <20110216150638.GC12215@dumpdata.com> <20110216152021.GA5894@dumpdata.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="azLHFNyN32YCQGCU" Return-path: Content-Disposition: inline In-Reply-To: <20110216152021.GA5894@dumpdata.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xensource.com Errors-To: xen-devel-bounces@lists.xensource.com To: "Zhang, Fengzhe" Cc: xen-devel , "Dong, Eddie" , "Li, Xin" List-Id: xen-devel@lists.xenproject.org --azLHFNyN32YCQGCU Content-Type: text/plain; charset=us-ascii Content-Disposition: inline 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 --azLHFNyN32YCQGCU Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename=b4a69e9649d393a911b4e006a5362ad6db407faf commit b4a69e9649d393a911b4e006a5362ad6db407faf Author: Konrad Rzeszutek Wilk 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)); } --azLHFNyN32YCQGCU Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xensource.com http://lists.xensource.com/xen-devel --azLHFNyN32YCQGCU--