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]
Date:   Wed, 10 Oct 2018 09:58:03 +0200
From:   Arnd Bergmann <arnd@...db.de>
To:     Sunil Kovvuri <sunil.kovvuri@...il.com>
Cc:     Networking <netdev@...r.kernel.org>,
        David Miller <davem@...emloft.net>, linux-soc@...r.kernel.org,
        gakula@...vell.com, sgoutham@...vell.com
Subject: Re: [PATCH v8 10/15] octeontx2-af: Reconfig MSIX base with IOVA

On Wed, Oct 10, 2018 at 9:36 AM Sunil Kovvuri <sunil.kovvuri@...il.com> wrote:
> On Tue, Oct 9, 2018 at 5:30 PM Arnd Bergmann <arnd@...db.de> wrote:
> > On Tue, Oct 9, 2018 at 11:20 AM Sunil Kovvuri <sunil.kovvuri@...il.com> wrote:
> > > On Tue, Oct 9, 2018 at 1:27 PM Arnd Bergmann <arnd@...db.de> wrote:
> > > > On Tue, Oct 9, 2018 at 9:03 AM Sunil Kovvuri <sunil.kovvuri@...il.com> wrote:
> > > > > On Mon, Oct 8, 2018 at 5:38 PM Arnd Bergmann <arnd@...db.de> wrote:
> > > > > > On Sun, Oct 7, 2018 at 5:01 PM <sunil.kovvuri@...il.com> wrote:
> > > > I think if you enable CONFIG_DEBUG_VIRTUAL, the virt_to_page()
> > > > above should trigger a warning in
> > > >
> > > > phys_addr_t __virt_to_phys(unsigned long x)
> > > > {
> > > >         WARN(!__is_lm_address(x),
> > > >              "virt_to_phys used for non-linear address: %pK (%pS)\n",
> > > >               (void *)x,
> > > >               (void *)x);
> > > >
> > > >         return __virt_to_phys_nodebug(x);
> > > > }
> > > >
> > > > Can you verify that?
> > >
> > > No, it isn't, as for 64bit systems CONFIG_SPARSEMEM_VMEMMAP is enabled.
> >
> > But that is also user-selectable, right? It still seems to be really
> > fragile to rely on non-documented behavior of virt_to_phys()
> > here, if that only works for some configurations.
> >
> > > But is there any alternative to what is being done ?
> >
> > I'm not completely sure, but there may be a way to do this correctly
> > using the iommu API instead of the dma-mapping API. What you do
> > here is fairly rare, but not unprecedented.
>
> After further checking the only way i found is using dma_map_resource() which
> accepts physical address and creates a mapping. Will test and submit next series
> with the changes.

Ah, perfect. I remember having seen this in the past, but forgot about
it when commenting here. This should be the correct way to do it. If
it doesn't work, we need to fix the implementation.

       Arnd

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ