xen-devel.lists.xenproject.org archive mirror
 help / color / mirror / Atom feed
* [PATCHv5 0/8] x86/xen: fixes for mapping high MMIO regions (and remove _PAGE_IOMAP)
@ 2014-02-24 17:39 David Vrabel
  2014-02-24 17:39 ` [PATCH 1/8] x86/xen: rename early_p2m_alloc() and early_p2m_alloc_middle() David Vrabel
                   ` (7 more replies)
  0 siblings, 8 replies; 11+ messages in thread
From: David Vrabel @ 2014-02-24 17:39 UTC (permalink / raw)
  To: xen-devel
  Cc: x86, Ingo Molnar, David Vrabel, H. Peter Anvin, Boris Ostrovsky,
	Thomas Gleixner

[ x86 maintainers, this is predominately a Xen series but the end
result is the _PAGE_IOMAP PTE flag is removed. See patch #8. ]

This a fix for the problems with mapping high MMIO regions in certain
cases (e.g., the RDMA drivers) as not all mappers were specifing
_PAGE_IOMAP which meant no valid MFN could be found and the resulting
PTEs would be set as not present, causing subsequent faults.

It assumes that anything that isn't RAM (whether ballooned out or not)
is an I/O region and thus should be 1:1 in the p2m.  Specifically, the
region after the end of the E820 map and the region beyond the end of
the p2m.  Ballooned frames are still marked as missing in the p2m as
before.

As a follow on, pte_mfn_to_pfn() and pte_pfn_to_mfn() are modified to
not use the _PAGE_IOMAP PTE flag and MFN to PFN and PFN to MFN
translations will now do the right thing for all I/O regions.  This
means the Xen-specific _PAGE_IOMAP can be removed,

This series has been tested (in dom0) on all unique machines we have
in out test lab (~100 machines), some of which have PCI devices with
BARs above the end of RAM.

Note this does not fix a 32-bit dom0 trying to access BARs above 16 TB
as this is a caused by MFNs/PFNs being limited to 32-bits (unsigned
long).

You may find it useful to apply patch #3 to more easily review the
updated p2m diagram.

Changes in v5:
- improve performance of set_phys_range_identity() by not iterating
  over all pages if p2m_mid_identity or p2m_identity mid or leaves are
  already present. (Thanks to Andrew Cooper for reporting this and
  Frediano Ziglio for providing a fix.)

Changes in v4:
- fix p2m_mid_identity initialization.

Changes in v3 (not posted):
- use correct end of e820
- fix xen_remap_domain_mfn_range()

Changes in v2:
- fix to actually set end-of-RAM to 512 GiB region as 1:1.
- introduce p2m_mid_identity to efficiently store large 1:1 regions.
- Split the _PAGE_IOMAP patch into Xen and generic x86 halves.

David

^ permalink raw reply	[flat|nested] 11+ messages in thread
* [PATCHv4 0/8] x86/xen: fixes for mapping high MMIO regions (and remove _PAGE_IOMAP)
@ 2014-02-03 17:01 David Vrabel
  2014-02-03 17:01 ` [PATCH 8/8] x86: remove the Xen-specific _PAGE_IOMAP PTE flag David Vrabel
  0 siblings, 1 reply; 11+ messages in thread
From: David Vrabel @ 2014-02-03 17:01 UTC (permalink / raw)
  To: xen-devel
  Cc: x86, Ingo Molnar, David Vrabel, H. Peter Anvin, Boris Ostrovsky,
	Thomas Gleixner

[ x86 maintainers, this is predominately a Xen series but the end
result is the _PAGE_IOMAP PTE flag is removed. See patch #8. ]

This a fix for the problems with mapping high MMIO regions in certain
cases (e.g., the RDMA drivers) as not all mappers were specifing
_PAGE_IOMAP which meant no valid MFN could be found and the resulting
PTEs would be set as not present, causing subsequent faults.

It assumes that anything that isn't RAM (whether ballooned out or not)
is an I/O region and thus should be 1:1 in the p2m.  Specifically, the
region after the end of the E820 map and the region beyond the end of
the p2m.  Ballooned frames are still marked as missing in the p2m as
before.

As a follow on, pte_mfn_to_pfn() and pte_pfn_to_mfn() are modified to
not use the _PAGE_IOMAP PTE flag and MFN to PFN and PFN to MFN
translations will now do the right thing for all I/O regions.  This
means the Xen-specific _PAGE_IOMAP can be removed,

This series has been tested (in dom0) on all unique machines we have
in out test lab (~100 machines), some of which have PCI devices with
BARs above the end of RAM.

Note this does not fix a 32-bit dom0 trying to access BARs above 16 TB
as this is a caused by MFNs/PFNs being limited to 32-bits (unsigned
long).

You may find it useful to apply patch #3 to more easily review the
updated p2m diagram.

Changes in v4:
- fix p2m_mid_identity initialization.

Changes in v3 (not posted):
- use correct end of e820
- fix xen_remap_domain_mfn_range()

Changes in v2:
- fix to actually set end-of-RAM to 512 GiB region as 1:1.
- introduce p2m_mid_identity to efficiently store large 1:1 regions.
- Split the _PAGE_IOMAP patch into Xen and generic x86 halves.

David

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2014-02-24 17:51 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-02-24 17:39 [PATCHv5 0/8] x86/xen: fixes for mapping high MMIO regions (and remove _PAGE_IOMAP) David Vrabel
2014-02-24 17:39 ` [PATCH 1/8] x86/xen: rename early_p2m_alloc() and early_p2m_alloc_middle() David Vrabel
2014-02-24 17:39 ` [PATCH 2/8] x86/xen: fix set_phys_range_identity() if pfn_e > MAX_P2M_PFN David Vrabel
2014-02-24 17:39 ` [PATCH 3/8] x86/xen: compactly store large identity ranges in the p2m David Vrabel
2014-02-24 17:39 ` [PATCH 4/8] x86/xen: only warn once if bad MFNs are found during setup David Vrabel
2014-02-24 17:39 ` [PATCH 5/8] x86/xen: set regions above the end of RAM as 1:1 David Vrabel
2014-02-24 17:39 ` [PATCH 6/8] x86/xen: do not use _PAGE_IOMAP in xen_remap_domain_mfn_range() David Vrabel
2014-02-24 17:39 ` [PATCH 7/8] x86/xen: do not use _PAGE_IOMAP PTE flag for I/O mappings David Vrabel
2014-02-24 17:39 ` [PATCH 8/8] x86: remove the Xen-specific _PAGE_IOMAP PTE flag David Vrabel
2014-02-24 17:51   ` H. Peter Anvin
  -- strict thread matches above, loose matches on Subject: below --
2014-02-03 17:01 [PATCHv4 0/8] x86/xen: fixes for mapping high MMIO regions (and remove _PAGE_IOMAP) David Vrabel
2014-02-03 17:01 ` [PATCH 8/8] x86: remove the Xen-specific _PAGE_IOMAP PTE flag David Vrabel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).