Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1498182

Re: igb driver can cause cache invalidation of non-owned memory?

From David Miller <davem@davemloft.net>
Newsgroups linux.kernel
Subject Re: igb driver can cause cache invalidation of non-owned memory?
Date 2016-10-10 11:10 +0200
Message-ID <sqEKR-7N2-7@gated-at.bofh.it> (permalink)
References <sqEBc-7uz-11@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: Nikita Yushchenko <nikita.yoush@cogentembedded.com>
Date: Mon, 10 Oct 2016 11:52:06 +0300

> With this scheme, page used for Rx is completely dma_map()ed at
> allocation time, split into two buffers, and individual buffer is
> sync_to_cpu()ed AND PASSED TO NETWORK STACK via skb_add_rx_frag() -
> while driver driver still uses other buffer. Later, when driver decides
> to no longer use this page, it will dma_unmap() it completely - which on
> archs with non-coherent caches means cache invalidation. This cache
> invalidation will include area that is already passed elsewhere.

This should happen only if the device wrote into that piece of the
memory which it absolutely should not.

When the dma sync occurs, no dirty data should be in the caches for
the portion of the page any more, and therefore nothing should be
written back unless the device illegally wrote to that part of the
page again.

If something is causing data to be written back even if the device
doesn't write into that area again, it's a bug.

And FWIW the swiommu code has this bug.  It should never (re-)copy
back into the mapped area after a sync unless the device wrote into
that area in the time between the sync and the unmap.

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

igb driver can cause cache invalidation of non-owned memory? Nikita Yushchenko <nikita.yoush@cogentembedded.com> - 2016-10-10 11:00 +0200
  Re: igb driver can cause cache invalidation of non-owned memory? David Miller <davem@davemloft.net> - 2016-10-10 11:10 +0200
    Re: igb driver can cause cache invalidation of non-owned memory? Nikita Yushchenko <nikita.yoush@cogentembedded.com> - 2016-10-10 12:00 +0200
      Re: igb driver can cause cache invalidation of non-owned memory? David Miller <davem@davemloft.net> - 2016-10-10 14:00 +0200
        Re: igb driver can cause cache invalidation of non-owned memory? Nikita Yushchenko <nikita.yoush@cogentembedded.com> - 2016-10-10 14:30 +0200
          Re: igb driver can cause cache invalidation of non-owned memory? Nikita Yushchenko <nikita.yoush@cogentembedded.com> - 2016-10-10 14:40 +0200
          Re: igb driver can cause cache invalidation of non-owned memory? Alexander Duyck <alexander.duyck@gmail.com> - 2016-10-10 17:20 +0200
            Re: igb driver can cause cache invalidation of non-owned memory? Nikita Yushchenko <nikita.yoush@cogentembedded.com> - 2016-10-10 19:10 +0200
              Re: igb driver can cause cache invalidation of non-owned memory? Alexander Duyck <alexander.duyck@gmail.com> - 2016-10-10 19:50 +0200
                Re: igb driver can cause cache invalidation of non-owned memory? Nikita Yushchenko <nikita.yoush@cogentembedded.com> - 2016-10-12 09:00 +0200
                Re: igb driver can cause cache invalidation of non-owned memory? Alexander Duyck <alexander.duyck@gmail.com> - 2016-10-12 17:40 +0200
                RE: igb driver can cause cache invalidation of non-owned memory? David Laight <David.Laight@ACULAB.COM> - 2016-10-12 18:10 +0200
                Re: igb driver can cause cache invalidation of non-owned memory? Nikita Yushchenko <nikita.yoush@cogentembedded.com> - 2016-10-12 18:40 +0200
                Re: igb driver can cause cache invalidation of non-owned memory? Alexander Duyck <alexander.duyck@gmail.com> - 2016-10-12 20:10 +0200
                Re: igb driver can cause cache invalidation of non-owned memory? Nikita Yushchenko <nikita.yoush@cogentembedded.com> - 2016-10-12 20:30 +0200
                Re: igb driver can cause cache invalidation of non-owned memory? Alexander Duyck <alexander.duyck@gmail.com> - 2016-10-12 20:40 +0200

csiph-web