Re: [Qemu-devel] [PATCH] ehci: fix fetch qtd race

2018-11-26 Thread Gerd Hoffmann
On Mon, Nov 26, 2018 at 10:34:13AM +, li qiang wrote: > > 在 2018/11/26 18:08, Gerd Hoffmann 写道: > > The token field contains the (guest-filled) state of the qtd, which > > indicates whenever the other fields are valid or not. So make sure > > we read the token first, otherwise we may end up w

Re: [Qemu-devel] [PATCH] ehci: fix fetch qtd race

2018-11-26 Thread li qiang
在 2018/11/26 18:08, Gerd Hoffmann 写道: > The token field contains the (guest-filled) state of the qtd, which > indicates whenever the other fields are valid or not. So make sure > we read the token first, otherwise we may end up with an stale next > pointer: > >(1) ehci reads next >(2) gue

[Qemu-devel] [PATCH] ehci: fix fetch qtd race

2018-11-26 Thread Gerd Hoffmann
The token field contains the (guest-filled) state of the qtd, which indicates whenever the other fields are valid or not. So make sure we read the token first, otherwise we may end up with an stale next pointer: (1) ehci reads next (2) guest writes next (3) guest writes token (4) ehci rea