public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: David Vrabel <dvrabel@cantab.net>
To: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Cc: linux-kernel@vger.kernel.org, xen-devel@lists.xensource.com,
	Santosh.Jodh@citrix.com, JBeulich@suse.com,
	boris.ostrovsky@oracle.com, david.vrabel@citrix.com,
	mukesh.rathor@oracle.com, xhejtman@ics.muni.cz,
	yuval.shaia@oracle.com
Subject: Re: [Xen-devel] [PATCH v1] Set 1-1 P2M for PCI BARs and MCFG regions - if needed.
Date: Fri, 25 Oct 2013 23:58:34 +0100	[thread overview]
Message-ID: <526AF79A.3050002@cantab.net> (raw)
In-Reply-To: <1382713401-4882-1-git-send-email-konrad.wilk@oracle.com>

On 25/10/13 16:03, Konrad Rzeszutek Wilk wrote:
>
>   2). Assume that INVALID_P2M_ENTRY is considered 1-1. That would require
>      auditing of the code and also making sure that any xen_privcmd_mmap
>      calls use the m2p_add_override.

I'm not sure I understand the concern about the privcmd driver's foreign 
mapping ioctls (MMAPBATCH_V2 and friends) as these all deal with MFNs 
directly and don't use the p2m.

>      However there are some
>      valid cases in which we need to check for INVALID_P2M_ENTRY -
>      balloon driver - that might be relaxed.

Yes.  And this behaviour will be retained.   I think we only need to do 
the INVALID_P2M_ENTRY => 1:1 when constructing PTEs so all other callers 
will see INVALID_P2M_ENTRY as before.


>      However again the P2M code
>      and the ABI it places are not for the faint of the heart.

I have no fear.

If the above suggestion does work out it will reduce the amount of p2m 
code /and/ remove a Xen-specific PTE bit.  So I think it is worth pursuing.

In the meantime, the following minimal patch is a likely workaround.

David

8<-------------------------------
x86/mm: set _PAGE_IOMAP in io_remap_pfn_range().

Signed-off-by: David Vrabel <david.vrabel@citrix.com>
---
  arch/x86/include/asm/pgtable.h |    3 +++
  1 file changed, 3 insertions(+)

diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 3d19994..d59b22a 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -868,6 +868,9 @@ static inline pte_t pte_swp_clear_soft_dirty(pte_t pte)
  	return pte_clear_flags(pte, _PAGE_SWP_SOFT_DIRTY);
  }

+#define io_remap_pfn_range(vma, addr, pfn, size, prot) \
+  remap_pfn_range(vma, addr, pfn, size, (prot) | _PAGE_IOMAP)
+
  #include <asm-generic/pgtable.h>
  #endif	/* __ASSEMBLY__ */

-- 
1.7.10.4


  parent reply	other threads:[~2013-10-25 22:59 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-10-25 15:03 [PATCH v1] Set 1-1 P2M for PCI BARs and MCFG regions - if needed Konrad Rzeszutek Wilk
2013-10-25 15:03 ` [v1 1/2] xen/p2m: Create identity mappings for PFNs beyound E820 and PCI BARs Konrad Rzeszutek Wilk
2013-10-25 16:38   ` Konrad Rzeszutek Wilk
2013-10-25 22:08   ` Bjorn Helgaas
2013-10-28  9:51     ` Jan Beulich
2013-10-28 16:58     ` Konrad Rzeszutek Wilk
2013-10-29  8:23       ` Jan Beulich
2013-10-29 14:45         ` Konrad Rzeszutek Wilk
2013-10-29 14:55           ` Jan Beulich
2013-10-29 15:11             ` Konrad Rzeszutek Wilk
2013-10-29 15:30               ` Jan Beulich
2013-10-29 15:59               ` [Xen-devel] " Gordan Bobic
2013-10-25 15:03 ` [v1 2/2] xen/mcfg: Call PHYSDEVOP_pci_mmcfg_reserved for MCFG areas and setup 1-1 P2M Konrad Rzeszutek Wilk
2013-10-25 22:58 ` David Vrabel [this message]
2013-10-25 23:39   ` [Xen-devel] [PATCH v1] Set 1-1 P2M for PCI BARs and MCFG regions - if needed Konrad Rzeszutek Wilk
2013-10-28 16:52   ` Konrad Rzeszutek Wilk

Reply instructions:

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

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

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

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

  git send-email \
    --in-reply-to=526AF79A.3050002@cantab.net \
    --to=dvrabel@cantab.net \
    --cc=JBeulich@suse.com \
    --cc=Santosh.Jodh@citrix.com \
    --cc=boris.ostrovsky@oracle.com \
    --cc=david.vrabel@citrix.com \
    --cc=konrad.wilk@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mukesh.rathor@oracle.com \
    --cc=xen-devel@lists.xensource.com \
    --cc=xhejtman@ics.muni.cz \
    --cc=yuval.shaia@oracle.com \
    /path/to/YOUR_REPLY

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

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