[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 1/3] xen: fix quad word bufioreq handling
From: |
Jan Beulich |
Subject: |
[Qemu-devel] [PATCH 1/3] xen: fix quad word bufioreq handling |
Date: |
Wed, 23 Nov 2016 02:24:08 -0700 |
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 entering an infinite loop in that case.
Reported-by: yanghongke <address@hidden>
Signed-off-by: Jan Beulich <address@hidden>
---
TBD: Alternatively we could call e.g. hw_error() instead.
--- 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) {
+ break;
+ }
buf_req = &buf_page->buf_ioreq[(rdptr + 1) %
IOREQ_BUFFER_SLOT_NUM];
req.data |= ((uint64_t)buf_req->data) << 32;
[Qemu-devel] [PATCH 2/3] xen: slightly simplify bufioreq handling, Jan Beulich, 2016/11/23
[Qemu-devel] [PATCH 3/3] xen: ignore direction in bufioreq handling, Jan Beulich, 2016/11/23