qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2 1/3] xen: fix quad word bufioreq handling


From: Stefano Stabellini
Subject: Re: [Qemu-devel] [PATCH v2 1/3] xen: fix quad word bufioreq handling
Date: Mon, 28 Nov 2016 11:21:49 -0800 (PST)
User-agent: Alpine 2.10 (DEB 1266 2009-07-14)

On Fri, 25 Nov 2016, Jan Beulich wrote:
> We should not consume the second slot if it didn't get written yet.
> Normal writers - i.e. Xen - would not update write_pointer between the
> two writes, but the page may get fiddled with by the guest itself, and
> we're better off avoiding to enter an infinite loop in that case.
> 
> Reported-by: yanghongke <address@hidden>
> Signed-off-by: Jan Beulich <address@hidden>

Reviewed-by: Stefano Stabellini <address@hidden>


> v2: Bail (using hw_error()) instead of just breaking the loop.
> 
> --- a/xen-hvm.c
> +++ b/xen-hvm.c
> @@ -1021,6 +1021,9 @@ static int handle_buffered_iopage(XenIOS
>          xen_rmb();
>          qw = (req.size == 8);
>          if (qw) {
> +            if (rdptr + 1 == wrptr) {
> +                hw_error("Incomplete quad word buffered ioreq");
> +            }
>              buf_req = &buf_page->buf_ioreq[(rdptr + 1) %
>                                             IOREQ_BUFFER_SLOT_NUM];
>              req.data |= ((uint64_t)buf_req->data) << 32;
> 
> 
> 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]