public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrea Parri <parri.andrea@gmail.com>
To: Michael Kelley <mikelley@microsoft.com>
Cc: kys@microsoft.com, haiyangz@microsoft.com,
	sthemmin@microsoft.com, wei.liu@kernel.org,
	linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org,
	vkuznets@redhat.com, decui@microsoft.com
Subject: Re: [PATCH 1/1] hv: drivers: vmbus: Prevent load re-ordering when reading ring buffer
Date: Tue, 29 Mar 2022 01:12:33 +0200	[thread overview]
Message-ID: <20220328231233.GA102571@anparri> (raw)
In-Reply-To: <1648394710-33480-1-git-send-email-mikelley@microsoft.com>

On Sun, Mar 27, 2022 at 08:25:10AM -0700, Michael Kelley wrote:
> When reading a packet from a host-to-guest ring buffer, there is no
> memory barrier between reading the write index (to see if there is
> a packet to read) and reading the contents of the packet. The Hyper-V
> host uses store-release when updating the write index to ensure that
> writes of the packet data are completed first. On the guest side,
> the processor can reorder and read the packet data before the write
> index, and sometimes get stale packet data. Getting such stale packet
> data has been observed in a reproducible case in a VM on ARM64.
> 
> Fix this by using virt_load_acquire() to read the write index,
> ensuring that reads of the packet data cannot be reordered
> before it. Preventing such reordering is logically correct, and
> with this change, getting stale data can no longer be reproduced.
> 
> Signed-off-by: Michael Kelley <mikelley@microsoft.com>

Reviewed-by: Andrea Parri (Microsoft) <parri.andrea@gmail.com>

Nit: subject prefix -> "Drivers: hv: vmbus:".

Thanks,
  Andrea

  reply	other threads:[~2022-03-28 23:12 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-27 15:25 [PATCH 1/1] hv: drivers: vmbus: Prevent load re-ordering when reading ring buffer Michael Kelley
2022-03-28 23:12 ` Andrea Parri [this message]
2022-03-29 13:20   ` Wei Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220328231233.GA102571@anparri \
    --to=parri.andrea@gmail.com \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mikelley@microsoft.com \
    --cc=sthemmin@microsoft.com \
    --cc=vkuznets@redhat.com \
    --cc=wei.liu@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox