From: "David S. Miller" <davem@davemloft.net>
To: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: grundler@parisc-linux.org, linux-pci@atrey.karlin.mff.cuni.cz,
linux-kernel@vger.kernel.org, greg@kroah.com,
bjorn.helgaas@hp.com, davem@redhat.com
Subject: Re: pci-sysfs resource mmap broken (and PATCH)
Date: Wed, 27 Apr 2005 23:50:56 -0700 [thread overview]
Message-ID: <20050427235056.0bd09a94.davem@davemloft.net> (raw)
In-Reply-To: <1114670353.7182.246.camel@gaston>
On Thu, 28 Apr 2005 16:39:13 +1000
Benjamin Herrenschmidt <benh@kernel.crashing.org> wrote:
> On Wed, 2005-04-27 at 22:37 -0700, David S. Miller wrote:
> > On Wed, 27 Apr 2005 23:33:11 -0600
>
> > The 'offset' argument is defined to be page aligned
> > when passed to mmap().
>
> mmap API in general is defined to only ever deal with page aligned
> parameters & return values no ?
Yes.
> Except from that page alignment thing ... which is the root of the
> problem.
You can hide all of those problems in libpci.a or whatever.
You page align the offset, but pass back to the user a pointer
with his sub-page offset applied to it.
The kernel wants pages, so just give it pages :-)
> > I hate to say this, but the largest consumer of this stuff is the
> > X server, so we really need to force ourselves to work in parallel
> > on clean X server support.
>
> Cleaning X.org is my goal, this is why I'm trying to clean the kernel
> side first :) I'm also working separately on the problem of VGA access
> arbitration (We'll probably do a joint session with the desktop summit
> an the kernel summit about those issue).
Yeah, that one is all about enabling VGA forwarding in the bridges.
Taking out all of the resource garbage in the X server, and replacing
it with properly synchronized calls in the kernel for mapping ROMs
and changing the current VGA forwarding seems to be the way to go.
> > On many platforms some kind of "side effect" bit in the PTE
> > determine if store buffer compression can happen in the processor.
> > We'd want to not set such a bit for things like frame-buffers and
> > the like.
>
> Yes, and I think that pretty much match with PCI devices exposing a
> "prefetchable" BAR, don't you agree ?
Some scsi controllers have prefetchable set in their normal
register BARs. The sym53c8xx does if I remember correctly.
Anyways, what I'm trying to say is that blinding turning prefetchable
BAR into "don't set side effect bit in PTE" might not be so wise.
I really think it's a userlevel decision. That's where all the ioctl()
garbage came from for the /proc/bus/pci mmap() stuff. It was for chossing
IO vs MEM space, and also for setting these kinds of mapping attributes.
next prev parent reply other threads:[~2005-04-28 7:00 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-26 5:33 pci-sysfs resource mmap broken Benjamin Herrenschmidt
2005-04-26 6:09 ` Benjamin Herrenschmidt
2005-04-26 6:36 ` Greg KH
2005-04-26 9:24 ` Russell King
2005-04-26 16:30 ` Grant Grundler
2005-04-26 22:47 ` Benjamin Herrenschmidt
2005-04-27 3:55 ` Grant Grundler
2005-04-27 4:30 ` Benjamin Herrenschmidt
2005-04-27 4:28 ` David S. Miller
2005-04-27 4:39 ` Benjamin Herrenschmidt
2005-04-27 4:46 ` pci-sysfs resource mmap broken (and PATCH) Benjamin Herrenschmidt
2005-04-27 23:13 ` Benjamin Herrenschmidt
2005-04-28 5:33 ` Grant Grundler
2005-04-28 5:37 ` David S. Miller
2005-04-28 6:39 ` Benjamin Herrenschmidt
2005-04-28 6:50 ` David S. Miller [this message]
2005-04-28 7:21 ` Benjamin Herrenschmidt
2005-04-28 7:22 ` David S. Miller
2005-04-28 7:46 ` Benjamin Herrenschmidt
2005-04-28 15:11 ` Grant Grundler
2005-04-28 22:47 ` Benjamin Herrenschmidt
2005-04-28 23:38 ` Grant Grundler
2005-04-29 15:42 ` David S. Miller
2005-04-29 22:16 ` Jesse Barnes
2005-04-28 6:35 ` Benjamin Herrenschmidt
2005-05-03 5:37 ` pci-sysfs resource mmap broken PATCH#2 Benjamin Herrenschmidt
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=20050427235056.0bd09a94.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=benh@kernel.crashing.org \
--cc=bjorn.helgaas@hp.com \
--cc=davem@redhat.com \
--cc=greg@kroah.com \
--cc=grundler@parisc-linux.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@atrey.karlin.mff.cuni.cz \
/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