From patchwork Thu Mar 7 07:22:36 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Elena Ufimtseva X-Patchwork-Id: 10842341 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id BCB5F14DE for ; Thu, 7 Mar 2019 07:51:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACAF32E9EE for ; Thu, 7 Mar 2019 07:51:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A0E402EA29; Thu, 7 Mar 2019 07:51:40 +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=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 3BADC2EA3D for ; Thu, 7 Mar 2019 07:51:40 +0000 (UTC) Received: from localhost ([127.0.0.1]:47028 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1noZ-00020x-BY for patchwork-qemu-devel@patchwork.kernel.org; Thu, 07 Mar 2019 02:51:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:60236) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1nMh-0002qx-Pt for qemu-devel@nongnu.org; Thu, 07 Mar 2019 02:22:52 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1nMg-0005nb-GX for qemu-devel@nongnu.org; Thu, 07 Mar 2019 02:22:51 -0500 Received: from userp2130.oracle.com ([156.151.31.86]:48894) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1nMf-0005mc-4A for qemu-devel@nongnu.org; Thu, 07 Mar 2019 02:22:49 -0500 Received: from pps.filterd (userp2130.oracle.com [127.0.0.1]) by userp2130.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x277JFbn037804; Thu, 7 Mar 2019 07:22:44 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2018-07-02; bh=w3SDCbl70c5SqdGsJly46WkBvCf7foYJ41mQ+6izp+4=; b=NrM6wlZBymQ/mTZJ8wGwLmbJBUbbWFRHkRCdYA9fQL4/KujnqVH+TCdEEHoPPVQb9R8d uKsLhZcS3AI0xirsbRXty0bcotm6oPQO13YCcdyRF8vBu4ADeRg0cb0fTE9ywD5JoPbX nteU5Uh9DEzshL0Nj1iY8ArmZHHgFbE9PhZbqSvY90RJ7FBRUllfe9S2bbUR4wQFhU/x RxupSeNKosJSAsLlkvCzXPvU1o5JLAw3PcyGo/VMsv+JvWtjejG5Y2lDuL0BbBDu1VVT a/RJxO/rXQXM91nvjUEMOA6Phc3iXKPXl/9UvcOQehObPF5tIUzKw33B0KlAKXJJx6Ce 7g== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2130.oracle.com with ESMTP id 2qyh8ug99m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Mar 2019 07:22:44 +0000 Received: from userv0122.oracle.com (userv0122.oracle.com [156.151.31.75]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x277MdRA007259 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 7 Mar 2019 07:22:39 GMT Received: from abhmp0020.oracle.com (abhmp0020.oracle.com [141.146.116.26]) by userv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x277Mdds005773; Thu, 7 Mar 2019 07:22:39 GMT Received: from heatpipe.hsd1.ca.comcast.net (/73.170.27.202) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 06 Mar 2019 23:22:38 -0800 From: elena.ufimtseva@oracle.com To: qemu-devel@nongnu.org Date: Wed, 6 Mar 2019 23:22:36 -0800 Message-Id: <20190307072236.9548-1-elena.ufimtseva@oracle.com> X-Mailer: git-send-email 2.17.1 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9187 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903070053 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 156.151.31.86 Subject: [Qemu-devel] [multiprocess RFC PATCH 29/37] multi-process: remote: add create_done condition X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: elena.ufimtseva@oracle.com, john.g.johnson@oracle.com, sstabellini@kernel.org, jag.raman@oracle.com, konrad.wilk@oracle.com, ross.lagerwall@citrix.com, liran.alon@oracle.com, stefanha@redhat.com, kanth.ghatraju@oracle.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP From: Elena Ufimtseva Do not allow BAR,MMIO handlers and irq setup to run before the configuration of the devices completes. Signed-off-by: Jagannathan Raman Signed-off-by: John G Johnson Signed-off-by: Elena Ufimtseva --- remote/remote-main.c | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/remote/remote-main.c b/remote/remote-main.c index fa32f2a..3fa6cbd 100644 --- a/remote/remote-main.c +++ b/remote/remote-main.c @@ -67,6 +67,7 @@ static ProxyLinkState *proxy_link; PCIDevice *remote_pci_dev; +bool create_done; static void process_config_write(ProcMsg *msg) { @@ -355,21 +356,31 @@ static void process_msg(GIOCondition cond) case INIT: break; case CONF_WRITE: - process_config_write(msg); + if (create_done) { + process_config_write(msg); + } + break; case CONF_READ: - process_config_read(msg); + if (create_done) { + process_config_read(msg); + } + break; case BAR_WRITE: - process_bar_write(msg, &err); - if (err) { - goto finalize_loop; + if (create_done) { + process_bar_write(msg, &err); + if (err) { + error_report_err(err); + } } break; case BAR_READ: - process_bar_read(msg, &err); - if (err) { - goto finalize_loop; + if (create_done) { + process_bar_read(msg, &err); + if (err) { + error_report_err(err); + } } break; case SYNC_SYSMEM: @@ -389,7 +400,7 @@ static void process_msg(GIOCondition cond) qemu_mutex_lock_iothread(); qemu_run_machine_init_done_notifiers(); qemu_mutex_unlock_iothread(); - + create_done = true; break; case DRIVE_OPTS: if (setup_drive(msg, &err)) {