From nobody Mon May 6 00:45:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1639164930; cv=none; d=zohomail.com; s=zohoarc; b=bI4NoG9hYgM3C2qvfhjfr81lvfbX/jNzdINRKn3BOc3G9blSU6a4KudiJ1ke3ovYxQbKD8AVld+GXkGWBukGZ46SvR2iVbXrIlG7NbREL5Pdwlgrv8FpRjGEvTTFsbtjL8xmKNRCBolwyg+9NT5d1PQIVw4Kd2My1Ltu5mdaRjU= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639164930; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To; bh=LZvhziiSpOBh0vC8yE04okJeIaA/J/aZR/gPEOPa60s=; b=Gs2kvdgIhR8QQLj/YHHMd0JjdHdT3byfIaG8e1yki19NfiwmHr/VkuL3hYdaXGG/0b15KnaP2KJF3izjzKsgE9kmBy3X0jo81k9I+8KDqsklzyCK2/sgl3c2a0TILYj4meSpyMJVz/cDLENjNjWP/zk3P6TN4aEoWcPkuN7RPw0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1639164930374835.7472219175248; Fri, 10 Dec 2021 11:35:30 -0800 (PST) Received: from list by lists.xenproject.org with outflank-mailman.244301.422537 (Exim 4.92) (envelope-from ) id 1mvlfc-0001br-SI; Fri, 10 Dec 2021 19:35:04 +0000 Received: by outflank-mailman (output) from mailman id 244301.422537; Fri, 10 Dec 2021 19:35:04 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mvlfc-0001bk-OG; Fri, 10 Dec 2021 19:35:04 +0000 Received: by outflank-mailman (input) for mailman id 244301; Fri, 10 Dec 2021 19:35:03 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1mvlfa-0001bc-Uv for xen-devel@lists.xenproject.org; Fri, 10 Dec 2021 19:35:02 +0000 Received: from mail-qk1-x72c.google.com (mail-qk1-x72c.google.com [2607:f8b0:4864:20::72c]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 440e65e4-59f0-11ec-a74f-db008197e53d; Fri, 10 Dec 2021 20:35:02 +0100 (CET) Received: by mail-qk1-x72c.google.com with SMTP id 193so8694287qkh.10 for ; Fri, 10 Dec 2021 11:35:02 -0800 (PST) Received: from pm2-ws13.praxislan02.com (207-172-141-204.s8906.c3-0.slvr-cbr1.lnh-slvr.md.cable.rcncustomer.com. [207.172.141.204]) by smtp.gmail.com with ESMTPSA id t35sm2852504qtc.83.2021.12.10.11.34.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Dec 2021 11:34:59 -0800 (PST) X-Outflank-Mailman: Message body and most headers restored to incoming version X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 440e65e4-59f0-11ec-a74f-db008197e53d DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LZvhziiSpOBh0vC8yE04okJeIaA/J/aZR/gPEOPa60s=; b=l9mZTiIMsv9n8q8+YgiY4kIREo3bAQxulUzgIHa2t40ufnGDg2z8UJkCmkzaahskq6 x1Vnjz2feT/YzNwV9GARtqjqyRrrQqN2Ozw6oVfFOg/3NqLSqiRxw/UQBiW+2sef2l2b yeBLzW4BTjZ8uehD2+U+q8Rmhm4QauLugTuqjaPZ5YZBknnos0BOpUplMXY7tjtN4mZV ZXQBDC6Ph2a76b6Sf7VoC2uWr06KqkDmi+VCNxX6nbEAgTYSN7bnlmx6rtggPYLxZszr oH3FdUW5kdUCoqkKOAtZaMXog6V8O1+yGo1PFJRpKK4ATGdUKkC74W7l1DnIFVQPgbp1 TSPQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=LZvhziiSpOBh0vC8yE04okJeIaA/J/aZR/gPEOPa60s=; b=qBouFW9OpqgXOWhF9reeU1WGPNjF5xaKH6UdanyXTNUn+xKifBkbDAgChVwoL4kbdp VXnTmgQi5DkwvyJ7GEbeuucFX+iapCnf878uyxWQb99pfdd3W1CJGMXiEmRSXJEnnz7h F9F6JLL2btw33srOla/mD296n0DGyUMRaKPGTmQNtDHWdEJne4CtbCECJndHB14zFAXq x0KmN98BSaSPLb8Nia7YZFfXvFMa6xeU8vgb4e8ujd+XRLussqUZLLscjDYlbO8khb+K EA71tRpy72hxmh61vGzV7mzfx+q2xBvSO62w4pHMTHZy9wY4BUyim0fkbi92BFyNciqz /BKA== X-Gm-Message-State: AOAM530c9NsDwhsyufZNt6KA/Nqn0SAGxXnBNjxuYS4LuvWoP0v3Gsu+ TcBL4hC6/om0GQg1KBHubb8= X-Google-Smtp-Source: ABdhPJyDLIa5qmEdPeXW6KEgPi25RJENEAYf/YSsFN0Jpk5qmuVTclAyzherT+kcfWSQ7KRIsePfjw== X-Received: by 2002:a05:620a:e0e:: with SMTP id y14mr21849497qkm.760.1639164900642; Fri, 10 Dec 2021 11:35:00 -0800 (PST) From: Jason Andryuk To: qemu-devel@nongnu.org Cc: Jason Andryuk , Stefano Stabellini , Anthony Perard , Paul Durrant , Paolo Bonzini , Richard Henderson , Eduardo Habkost , "Michael S. Tsirkin" , Marcel Apfelbaum , xen-devel@lists.xenproject.org (open list:X86 Xen CPUs) Subject: [PATCH] xen-hvm: Allow disabling buffer_io_timer Date: Fri, 10 Dec 2021 14:34:34 -0500 Message-Id: <20211210193434.75566-1-jandryuk@gmail.com> X-Mailer: git-send-email 2.33.1 MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @gmail.com) X-ZM-MESSAGEID: 1639164931964100001 Content-Type: text/plain; charset="utf-8" commit f37f29d31488 "xen: slightly simplify bufioreq handling" hard coded setting req.count =3D 1 during initial field setup before the main loop. This missed a subtlety that an early exit from the loop when there are no ioreqs to process, would have req.count =3D=3D 0 for the return value. handle_buffered_io() would then remove state->buffered_io_timer. Instead handle_buffered_iopage() is basically always returning true and handle_buffered_io() always re-setting the timer. Restore the disabling of the timer by introducing a new handled_ioreq boolean and use as the return value. The named variable will more clearly show the intent of the code. Signed-off-by: Jason Andryuk Reviewed-by: Paul Durrant --- hw/i386/xen/xen-hvm.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hw/i386/xen/xen-hvm.c b/hw/i386/xen/xen-hvm.c index 482be95415..cf8e500514 100644 --- a/hw/i386/xen/xen-hvm.c +++ b/hw/i386/xen/xen-hvm.c @@ -1087,10 +1087,11 @@ static void handle_ioreq(XenIOState *state, ioreq_t= *req) } } =20 -static int handle_buffered_iopage(XenIOState *state) +static bool handle_buffered_iopage(XenIOState *state) { buffered_iopage_t *buf_page =3D state->buffered_io_page; buf_ioreq_t *buf_req =3D NULL; + bool handled_ioreq =3D false; ioreq_t req; int qw; =20 @@ -1144,9 +1145,10 @@ static int handle_buffered_iopage(XenIOState *state) assert(!req.data_is_ptr); =20 qatomic_add(&buf_page->read_pointer, qw + 1); + handled_ioreq =3D true; } =20 - return req.count; + return handled_ioreq; } =20 static void handle_buffered_io(void *opaque) --=20 2.33.1