From: Dan Williams <dan.j.williams@intel.com>
To: "Krzysztof Wilczyński" <kw@linux.com>
Cc: "Christoph Hellwig" <hch@infradead.org>,
"Bjorn Helgaas" <bhelgaas@google.com>,
"Greg Kroah-Hartman" <gregkh@linuxfoundation.org>,
"Daniel Vetter" <daniel.vetter@ffwll.ch>,
"Kees Cook" <keescook@chromium.org>,
"Pali Rohár" <pali@kernel.org>,
"Oliver O'Halloran" <oohall@gmail.com>,
"Linux PCI" <linux-pci@vger.kernel.org>
Subject: Re: [PATCH 1/2] sysfs: Invoke iomem_get_mapping() from the sysfs open callback
Date: Mon, 28 Jun 2021 11:29:16 -0700 [thread overview]
Message-ID: <CAPcyv4i-0g5q3dN7SzFNQsGS5JtFOT3YM+M1b7m0WDdd8qK0nQ@mail.gmail.com> (raw)
In-Reply-To: <20210628180654.GA168658@rocinante>
On Mon, Jun 28, 2021 at 11:07 AM Krzysztof Wilczyński <kw@linux.com> wrote:
>
> Hi Dan,
>
> On 21-06-28 10:36:13, Dan Williams wrote:
> > On Mon, Jun 28, 2021 at 3:12 AM Christoph Hellwig <hch@infradead.org> wrote:
> > >
> > > On Fri, Jun 25, 2021 at 11:31:17PM +0000, Krzysztof Wilczy??ski wrote:
> > > > if (battr->mapping)
> > > > - of->file->f_mapping = battr->mapping;
> > > > + of->file->f_mapping = battr->mapping();
> > >
> > > I think get_mapping() is a better name now. That being said this
> > > whole programming model looks a little weird.
> >
> > I think both those points are fair.
>
> Anything for us to do?
>
> > > Also, does this patch imply the mapping field of the sysfs bin
> > > attributes wasn't used before at all?
> >
> > It defaulted to an address_space per file rather than a shared address
> > space across all files that map physical addresses as file offsets.
>
> I will include this in the commit message for v3 of the patch series, if
> you don't mind. Also, would this shared address space be a potential
> issue? Security, functional, etc.
The shared address_space arrangement is what allows for a "revoke"
mechanism for /dev/mem and pci-resource-sysfs mappings. Without a
shared address space there would need to be tracking for each 'inode'
instance to run revoke_iomem(). Note that this shared address_space
scheme is also deployed for block-device special files, see
blkdev_open(). It's done for similar reasons of allowing all
address_space operations to act on a common representation of the
single block-device.
next prev parent reply other threads:[~2021-06-28 18:29 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-06-25 23:31 [PATCH 0/2] Allow deferred execution of iomem_get_mapping() Krzysztof Wilczyński
2021-06-25 23:31 ` [PATCH 1/2] sysfs: Invoke iomem_get_mapping() from the sysfs open callback Krzysztof Wilczyński
2021-06-25 23:53 ` Dan Williams
2021-06-28 10:09 ` Christoph Hellwig
2021-06-28 10:41 ` Krzysztof Wilczy??ski
2021-06-28 17:36 ` Dan Williams
2021-06-28 18:06 ` Krzysztof Wilczyński
2021-06-28 18:29 ` Dan Williams [this message]
2021-06-25 23:31 ` [PATCH 2/2] PCI/sysfs: Pass iomem_get_mapping() as a function pointer Krzysztof Wilczyński
2021-06-25 23:56 ` Dan Williams
2021-06-26 13:07 ` Krzysztof Wilczyński
2021-06-28 10:15 ` Christoph Hellwig
2021-06-28 10:24 ` Krzysztof Wilczy??ski
2021-06-28 11:09 ` Greg Kroah-Hartman
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=CAPcyv4i-0g5q3dN7SzFNQsGS5JtFOT3YM+M1b7m0WDdd8qK0nQ@mail.gmail.com \
--to=dan.j.williams@intel.com \
--cc=bhelgaas@google.com \
--cc=daniel.vetter@ffwll.ch \
--cc=gregkh@linuxfoundation.org \
--cc=hch@infradead.org \
--cc=keescook@chromium.org \
--cc=kw@linux.com \
--cc=linux-pci@vger.kernel.org \
--cc=oohall@gmail.com \
--cc=pali@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 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).