From: "Luis R. Rodriguez" <mcgrof@kernel.org>
To: bp@alien8.de, mingo@kernel.org, tglx@linutronix.de, hpa@zytor.com
Cc: toshi.kani@hp.com, paulmck@linux.vnet.ibm.com,
airlied@redhat.com, benh@kernel.crashing.org, mst@redhat.com,
vinod.koul@intel.com, jgross@suse.com, daniel.vetter@ffwll.ch,
luto@amacapital.net, linux-fbdev@vger.kernel.org,
linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
x86@kernel.org, linux-doc@vger.kernel.org, corbet@lwn.net,
"Luis R. Rodriguez" <mcgrof@kernel.org>
Subject: [PATCH] x86: PAT: Documentation: update overlapping ioremap hack recommendation
Date: Thu, 3 Mar 2016 13:21:48 -0800 [thread overview]
Message-ID: <1457040108-27358-1-git-send-email-mcgrof@kernel.org> (raw)
The current documentation refers to using set_memor_wc() as a
possible hole strategy when you have overlapping ioremap() regions,
that's incorrect as set_memory_*() helpers can only be used on RAM,
not IO memory. This fixes that, and updates the documention to
*strongly* discourage overlapping ioremap() memory uses, but also
documents a possible solution should there really be no other
option.
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
---
Documentation/x86/pat.txt | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/Documentation/x86/pat.txt b/Documentation/x86/pat.txt
index 54944c71b819..8a26b4cdccf6 100644
--- a/Documentation/x86/pat.txt
+++ b/Documentation/x86/pat.txt
@@ -113,18 +113,21 @@ MTRR effects on PAT / non-PAT systems
-------------------------------------
The following table provides the effects of using write-combining MTRRs when
-using ioremap*() calls on x86 for both non-PAT and PAT systems. Ideally
-mtrr_add() usage will be phased out in favor of arch_phys_wc_add() which will
-be a no-op on PAT enabled systems. The region over which a arch_phys_wc_add()
+using ioremap*() calls on x86 for both non-PAT and PAT systems. As of v4.3
+mtrr_add() has been phased out in favor of arch_phys_wc_add(), these calls are
+a no-op on PAT enabled systems. The region over which an arch_phys_wc_add()
is made, should already have been ioremapped with WC attributes or PAT entries,
-this can be done by using ioremap_wc() / set_memory_wc(). Devices which
-combine areas of IO memory desired to remain uncacheable with areas where
-write-combining is desirable should consider use of ioremap_uc() followed by
-set_memory_wc() to white-list effective write-combined areas. Such use is
-nevertheless discouraged as the effective memory type is considered
-implementation defined, yet this strategy can be used as last resort on devices
-with size-constrained regions where otherwise MTRR write-combining would
-otherwise not be effective.
+this can be done by using ioremap_wc(). Devices which combine areas of IO
+memory desired to remain uncacheable with areas where write-combining is
+desirable should consider use of ioremap_wc() followed by an overlapping
+ioremap_uc() "hole". For an example of this strategy refer to commit 3cc2dac5be
+("drivers/video/fbdev/atyfb: Replace MTRR UC hole with strong UC").
+Such use is nevertheless heavily discouraged as the effective memory type is
+considered implementation defined. This strategy should only be used used as a
+last resort measure.
+
+Note you cannot use set_memory_*() helpers on ioremap'd regions, even though
+its use currently gives no hint of an error.
----------------------------------------------------------------------
MTRR Non-PAT PAT Linux ioremap value Effective memory type
--
2.7.2
WARNING: multiple messages have this Message-ID (diff)
From: "Luis R. Rodriguez" <mcgrof@kernel.org>
To: bp@alien8.de, mingo@kernel.org, tglx@linutronix.de, hpa@zytor.com
Cc: toshi.kani@hp.com, paulmck@linux.vnet.ibm.com,
airlied@redhat.com, benh@kernel.crashing.org, mst@redhat.com,
vinod.koul@intel.com, jgross@suse.com, daniel.vetter@ffwll.ch,
luto@amacapital.net, linux-fbdev@vger.kernel.org,
linux-arch@vger.kernel.org, linux-kernel@vger.kernel.org,
x86@kernel.org, linux-doc@vger.kernel.org, corbet@lwn.net,
"Luis R. Rodriguez" <mcgrof@kernel.org>
Subject: [PATCH] x86: PAT: Documentation: update overlapping ioremap hack recommendation
Date: Thu, 03 Mar 2016 21:21:48 +0000 [thread overview]
Message-ID: <1457040108-27358-1-git-send-email-mcgrof@kernel.org> (raw)
The current documentation refers to using set_memor_wc() as a
possible hole strategy when you have overlapping ioremap() regions,
that's incorrect as set_memory_*() helpers can only be used on RAM,
not IO memory. This fixes that, and updates the documention to
*strongly* discourage overlapping ioremap() memory uses, but also
documents a possible solution should there really be no other
option.
Signed-off-by: Luis R. Rodriguez <mcgrof@kernel.org>
---
Documentation/x86/pat.txt | 25 ++++++++++++++-----------
1 file changed, 14 insertions(+), 11 deletions(-)
diff --git a/Documentation/x86/pat.txt b/Documentation/x86/pat.txt
index 54944c71b819..8a26b4cdccf6 100644
--- a/Documentation/x86/pat.txt
+++ b/Documentation/x86/pat.txt
@@ -113,18 +113,21 @@ MTRR effects on PAT / non-PAT systems
-------------------------------------
The following table provides the effects of using write-combining MTRRs when
-using ioremap*() calls on x86 for both non-PAT and PAT systems. Ideally
-mtrr_add() usage will be phased out in favor of arch_phys_wc_add() which will
-be a no-op on PAT enabled systems. The region over which a arch_phys_wc_add()
+using ioremap*() calls on x86 for both non-PAT and PAT systems. As of v4.3
+mtrr_add() has been phased out in favor of arch_phys_wc_add(), these calls are
+a no-op on PAT enabled systems. The region over which an arch_phys_wc_add()
is made, should already have been ioremapped with WC attributes or PAT entries,
-this can be done by using ioremap_wc() / set_memory_wc(). Devices which
-combine areas of IO memory desired to remain uncacheable with areas where
-write-combining is desirable should consider use of ioremap_uc() followed by
-set_memory_wc() to white-list effective write-combined areas. Such use is
-nevertheless discouraged as the effective memory type is considered
-implementation defined, yet this strategy can be used as last resort on devices
-with size-constrained regions where otherwise MTRR write-combining would
-otherwise not be effective.
+this can be done by using ioremap_wc(). Devices which combine areas of IO
+memory desired to remain uncacheable with areas where write-combining is
+desirable should consider use of ioremap_wc() followed by an overlapping
+ioremap_uc() "hole". For an example of this strategy refer to commit 3cc2dac5be
+("drivers/video/fbdev/atyfb: Replace MTRR UC hole with strong UC").
+Such use is nevertheless heavily discouraged as the effective memory type is
+considered implementation defined. This strategy should only be used used as a
+last resort measure.
+
+Note you cannot use set_memory_*() helpers on ioremap'd regions, even though
+its use currently gives no hint of an error.
----------------------------------------------------------------------
MTRR Non-PAT PAT Linux ioremap value Effective memory type
--
2.7.2
next reply other threads:[~2016-03-03 21:21 UTC|newest]
Thread overview: 23+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-03-03 21:21 Luis R. Rodriguez [this message]
2016-03-03 21:21 ` [PATCH] x86: PAT: Documentation: update overlapping ioremap hack recommendation Luis R. Rodriguez
2016-03-03 21:42 ` Paul E. McKenney
2016-03-03 21:42 ` Paul E. McKenney
2016-03-04 19:23 ` Luis R. Rodriguez
2016-03-04 19:23 ` Luis R. Rodriguez
2016-03-04 21:09 ` Paul E. McKenney
2016-03-04 21:09 ` Paul E. McKenney
2016-03-04 22:45 ` [PATCH v2] x86: PAT: Documentation: rewrite "MTRR effects on PAT / non-PAT systems" Luis R. Rodriguez
2016-03-04 22:45 ` Luis R. Rodriguez
2016-03-05 0:03 ` Paul E. McKenney
2016-03-05 0:03 ` Paul E. McKenney
2016-03-05 1:03 ` Luis R. Rodriguez
2016-03-05 1:03 ` Luis R. Rodriguez
2016-03-05 4:39 ` Elliott, Robert (Persistent Memory)
2016-03-05 4:39 ` Elliott, Robert (Persistent Memory)
2016-03-15 22:21 ` Luis R. Rodriguez
2016-03-15 22:21 ` Luis R. Rodriguez
2016-03-15 22:21 ` Luis R. Rodriguez
2016-03-05 11:52 ` Ingo Molnar
2016-03-05 11:52 ` Ingo Molnar
2016-03-15 22:24 ` Luis R. Rodriguez
2016-03-15 22:24 ` Luis R. Rodriguez
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=1457040108-27358-1-git-send-email-mcgrof@kernel.org \
--to=mcgrof@kernel.org \
--cc=airlied@redhat.com \
--cc=benh@kernel.crashing.org \
--cc=bp@alien8.de \
--cc=corbet@lwn.net \
--cc=daniel.vetter@ffwll.ch \
--cc=hpa@zytor.com \
--cc=jgross@suse.com \
--cc=linux-arch@vger.kernel.org \
--cc=linux-doc@vger.kernel.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=luto@amacapital.net \
--cc=mingo@kernel.org \
--cc=mst@redhat.com \
--cc=paulmck@linux.vnet.ibm.com \
--cc=tglx@linutronix.de \
--cc=toshi.kani@hp.com \
--cc=vinod.koul@intel.com \
--cc=x86@kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.