From patchwork Tue Jun 6 18:19:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 9769555 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 022C160364 for ; Tue, 6 Jun 2017 18:26:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F2AAD22B1F for ; Tue, 6 Jun 2017 18:26:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E794927C05; Tue, 6 Jun 2017 18:26:28 +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=-6.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 5F63A22B1F for ; Tue, 6 Jun 2017 18:26:28 +0000 (UTC) Received: from localhost ([::1]:39648 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIJBT-0002LK-Bi for patchwork-qemu-devel@patchwork.kernel.org; Tue, 06 Jun 2017 14:26:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47508) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIJ5T-0005wn-Vd for qemu-devel@nongnu.org; Tue, 06 Jun 2017 14:20:16 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIJ5P-0007ND-Ka for qemu-devel@nongnu.org; Tue, 06 Jun 2017 14:20:15 -0400 Received: from mail-eopbgr30107.outbound.protection.outlook.com ([40.107.3.107]:56200 helo=EUR03-AM5-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dIJ5P-0007MD-86 for qemu-devel@nongnu.org; Tue, 06 Jun 2017 14:20:11 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=virtuozzo.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=juShlhsqKW4HPVhowGlxGeyxhBB5RAOfIauuGYI3p6w=; b=hNtmf9cuBd7vsNmfhcWNo1n2L5rUsTcPfKLV6rhWr7HhrrYBMYmKlx1oUEkOI7UXlolOPLgLHh8+lUDbamRWoJExLbXXp7M9G4RbRxm1LsuDiZsHt9ubpdePuBwk/SMuLLDtCIW+t7FBO7D3/6tshvgiJpk8H1hus5ylL7Ju5Ds= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none; nongnu.org; dmarc=none action=none header.from=virtuozzo.com; Received: from rkaganb.sw.ru (195.214.232.6) by VI1PR08MB0847.eurprd08.prod.outlook.com (2a01:111:e400:5a05::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1143.10; Tue, 6 Jun 2017 18:20:08 +0000 From: Roman Kagan To: qemu-devel@nongnu.org Date: Tue, 6 Jun 2017 21:19:39 +0300 Message-Id: <20170606181948.16238-15-rkagan@virtuozzo.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170606181948.16238-1-rkagan@virtuozzo.com> References: <20170606181948.16238-1-rkagan@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: DB6PR1001CA0042.EURPRD10.PROD.OUTLOOK.COM (2603:10a6:4:55::28) To VI1PR08MB0847.eurprd08.prod.outlook.com (2a01:111:e400:5a05::17) X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: VI1PR08MB0847: X-MS-Office365-Filtering-Correlation-Id: 442eaa29-e67a-4643-2090-08d4ad08aa4d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:VI1PR08MB0847; X-Microsoft-Exchange-Diagnostics: 1; VI1PR08MB0847; 3:DjFNT6utrtE+XITiQoiIekBusTNWam1HUI2ZXt3SrjonuyWAbiuJDfXS/PNePGKPSDFds8KuoGki/IsVGs7Sb5mTOzjoiNU5sX7CRl8wcvNXPM6Qqgn4sS5OYc1xUrsBIrr0lCVAkciwBX1cyVMVI6SGYV/D/ZBNBUieiqK8HLn+F02tTOYFTje03d6CJLAK8fFfgeKXbxScohAuZOhqgjiz2t71mxYR7qhCXVwJZ7rq7I/xhxHacjlOBO/hXMr7ThTbYj9ssGOF83ct0KCDMxSM7np1vZjykr7p+wVO7CXoMaPIor7BnEFPdNxOIQvjuG93ybsHiqJtCfP7xVLwaQ==; 25:OBg4D2NbcMJTnS1i2Y4QrMYwf0DXlOAYbvlHukllelu5N7RlMbMmXxC9zVV27KUCTBvXq1aJdn1FsVHB3pic68hL+0cCw2sjDe1yQyXAjTBLr++kXTa1PXAV+nsOpVOwm1bnYwOw1/glRWD+cvhSeXaE/Z+x6DM0SCXfS/tbpX4G2w5UiAIbMRKOHKpRohDx0wvTrn2v0j4CMnwuLM8fcJBnwDwdckUeBMg46CdrSZTOL+ZTWsltr6QQh9JGv3xqa5VtIUl4ckFpYnM+hPBvy+C9RCBDwvEGysxuYgoxppY+zx8fM7OuEm3c5C/i5A1h3MOdqkaePplf+kJu7KkRr+yNTf/R5dbN5Amf+ZoBtfKXOqXNnXRAUSVUR326YJP2k3C/LJhZyWRkORnOZqX39GdvnHuiq33jJVCldDkJQtPhwHYUOpV6cuBMimeT09Gkdiu3jyO5oAPKRVFeUd/ouIXBnqpewPsUnPe8D11R4NE= X-Microsoft-Exchange-Diagnostics: 1; VI1PR08MB0847; 31:aB2R8w79lroR9tfspvtsXjIU/J2wn00dnxO3x2j5R1VsvWEbi6xAuVEggV/VGcnR4Yfv/z3QNwWziSTrSISeorakmpW/figXbR6wbX50e88wK3Bbp4Et1GN0/bi8Gdwp0rLC+kTzyzy9E+k4KYi+qnEWOXWqLlSderrn6GRVitRtqWDQxBlGjqTwzBNLFs10KfzU1WFBLW4zb7awt5YdGoe+KbBNIS5wdOtvSzfsPDk=; 20:Kwn+CGCOztAgjHMvIRxDVlbuhmTeUQSDk4wznuvEYDCJflEl9TJFp7P96NrvvYqm/Olr5ppRMYSlATYEz1xK16m07zS1DokiPYuwBGh2OeBkKIO6uhsDoJf5U8eaWpN9TtatmZ2u6EHVbOIdhn+tcHvK2fT59ymdKuttjxSEabJAKwFf1ee71ZPa0WNGnzdm2jzpVjUK4jNALNcIy4ia2q7xm3e8bYYulRlmvsYaLZpPd2/DbOKlD1CaF+lNIvSkuZgfjS3IzL/jz/BULMz2CwKO88Xv7MoETHELmp6GvMkxOGFu+Nbk+RND6QYiNQ5L3jSQNyr4IDJe3T1kHlHPgzg7+nRtTjcovKzzkSj5GY1C7UTgcbiqwb9aNrUbAucPEHObfaHIaek1u9I/mGQSZLOdMj2NJa+7iTERf+xOf7U= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(8121501046)(5005006)(93006095)(93001095)(3002001)(10201501046)(100000703101)(100105400095)(6041248)(20161123560025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123558100)(20161123564025)(20161123555025)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:VI1PR08MB0847; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:VI1PR08MB0847; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR08MB0847; 4:Li9cMTuxa0SaxYCs1jFEicyTbCRLUsSWU613tjahgF?= =?us-ascii?Q?UqZHrheBMia39JYEL3aPAzCv61NWkQgsVVSWkSNaINLaRgpYHa/huSzyFw44?= =?us-ascii?Q?D6hJUbiqLq1Uc5Swv39/hwCl2NrNR1xxj/Vf19aun9PzK2M+Y52XBbnqljfW?= =?us-ascii?Q?T04uSiGzaacjup8xW6cyi4kCtq50WZs5AOGoXhEcrE6mvREKcNZEhnz9HGv1?= =?us-ascii?Q?tseR/Y7xchqjzhjHhh3CN4YNxORRnlc/mj7QM2RAjMLH5Qyy6D8CA6ZqNMNY?= =?us-ascii?Q?aNvh9wAWLc/H5Kkb+LydpVf/tAcl7hAoUNyFcdQNjXZ5prR1W7t1C52iSH4A?= =?us-ascii?Q?Z7rexrim/W16aYx1VLktvgiti7w6GQlSOUhn5d5CyxV6GEEogZx6tKFZ20AW?= =?us-ascii?Q?JffJNJFgczlyP6PkOFgaEJsv4QO9dYrtSlhSLFwTzcmzLyWcJmq/YSVYbAqL?= =?us-ascii?Q?e0s/btAIywPGidbKR+0ItnmxSSlnbXD+SgMKbp81T46Tz/p7n/omykyPCQp0?= =?us-ascii?Q?9KNNWRh/5ebUDVirWcUZGSt4xXStfR+xfzOGs14vWNRG9EDgb2n7wrVU1iql?= =?us-ascii?Q?PVB+wdYUykXtZ5fI73gazrgMtN6WmTrzBB5JGEdvoP0W2EzmEmiqVM0FiZeK?= =?us-ascii?Q?9Nv37mmwMBsXoSIccebQCIagGnfAnKGv+n/tV63VAyc63Ri2CkyYnl8vW02V?= =?us-ascii?Q?qhSggpEHZx9UxOngGZODXCbpzRnZT0o3ndM/g6Ha6gG/KRJbpQBDNPXBW75N?= =?us-ascii?Q?G494VpWXQ54NrY4PWNpxOXIaJuEWWnDqNpqPSxg65hlPASgkH6H4eHG/5nh3?= =?us-ascii?Q?zBw/NrJBCRh3QeVQnpptB2k1kfBvyj58u7JXo4ShGqCvvoaker86qzcycdhy?= =?us-ascii?Q?CsrLPqyE8FV2jNOb2dOnoYPD3PpXFN2GtTp4cuw4DuxquE7YsVq3KISlJ6tl?= =?us-ascii?Q?vqFqg5o67gO+qfx2LyEZh2VlhPJFi9GEO1NFXEHcOfrwJEcla+Rl8CCi7LMo?= =?us-ascii?Q?AYFzQ3Mccb2klJrxeA5mhHoKQHXNGF2uwFqx12FlsqNjQyRrs8MGj8h0DycR?= =?us-ascii?Q?XErSJFdADh6pFWVD5dPjpzbNvfCE753/OstaUHmz1d/LRjuDh2a4mQ7pTITk?= =?us-ascii?Q?f8AW4/ucWxcPfCZE3GpWdv3n8BM/G3?= X-Forefront-PRVS: 033054F29A X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39410400002)(39400400002)(39840400002)(39450400003)(48376002)(33646002)(36756003)(47776003)(6486002)(478600001)(66066001)(5003940100001)(2361001)(2906002)(5660300001)(2351001)(50226002)(81166006)(8676002)(25786009)(1076002)(6512007)(6916009)(53416004)(76176999)(42186005)(189998001)(38730400002)(53936002)(4326008)(50986999)(107886003)(7736002)(110136004)(6666003)(6116002)(3846002)(54906002)(2950100002)(86362001)(6506006)(305945005); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR08MB0847; H:rkaganb.sw.ru; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR08MB0847; 23:1im00F0i3fTH3m0F3gl9Cb5IFcfUn94tcwvHCxtUR?= =?us-ascii?Q?4QHIgTrD/6FKRcMxVWBlVBedNbypE2g1yLVBAChQs/FV4zn57jrMyrbvbLtY?= =?us-ascii?Q?QGhQUU+IO5Yj9+XVT0hYosBl01n/NpF0WVTPKi+d3F5IHfvGjTsXjfid2Lkm?= =?us-ascii?Q?UsT4hiQDToaUTGJJl3hXmMu6Zoc2vevpHqeG4vgKGnYqch7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gz/PYMBJEYA8oMYEFixzgCUCNTwBh4mXGunkOAaJrQtGB2l6Ry9rfILSMjzYmHZo+cqM; 24:Uh0ZvK03u3fkC9Ct9BKll93vJPwxaWVkGmgAUPlvkakdcYUC7XXJC05aQNoqUJZ8caqB5LDu90F15U93XeK0V7OhiLpoCDCN3d9eER+rZa8= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR08MB0847; 7:qNzjjYkCrMMMNnG/CUJasJWNxKxtIywlpGT4ySTsyQsgbMg8qtlBgZZT7stuF4dAOuPAfkdAaJfljd2fZW55RWKP/BoWxyc0wr9kWbK9WVAfytldGz87Q6tLQT9BZdMTC4+CvAfyMpzLXaQp4UrpEb1oT0W9dUXrO62kSvE6FemsZhtZQoNgA0/yjPq6XjrnwVCGZ7eqOUYXu52l85hQ4C4v1X9JlRZXznnudoXSwTeyq7KDjGRRJJmh4IE3yKvdWre/TXtnecHzcHWT++lIdW+za8+SN9YCcpmbhJvwKPk0+F6cbKvEAvsavvumrXWbnFXtbFai6irVdzcwgDaYjQ==; 20:AeT5IocLJeNExKJEkWm2P8LxOHO0/6xLGzN4Kuh2Wdm2NRrXk/fWU+hqhpB8Ezx7MiqM9+5bF3yqBUmQTT464oyh8+qxyik5F/jE9/k/g15LN4RE8Q+HWWv765Umk+CWmCJq4Rge91jfj+w83uAv+uTHzXfWGQMC8p2mW74wpos= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2017 18:20:08.7419 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR08MB0847 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.3.107 Subject: [Qemu-devel] [PATCH 14/23] kvm-all: make async_safe_run_on_cpu safe on kvm too 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: Paolo Bonzini , Evgeny Yakovlev , Eduardo Habkost , "Denis V . Lunev" Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Wrap the bulk of kvm_cpu_exec with cpu_exec_start/end, so that kvm version can also enjoy performing certain operations while all vCPUs are quiescent. Signed-off-by: Roman Kagan --- kvm-all.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/kvm-all.c b/kvm-all.c index 494b925..85668fb 100644 --- a/kvm-all.c +++ b/kvm-all.c @@ -1974,6 +1974,7 @@ int kvm_cpu_exec(CPUState *cpu) } qemu_mutex_unlock_iothread(); + cpu_exec_start(cpu); do { MemTxAttrs attrs; @@ -2103,6 +2104,7 @@ int kvm_cpu_exec(CPUState *cpu) } } while (ret == 0); + cpu_exec_end(cpu); qemu_mutex_lock_iothread(); if (ret < 0) {