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  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:   Fri, 17 Jan 2020 17:54:41 +0200
From:   Liran Alon <liran.alon@...cle.com>
To:     Liran Alon <liran.alon@...cle.com>
Cc:     "Belgazal, Netanel" <netanel@...zon.com>, davem@...emloft.net,
        netdev@...r.kernel.org, saeedb@...zon.com, zorik@...zon.com,
        sameehj@...zon.com, igorch@...zon.com, akiyano@...zon.com,
        evgenys@...zon.com, gtzalik@...zon.com, ndagan@...zon.com,
        matua@...zon.com, galpress@...zon.com,
        Håkon Bugge <haakon.bugge@...cle.com>
Subject: Re: [PATCH 1/2] net: AWS ENA: Remove unncessary wmb() to flush bounce
 buffer

Ping on merging this patch (Patch 2/2 of series should be dropped).

-Liran

> On 2 Jan 2020, at 20:08, Liran Alon <liran.alon@...cle.com> wrote:
> 
> Current code executes wmb() in order to flush writes to bounce buffer
> before copying it to device-memory (PCI BAR mapped as WC) to ensure
> consistent data is written to device-memory.
> 
> However, this wmb() is unnecessary. This is because all reads from the
> buffer are guaranteed to be consistent with previous writes to the buffer
> done from the same task (Which is the only one that writes to the buffer).
> 
> i.e. If a single CPU runs both the writes to the buffer and the reads
> from the buffer, the reads are guaranteed to read most up-to-date data
> in program order (E.g. Due to store-to-load-forwarding mechanism).
> Otherwise, there is a context-switch, and that should make writes before
> context-switch globally visible as-well.
> 
> Reviewed-by: Håkon Bugge <haakon.bugge@...cle.com>
> Signed-off-by: Liran Alon <liran.alon@...cle.com>
> ---
> drivers/net/ethernet/amazon/ena/ena_eth_com.c | 5 -----
> 1 file changed, 5 deletions(-)
> 
> diff --git a/drivers/net/ethernet/amazon/ena/ena_eth_com.c b/drivers/net/ethernet/amazon/ena/ena_eth_com.c
> index 2845ac277724..742578ac1240 100644
> --- a/drivers/net/ethernet/amazon/ena/ena_eth_com.c
> +++ b/drivers/net/ethernet/amazon/ena/ena_eth_com.c
> @@ -93,11 +93,6 @@ static int ena_com_write_bounce_buffer_to_dev(struct ena_com_io_sq *io_sq,
> 			 io_sq->qid, io_sq->entries_in_tx_burst_left);
> 	}
> 
> -	/* Make sure everything was written into the bounce buffer before
> -	 * writing the bounce buffer to the device
> -	 */
> -	wmb();
> -
> 	/* The line is completed. Copy it to dev */
> 	__iowrite64_copy(io_sq->desc_addr.pbuf_dev_addr + dst_offset,
> 			 bounce_buffer, (llq_info->desc_list_entry_size) / 8);
> -- 
> 2.20.1
> 

Powered by blists - more mailing lists