From patchwork Mon Nov 28 19:42:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Stefano Stabellini X-Patchwork-Id: 9450129 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id CEF2D60235 for ; Mon, 28 Nov 2016 19:44:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id BB64327F9C for ; Mon, 28 Nov 2016 19:44:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id ACF6727FBB; Mon, 28 Nov 2016 19:44:49 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id A87F727F9C for ; Mon, 28 Nov 2016 19:44:48 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBRp0-0000Ve-2e; Mon, 28 Nov 2016 19:42:38 +0000 Received: from mail6.bemta6.messagelabs.com ([193.109.254.103]) by lists.xenproject.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cBRoz-0000V1-E0 for xen-devel@lists.xenproject.org; Mon, 28 Nov 2016 19:42:37 +0000 Received: from [193.109.254.147] by server-6.bemta-6.messagelabs.com id 47/30-28843-CA88C385; Mon, 28 Nov 2016 19:42:36 +0000 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrNLMWRWlGSWpSXmKPExsVybKJsh+6aDps Ig1NTeCy+b5nM5MDocfjDFZYAxijWzLyk/IoE1owF97uYC/byVazrlmlgnMHdxcjFISQwlVFi 043JjBDOdiaJDx+PM3UxcnKwCRhK/H2yiQ3EFhEQkzi9exoTSBGzwBNGida++YwgCWEBO4nWE 11gRSwCqhK72lpYQGxeATeJU+f2sYPYEgJyEiePTWYFsTkF3CW+//8I1isk0M4o8ftkDURNhs S8njmsELaXxKIbl6BsNYmr5zYxT2DkW8DIsIpRozi1qCy1SNfIUi+pKDM9oyQ3MTNH19DATC8 3tbg4MT01JzGpWC85P3cTIzBQGIBgB+OBRYGHGCU5mJREeae72UQI8SXlp1RmJBZnxBeV5qQW H2KU4eBQkuAVaQfKCRalpqdWpGXmAEMWJi3BwaMkwvu2FSjNW1yQmFucmQ6ROsWoKCXOmwrSJ wCSyCjNg2uDxcklRlkpYV5GoEOEeApSi3IzS1DlXzGKczAqCfMWgEzhycwrgZv+CmgxE8ji19 Ygi0sSEVJSDYzhRzaGrPgofm4zX86luPW+PKt2M06c3bfuyCxB+58lhQcuNN98YWyb9SNu0p4 Pz5/fWqGy3aHCL7r81SPzfjVG1aSb9aI5WoFpzz+df/vv2WOV6Xl+E7R/fU/Ydaxr+d9KtuzK 6pd/Yh09imZl5vIpa9qvST5m6bso/WuI77nDhqIv6+d+ftanxFKckWioxVxUnAgASD2cio4CA AA= X-Env-Sender: sstabellini@kernel.org X-Msg-Ref: server-3.tower-27.messagelabs.com!1480362154!74211767!1 X-Originating-IP: [198.145.29.136] X-SpamReason: No, hits=0.0 required=7.0 tests= X-StarScan-Received: X-StarScan-Version: 9.0.16; banners=-,-,- X-VirusChecked: Checked Received: (qmail 54474 invoked from network); 28 Nov 2016 19:42:36 -0000 Received: from mail.kernel.org (HELO mail.kernel.org) (198.145.29.136) by server-3.tower-27.messagelabs.com with DHE-RSA-AES256-GCM-SHA384 encrypted SMTP; 28 Nov 2016 19:42:36 -0000 Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6890120172; Mon, 28 Nov 2016 19:42:33 +0000 (UTC) Received: from sstabellini-ThinkPad-X260.hsd1.ca.comcast.net (96-82-76-110-static.hfc.comcastbusiness.net [96.82.76.110]) (using TLSv1.2 with cipher AES128-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 33AE320204; Mon, 28 Nov 2016 19:42:32 +0000 (UTC) From: Stefano Stabellini To: stefanha@gmail.com Date: Mon, 28 Nov 2016 11:42:26 -0800 Message-Id: <1480362146-14873-4-git-send-email-sstabellini@kernel.org> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1480362146-14873-1-git-send-email-sstabellini@kernel.org> References: <1480362146-14873-1-git-send-email-sstabellini@kernel.org> X-Virus-Scanned: ClamAV using ClamSMTP Cc: peter.maydell@linaro.org, sstabellini@kernel.org, Jan Beulich , qemu-devel@nongnu.org, stefanha@redhat.com, anthony.perard@citrix.com, xen-devel@lists.xenproject.org Subject: [Xen-devel] [PULL 4/4] xen: ignore direction in bufioreq handling X-BeenThere: xen-devel@lists.xen.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: xen-devel-bounces@lists.xen.org Sender: "Xen-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Jan Beulich There's no way to communicate back read data, so only writes can ever be usefully specified. Ignore the field, paving the road for eventually re-using the bit for something else in a few (many?) years time. Signed-off-by: Jan Beulich Reviewed-by: Paul Durrant Acked-by: Stefano Stabellini Signed-off-by: Stefano Stabellini --- xen-hvm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/xen-hvm.c b/xen-hvm.c index 124ae10..0892361 100644 --- a/xen-hvm.c +++ b/xen-hvm.c @@ -997,6 +997,7 @@ static int handle_buffered_iopage(XenIOState *state) memset(&req, 0x00, sizeof(req)); req.state = STATE_IOREQ_READY; req.count = 1; + req.dir = IOREQ_WRITE; for (;;) { uint32_t rdptr = buf_page->read_pointer, wrptr; @@ -1014,7 +1015,6 @@ static int handle_buffered_iopage(XenIOState *state) req.size = 1U << buf_req->size; req.addr = buf_req->addr; req.data = buf_req->data; - req.dir = buf_req->dir; req.type = buf_req->type; xen_rmb(); qw = (req.size == 8); @@ -1031,10 +1031,12 @@ static int handle_buffered_iopage(XenIOState *state) handle_ioreq(state, &req); /* Only req.data may get updated by handle_ioreq(), albeit even that - * should not happen as such data would never make it to the guest. + * should not happen as such data would never make it to the guest (we + * can only usefully see writes here after all). */ assert(req.state == STATE_IOREQ_READY); assert(req.count == 1); + assert(req.dir == IOREQ_WRITE); assert(!req.data_is_ptr); atomic_add(&buf_page->read_pointer, qw + 1);