提交 e91e84fa 编写于 作者: J Jason Wang 提交者: Greg Kroah-Hartman

drivers: hv: check interrupt mask before read_index

This patches add a read barriers to force the driver to check the interrupt mask
before read_index. Otherwise we may lost a kick to host.

Cc: K. Y. Srinivasan <kys@microsoft.com>
Cc: Haiyang Zhang <haiyangz@microsoft.com>
Signed-off-by: NJason Wang <jasowang@redhat.com>
Signed-off-by: NK. Y. Srinivasan <kys@microsoft.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 0686ab7a
......@@ -75,6 +75,8 @@ static bool hv_need_to_signal(u32 old_write, struct hv_ring_buffer_info *rbi)
if (rbi->ring_buffer->interrupt_mask)
return false;
/* check interrupt_mask before read_index */
rmb();
/*
* This is the only case we need to signal when the
* ring transitions from being empty to non-empty.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册