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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Sun, 5 Jan 2020 11:49:51 +0000
From:   "Bshara, Saeed" <saeedb@...zon.com>
To:     "liran.alon@...cle.com" <liran.alon@...cle.com>
CC:     "Kiyanovski, Arthur" <akiyano@...zon.com>,
        "Tzalik, Guy" <gtzalik@...zon.com>,
        "Matushevsky, Alexander" <matua@...zon.com>,
        "Jubran, Samih" <sameehj@...zon.com>,
        "haakon.bugge@...cle.com" <haakon.bugge@...cle.com>,
        "Pressman, Gal" <galpress@...zon.com>,
        "Dagan, Noam" <ndagan@...zon.com>,
        "Machulsky, Zorik" <zorik@...zon.com>,
        "Schmeilin, Evgeny" <evgenys@...zon.com>,
        "netdev@...r.kernel.org" <netdev@...r.kernel.org>,
        "davem@...emloft.net" <davem@...emloft.net>,
        "Belgazal, Netanel" <netanel@...zon.com>,
        "Chauskin, Igor" <igorch@...zon.com>
Subject: Re: [PATCH 2/2] net: AWS ENA: Flush WCBs before writing new SQ tail
 to doorbell

On Sun, 2020-01-05 at 12:22 +0200, Liran Alon wrote:
> Hi Saeed,
> 
> If I understand correctly, the device is only aware of new
> descriptors once the tail is updated by ena_com_write_sq_doorbell()
> using writel().
> If that’s the case, then writel() guarantees all previous writes to
> WB/UC memory is visible to device before the write done by writel().
device fetches packet only after doorbell notification.
you are right, writel() includes the needed barrier (
https://elixir.bootlin.com/linux/v5.4.8/source/Documentation/memory-barriers.txt#L1929
)
so indeed we should be ok without any explicit wmb() or dma_wmb().

> 
> If device is allowed to fetch packet payload at the moment the
> transmit descriptor is written into device-memory using LLQ,
> then ena_com_write_bounce_buffer_to_dev() should dma_wmb() before
> __iowrite64_copy(). Instead of wmb(). And comment
> is wrong and should be updated accordingly.
> For example, this will optimise x86 to only have a compiler-barrier
> instead of executing a SFENCE.
> 
> Can you clarify what is device behaviour on when it is allowed to
> read the packet payload?
> i.e. Is it only after writing to doorbell or is it from the moment
> the transmit descriptor is written to LLQ?
> 
> -Liran
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ