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] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAKgT0UfJwYFy5g_2TE5W4MgdEvyH2CvBAS2imdw9UUiumuUOhQ@mail.gmail.com>
Date:   Wed, 14 Mar 2018 18:41:51 -0700
From:   Alexander Duyck <alexander.duyck@...il.com>
To:     Sinan Kaya <okaya@...eaurora.org>
Cc:     Netdev <netdev@...r.kernel.org>, Timur Tabi <timur@...eaurora.org>,
        sulrich@...eaurora.org, linux-arm-msm@...r.kernel.org,
        linux-arm-kernel@...ts.infradead.org,
        Jeff Kirsher <jeffrey.t.kirsher@...el.com>,
        intel-wired-lan <intel-wired-lan@...ts.osuosl.org>,
        LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 6/7] e1000: eliminate duplicate barriers on weakly-ordered archs

On Tue, Mar 13, 2018 at 8:20 PM, Sinan Kaya <okaya@...eaurora.org> wrote:
> Code includes wmb() followed by writel(). writel() already has a barrier
> on some architectures like arm64.
>
> This ends up CPU observing two barriers back to back before executing the
> register write.
>
> Since code already has an explicit barrier call, changing writel() to
> writel_relaxed().
>
> Signed-off-by: Sinan Kaya <okaya@...eaurora.org>
> ---
>  drivers/net/ethernet/intel/e1000/e1000_main.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/net/ethernet/intel/e1000/e1000_main.c b/drivers/net/ethernet/intel/e1000/e1000_main.c
> index 3dd4aeb..e0e583a 100644
> --- a/drivers/net/ethernet/intel/e1000/e1000_main.c
> +++ b/drivers/net/ethernet/intel/e1000/e1000_main.c
> @@ -4573,7 +4573,7 @@ e1000_alloc_jumbo_rx_buffers(struct e1000_adapter *adapter,
>                  * such as IA-64).
>                  */
>                 wmb();
> -               writel(i, adapter->hw.hw_addr + rx_ring->rdt);
> +               writel_relaxed(i, adapter->hw.hw_addr + rx_ring->rdt);
>         }
>  }
>
> @@ -4688,7 +4688,7 @@ static void e1000_alloc_rx_buffers(struct e1000_adapter *adapter,
>                  * such as IA-64).
>                  */
>                 wmb();
> -               writel(i, hw->hw_addr + rx_ring->rdt);
> +               writel_relaxed(i, hw->hw_addr + rx_ring->rdt);
>         }
>  }
>

So you missed the writel in e1000_xmit_frame. You should probably get
that one too while you are doing these updates. The wmb() is in
e1000_tx_queue().

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ