linux-pci.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
To: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Cc: Arnd Bergmann <arnd@arndb.de>,
	Bjorn Helgaas <bhelgaas@google.com>,
	Benjamin Herrenschmidt <benh@kernel.crashing.org>,
	Russell King <linux@arm.linux.org.uk>,
	"David S. Miller" <davem@davemloft.net>,
	Michal Simek <monstr@monstr.eu>,
	Martin Wilck <martin.wilck@ts.fujitsu.com>,
	Linux PCI <linux-pci@vger.kernel.org>
Subject: Re: [PATCH RFC v2 0/2] Fix procfs PCI resources mmap
Date: Tue, 4 Nov 2014 14:15:20 +0000	[thread overview]
Message-ID: <20141104141520.GA8802@e102568-lin.cambridge.arm.com> (raw)
In-Reply-To: <1414168089-8130-1-git-send-email-lorenzo.pieralisi@arm.com>

On Fri, Oct 24, 2014 at 05:28:04PM +0100, Lorenzo Pieralisi wrote:
> The way PCI memory resources are exported to user space through procfs
> is not uniform across architectures. In particular, some architectures
> (ie SPARC) export the resource PCI bus address to user space, whereas
> others (ARM, PowerPC, Microblaze) export the resource CPU physical address.
> This convention should be followed when it comes to passing the pgoff
> values to the mmap syscall to map the resource in question.
> 
> Consequently, the checks applied to the offset passed to the mmap syscall
> (in pci_mmap_fits()) are to be interpreted differently on different
> architectures, and in particular they should match the values exported to
> user space through the pci_resource_to_user() conversion function.
> 
> This patch series addresses two issues. First patch applies the
> pci_resource_to_user() filter to the PCI resource that is being
> mapped in order to carry out a proper check against the pgoff passed
> from user space. Second patch fixes the way the pgoff is handled in
> the ARM pci_mmap_page_range() implementation.

I appreciate it is hardly number one priority and by no means urgent,
but I would like to get some comments if possible on patch 1 since patch
2, that is a fix for ARM, relies on the approach we go for in order to
fix the pci_mmap_fits() behaviour (patch 1).

Comments welcome.

Thanks,
Lorenzo

> 
> v1 posting:
> 
> http://marc.info/?l=linux-kernel&m=141337461318554&w=2
> 
> v1 => v2
> - Reworded commit log as per RMK comments
> 
> Lorenzo Pieralisi (2):
>   drivers: pci: fix pci_mmap_fits() implementation for procfs mmap
>   arm: kernel: fix pci_mmap_page_range() offset calculation
> 
>  arch/arm/kernel/bios32.c | 10 ++--------
>  drivers/pci/pci-sysfs.c  | 13 ++++++++-----
>  2 files changed, 10 insertions(+), 13 deletions(-)
> 
> -- 
> 2.1.2
> 
> 


      parent reply	other threads:[~2014-11-04 14:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-10-24 16:28 [PATCH RFC v2 0/2] Fix procfs PCI resources mmap Lorenzo Pieralisi
2014-10-24 16:28 ` [PATCH RFC v2 1/2] drivers: pci: fix pci_mmap_fits() implementation for procfs mmap Lorenzo Pieralisi
2014-11-10 23:04   ` Bjorn Helgaas
2014-11-11 11:48     ` Lorenzo Pieralisi
2014-11-11 14:20       ` Bjorn Helgaas
2014-11-11 15:57         ` Lorenzo Pieralisi
2014-11-11 17:19           ` Bjorn Helgaas
2014-11-13 11:32             ` Lorenzo Pieralisi
2014-11-12  7:23     ` Benjamin Herrenschmidt
2014-11-12 10:27       ` Lorenzo Pieralisi
2014-10-24 16:28 ` [PATCH RFC v2 2/2] arm: kernel: fix pci_mmap_page_range() offset calculation Lorenzo Pieralisi
2014-11-04 14:15 ` Lorenzo Pieralisi [this message]

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=20141104141520.GA8802@e102568-lin.cambridge.arm.com \
    --to=lorenzo.pieralisi@arm.com \
    --cc=arnd@arndb.de \
    --cc=benh@kernel.crashing.org \
    --cc=bhelgaas@google.com \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-pci@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=martin.wilck@ts.fujitsu.com \
    --cc=monstr@monstr.eu \
    /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;
as well as URLs for NNTP newsgroup(s).