From: ebiederm@xmission.com (Eric W. Biederman)
To: Roland Dreier <rdreier@cisco.com>
Cc: linux-kernel@vger.kernel.org, Andi Kleen <ak@suse.de>
Subject: Re: mapping PCI registers with write combining (and PAT on x86)...
Date: Tue, 12 Dec 2006 15:47:43 -0700 [thread overview]
Message-ID: <m1irggrasw.fsf@ebiederm.dsl.xmission.com> (raw)
In-Reply-To: <adalklcu5w3.fsf@cisco.com> (Roland Dreier's message of "Tue, 12 Dec 2006 14:05:32 -0800")
Roland Dreier <rdreier@cisco.com> writes:
> Suppose that I would like to map some PIO registers (in a PCI BAR) to
> userspace, and I would like to enable write combining if possible.
>
> I have two problems. First, there's no generic interface for
> requesting write combining if possible when doing
> io_remap_pfn_range(). Would it make sense to define
> pageprot_writecombine for all architectures (and make it fall back to
> doing non-cached access if write combining is not possible)? And it
> seems that making pgprot_noncached() universal wouldn't hurt either.
So I think we may simplify this but there is pci_mmap_page_range. That
already handles this for the architectures that currently support it.
So it is probably the case the fbdev should be changed to use that.
I am certainly in favor of simpler infrastructure like making
pgprot_writecombine and pgprot_uncached universal but I would like to
start with what works today.
Then we can go reexamine things like the ia64 slavishly trusting the
BIOS to know which page protections are good.
> Second, given the extreme shortage of MTRRs, it seems that write
> combining is not really possible in general on x86 without some
> interface to use PATs instead. What is holding up something like Eric
> Biederman's patches from going in?
No one had any serious objections to my patches as they were. The actual
problem was that the patches were incomplete. In particular if you
mismatch page protections it is possible to get silent data corruption
or processor crashes. So we need checks to ensure all mappings of
a given page are using the same protections.
To a certain extent I think adding those checks really is a strawman
and should not stop the merge effort, because we have this feature and
those possible bugs on other architectures right now and we don't have
those checks. But I also think in the long term we need them, it just
requires several days of going through the mm so we don't leave any
path uncovered.
> Right now we end up with stuff like the absolutely hair-raising code
> in drivers/video/fbmem.c shown below. I really would like to make
> progress towards having a better interface for doing this stuff, and
> I'm more than willing to work on getting something mergable.
I hope my comments help.
Eric
next prev parent reply other threads:[~2006-12-12 22:47 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-12-12 22:05 mapping PCI registers with write combining (and PAT on x86) Roland Dreier
2006-12-12 22:47 ` Eric W. Biederman [this message]
2006-12-13 0:01 ` Roland Dreier
2006-12-13 0:22 ` Eric W. Biederman
2006-12-13 2:18 ` Kyle McMartin
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=m1irggrasw.fsf@ebiederm.dsl.xmission.com \
--to=ebiederm@xmission.com \
--cc=ak@suse.de \
--cc=linux-kernel@vger.kernel.org \
--cc=rdreier@cisco.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