lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20180801133854.62b872f9@t450s.home>
Date:   Wed, 1 Aug 2018 13:38:54 -0600
From:   Alex Williamson <alex.williamson@...hat.com>
To:     Srinath Mannam <srinath.mannam@...adcom.com>
Cc:     Ray Jui <ray.jui@...adcom.com>,
        Vikram Prakash <vikram.prakash@...adcom.com>,
        Scott Branden <scott.branden@...adcom.com>,
        kvm@...r.kernel.org,
        BCM Kernel Feedback <bcm-kernel-feedback-list@...adcom.com>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        aik@...abs.ru, David Gibson <david@...son.dropbear.id.au>,
        benh@...nel.crashing.org
Subject: Re: [RFC PATCH] vfio/pci: map prefetchble bars as writecombine

On Wed, 1 Aug 2018 23:28:53 +0530
Srinath Mannam <srinath.mannam@...adcom.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ