From: Alex Williamson <alex.williamson@redhat.com>
To: Srinath Mannam <srinath.mannam@broadcom.com>
Cc: Ray Jui <ray.jui@broadcom.com>,
Vikram Prakash <vikram.prakash@broadcom.com>,
Scott Branden <scott.branden@broadcom.com>,
kvm@vger.kernel.org,
BCM Kernel Feedback <bcm-kernel-feedback-list@broadcom.com>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>,
aik@ozlabs.ru, David Gibson <david@gibson.dropbear.id.au>,
benh@kernel.crashing.org
Subject: Re: [RFC PATCH] vfio/pci: map prefetchble bars as writecombine
Date: Wed, 1 Aug 2018 13:38:54 -0600 [thread overview]
Message-ID: <20180801133854.62b872f9@t450s.home> (raw)
In-Reply-To: <CABe79T7-+qL3siCDc6SeEqEaj3TJQ6O_sVTZzm+wXoYJQWyvbA@mail.gmail.com>
On Wed, 1 Aug 2018 23:28:53 +0530
Srinath Mannam <srinath.mannam@broadcom.com> wrote:
> Hi Alex,
>
> In user space UIO driver (DPDK) implementation, sysfs interface
> "/sys/devices/pci/.../resource0_wc" is used to map prefetchable PCI
> resources as WC.
> Platforms which support write-combining maps of PCI resources have
> arch_can_pci_mmap_wc() flag enabled. So that it allows to map resources as WC.
> In this approach mmap calls "pci_mmap_resource_range" kernel function
> with write_combine parameter set.
> "drivers/pci/pci-sysfs.c" kernel file has this implementation.
>
> If this approach fits to vfio driver, then code change in vfio driver are
>
> if (arch_can_pci_mmap_wc() &&
> (pci_resource_flags(pdev, index) & IORESOURCE_PREFETCH))
> vma->vm_page_prot = pgprot_writecombine(vma->vm_page_prot);
> else
> vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
>
> Please provide your feedback.
Let me see if I've got this straight, UIO (in reality pci-sysfs)
provides a separate interface such that a driver can *choose* to get
either a UC or, at their discretion, a WC mapping to a region, and
you're using that as justification that vfio-pci should arbitrarily
convert all existing users from UC mappings to WC mappings, without
their consent, any time the architecture supports WC mappings. The fact
that pci-sysfs provides separate interfaces such that drives can choose
their preferred mapping attributes only reaffirms to me that this needs
to be a driver decision. How would we ever validate that a change like
you're proposing above would not introduce regressions for existing
users? Thanks,
Alex
prev parent reply other threads:[~2018-08-01 19:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-13 4:56 [RFC PATCH] vfio/pci: map prefetchble bars as writecombine Srinath Mannam
2018-07-17 15:22 ` Alex Williamson
2018-07-18 18:35 ` Srinath Mannam
2018-07-18 21:25 ` Alex Williamson
2018-07-19 14:47 ` Srinath Mannam
2018-07-19 15:12 ` Alex Williamson
2018-07-19 16:19 ` Srinath Mannam
2018-07-20 20:27 ` Alex Williamson
2018-07-23 8:33 ` Srinath Mannam
2018-08-01 17:58 ` Srinath Mannam
2018-08-01 19:38 ` Alex Williamson [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=20180801133854.62b872f9@t450s.home \
--to=alex.williamson@redhat.com \
--cc=aik@ozlabs.ru \
--cc=bcm-kernel-feedback-list@broadcom.com \
--cc=benh@kernel.crashing.org \
--cc=david@gibson.dropbear.id.au \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=ray.jui@broadcom.com \
--cc=scott.branden@broadcom.com \
--cc=srinath.mannam@broadcom.com \
--cc=vikram.prakash@broadcom.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;
as well as URLs for NNTP newsgroup(s).