From patchwork Wed Jun 21 16:24:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 9802285 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 5546760329 for ; Wed, 21 Jun 2017 16:39:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3A47C28563 for ; Wed, 21 Jun 2017 16:39:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2C2EE2862E; Wed, 21 Jun 2017 16:39:17 +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 46ADB28563 for ; Wed, 21 Jun 2017 16:39:16 +0000 (UTC) Received: from localhost ([::1]:55093 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNiex-0001Sg-AB for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Jun 2017 12:39:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35510) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNiSq-0007ja-Lt for qemu-devel@nongnu.org; Wed, 21 Jun 2017 12:26:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNiSo-0004pp-1e for qemu-devel@nongnu.org; Wed, 21 Jun 2017 12:26:44 -0400 Received: from mail-eopbgr30102.outbound.protection.outlook.com ([40.107.3.102]:29592 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 1dNiSn-0004ow-Jo for qemu-devel@nongnu.org; Wed, 21 Jun 2017 12:26:41 -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=G63sxeACyEqyH5SiFXx3EmMQ+58XYggq7FizZuYwHVs=; b=fhN43kO4W9mAHjMaaHqLAf/4A9C3HSxYFGnB+1TR6YluVorg22vWt8D3wzF6akkPeKUXxkfEAGUUgutCmwK7CPe7/HzHt+yKXiWQCE56EoW+YS105Wj/IInTcvrDSSZPbbuReycNXDjfumICuC64XXT6W+/l+NQhbqYRGQx47+I= 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 HE1PR08MB0842.eurprd08.prod.outlook.com (2a01:111:e400:59b2::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1178.14; Wed, 21 Jun 2017 16:26:35 +0000 From: Roman Kagan To: qemu-devel@nongnu.org, Paolo Bonzini , Eduardo Habkost Date: Wed, 21 Jun 2017 19:24:21 +0300 Message-Id: <20170621162424.10462-21-rkagan@virtuozzo.com> X-Mailer: git-send-email 2.9.4 In-Reply-To: <20170621162424.10462-1-rkagan@virtuozzo.com> References: <20170621162424.10462-1-rkagan@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HK2P15301CA0022.APCP153.PROD.OUTLOOK.COM (2603:1096:202:1::32) To HE1PR08MB0842.eurprd08.prod.outlook.com (2a01:111:e400:59b2::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: ef07a70f-e3db-4340-4b86-08d4b8c24b70 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:HE1PR08MB0842; X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0842; 3:rEz2pBSGiIsUMgCJZrRnTIh9nOy0sS50cN1oADY9lBPUCfwYhBImOhyrYVeeNNJjAzjIgz9YeAXBlyTtc0PfCVExLbTwNIIdgBTPOrC9td1GHqyijIb+KBPrB2Etd1HVEo1qPCNch/0yBWBYxKqI4zMsk7iCQqOOjEi/1DwN9e5ZdXvH6f6L6+Di8RyluhQh0xgDhTulpakunYyI5RPlToIdpE0NnL95kwXdq61lBgdZf785fwC5KRrVxN2H+M7VXFizwoFTi0b255HukA9clCbXGpGGjHxme/2ZqNAxJv9HE4ov0dIWSRFHHb2r8HxIjYs8zuU8xDX9g2+7JnKgkg==; 25:DSPKFUTbExd9+eIeYM8t/QoZzywzxEHaq7d/Gzf5I22WpZaVtmvli6LQWNj3zV5mAsdN8U1mDNwYm4dB1PAgch+zyeYxaxT/yoKewmUrl7b1j6dMUAUF48tSQDdIaKN5KgxG8LgCQ5LQ1T5v2nIFhHBjGRUJK5MFr7u3VsgxlxV1rK/Ue/7tYEonb0HtAMxhF/G2Zg8rY2h0/iKOvVmx+ddob+hByE98V8+qhaBINMXl5tzqTSVZIeqEek4OvHbkNUBMKCMU0vNHPb2bwQZgRKjEfFieQg7WLM5Z3aq4w16I5PpstnIcwAlP/xL9PSg9LJU8KFQuo7axvt/PXck35+fGRPCCIqJkr5kaOHQQCvNFpovkC8IemZsDZ6KtV30CHXwZQ+4oto+Zf5B7ug/JWr3jVc6HTdSNNISi6r/HuHS3fmVpbEINBh342b/w5eckbyLS5LyX4ZXg//QJph/MhhSL8hluYEzM9/NuibE4EB4= X-MS-TrafficTypeDiagnostic: HE1PR08MB0842: X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0842; 31:YLqAJGadXXU8oXcZx4co9/peOd3E4TGIbGHmMwjmJIuLi9UTgKIHCWm0ctoNkRbnzgDOiDoZ2LKZQaJVTf1qA4snpMfAFu4LcuaOn/fSqC9PQ4N4Q3xkEXzJeI3s4jsxp3a9mHHd4Y0SeU5Ok+rHZA3yNLtnzept6T+0zfYaz+3wy+U25exEdC2zbeUuckPHlfYsADou9xEsrJSA4lh5sQpf/x1W5Djs2qQ7Go6G3vQ=; 20:Mf2iwXkCvF6nSDr5AxKhvj4MWO2KxGxltS31IQDC54Y0FiAJ4PHFhMmcaluQDz3vNCH1wAVb+xHCeEDJ7k1OTCdSsKfaQ4VPY9BVrZtcTF56cynGIoscdOHfbkY+qXwF+8n/1Uf4PZxFgiTpePU7KSIQXd9+MhJCEt1zkGszWuwsNSkZPiYo9fqBGkGyxOUExju8cIQV/+2mCMxA9+04JtXVakJ8VPM6L70Btx6sO5MeN+bOcP4TShgE3fWRyBqeXiJHsqRj0knyOKuK8sq2AL5WpBKqt6CHwfK/kChk9v2hHWeXrThq6D9m9WTwZ0xBo8IQESkGVngEL8KqXVSDeIsGqw9HKp5VPht64x4AWCEHSJx792MnXXNA8dWwau+7NLPSkojDT7AhBcnUVZXE5USzWvb3TIllr2McnmGHahw= 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)(3002001)(93006095)(93001095)(100000703101)(100105400095)(10201501046)(6041248)(20161123555025)(20161123558100)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR08MB0842; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR08MB0842; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR08MB0842; 4:jtoS17XNaTKqoK7pe/LZAzWYtupPxhtJbsrRW8fuPY?= =?us-ascii?Q?xkVeumfuG68MAr4lRlxJNCTzEGp9QB/i1stPSt2Ms15t9K5mhiAmEtZ7Dg1o?= =?us-ascii?Q?VbgHKevjseHlkOIgB2eGVfnolufgNw5VOxONoqcMzHbLonxrKtByIFVv6RlS?= =?us-ascii?Q?joQRdKxgJWZx9dXvv2HJTB5Zrl5erTEIT9q0za/BlnVhu/rSI4HUJ2mLgs3F?= =?us-ascii?Q?RUPpAiJtYqZkk0cxarVwtTz7gGTUSiUcoSMxTmdgi/vgQLZ4XFiZ+gO/XLib?= =?us-ascii?Q?pUwl6ZLp7vWOmEtj/SpqpstuL30RkQMSCFrlbSuPFwBQaKGWHWF/6uRcZ/SX?= =?us-ascii?Q?9eqlFPibT6bfd8XiMwiBs6iFZbwt1suatfFV83/0ZTBaCHoF8NiY09S5OUdL?= =?us-ascii?Q?iEF/5k+fuc45T94vCADGW3s3UCkNCziDQ8EclmaK8XDkDcySFxS38Osm5vYz?= =?us-ascii?Q?a8FQPTEqiJaC1tBxS2e4q1yUsOQjFVa+CBDSG5WbgVA9XGCWYBgwDqVeksk8?= =?us-ascii?Q?oXdZD8U6FR9EgBvCwxqHIIdpmXNpGQOKvYLctFxNE6yOeA1hX9iPmopald0K?= =?us-ascii?Q?+MlHQad/d2omMK+8Xw6RKZZOoPC+JZFoYa/Q6MDFQ60YYzxrffSwp53ot5nq?= =?us-ascii?Q?ualQN5NDg0qK5cElvA6I8gYg7lNtn0unTlBFuPh2ohuEK9lNMCI/E7hSb4Mk?= =?us-ascii?Q?SqmUIEcLk8brISlecymCUpLx9FgcyL4cSQHpcY1A3ZLJONO+Y5Q9h9a62ppc?= =?us-ascii?Q?1RuRw5Q0J1HG/taksbi/hxkYTJW+v9hGlDJF0ofE+rE2J6QT8lWRCuc5gLvc?= =?us-ascii?Q?QTnqDx9dEIwfjzCXFQYZROb5H0SozO2bNiBkqQwAurbVGTS8cej/BmapqIhL?= =?us-ascii?Q?YjS91GrZ/3C8teMTvWlHvVpwq9MDAPlmiWmju/s5bGO6rKOgu1LaAmbsamAK?= =?us-ascii?Q?cAWfr6p4uEA7emBYkEcXPoY7AQ7LATiVGTsToC8cpkFUWVR35eyHoJl1rqXN?= =?us-ascii?Q?Ur4gpaK0VV7W+86JdMivibJq6/6jyyAy0w/XFgERXnOiVjxEsMDw47Fv/j13?= =?us-ascii?Q?8Rd3J9wPmM0ctlv11YBmnqBwYMvM7Pk2hpkoQHWc440BZNWedfVGbWuWk9gL?= =?us-ascii?Q?JFX/sRVzVkoCc43ygVU/q7BaypsWJt?= X-Forefront-PRVS: 0345CFD558 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39400400002)(39410400002)(39840400002)(39450400003)(53936002)(50226002)(305945005)(81166006)(7736002)(6486002)(189998001)(8676002)(50986999)(76176999)(66066001)(6116002)(3846002)(2906002)(47776003)(25786009)(5660300001)(36756003)(1076002)(5003940100001)(6506006)(53416004)(42186005)(6666003)(4326008)(2950100002)(6512007)(38730400002)(86362001)(478600001)(33646002)(54906002)(50466002); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR08MB0842; H:rkaganb.sw.ru; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR08MB0842; 23:mr4mDo0BViAKiJwSCtUDHMaPG2vVgWzZZYrp+JDmE?= =?us-ascii?Q?XRBqy+dDUTDom1oLhcrQG8maunQ0gQyX/JoOjGLj/LTPjpEXQ52LGJxjsbR2?= =?us-ascii?Q?YpYh97GBVyWdQNG394FBFgYC8TyYTGV+iDRQORL32Wvh9mWLZIEHEdwW3/+z?= =?us-ascii?Q?RU/mDSbNrYqc98ByqM4vBC7HObBaXJnEAgwPHClmxil88K7mLYuMlRbya/K8?= =?us-ascii?Q?1j5GA2H5xbiLe1Ix4Jd3Eig2jJ655pwQo9n/Dg8E1m3zinh5IfKHJieS44UO?= =?us-ascii?Q?TZ/JzKmFeskQ+JUDRBrS0k+nIOOEue1dZbp/49/cYNEsL4HA68BO4FRAc+4d?= =?us-ascii?Q?ZsgS4BJBURAG5y+L2TEO82Wk0zAxK+x4gxSmzj9PekK4s8nIwn1kjgyER38/?= =?us-ascii?Q?PKwZx3PU/pkpb1cRIHw7U6rEABXB62XeJUdZulQLXnSz2nDdR/kJBhcWEwKc?= =?us-ascii?Q?Y+hpfuQsNaYLQnW8zkyOchbhj7TzOCsu93fMsKhHetbZCK8QRtyM2k/WtEq/?= =?us-ascii?Q?WsriaQ1K9wbApSFY2Ieolb7eKE5EnfDsSxQ84JkhzLPE7GuVroZ2w2hqVP8G?= =?us-ascii?Q?h93VqCI7l6xU+4wTYMwJryfWx4UQZIUVS83TAFOg2U4ys5pocZbHhX4ie8Iy?= =?us-ascii?Q?sd7D1vq8qyyBD6f/dR72M+KiVOGgKCPt+z6HVM875zweOmTzUahgAxpXo36z?= =?us-ascii?Q?PKRfVTHK7E4e17iTrcqAfdjMDYvXUiRMTVHUh+RedPkSJa3a2h3eHw8j4Y5E?= =?us-ascii?Q?XZiwyejNKj+b55SmzWE05kmIl67OxVKttP+D2388Bux656TcPDKwpoVi4BQU?= =?us-ascii?Q?PFplbpDqviWl0nA33SqvJWY5p7ts87iyW5bh3jdF+RA0XyN9daD/pN9FJbq5?= =?us-ascii?Q?TxWh5PmB4gPM4i11SOgCGiUTTzeVqY6n+6Jzizyh9gDprEmT9+sneozVWFLL?= =?us-ascii?Q?YRjKV1eJvrxZlMHPJHPx6yqx1agsDtNZVgVtfza4zkrdS3XkM92HntE+FsCJ?= =?us-ascii?Q?/o=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR08MB0842; 6:4SChVqs02Y2uwBfTvqNMJtXlG8+YLiC8/vomYiyXOq?= =?us-ascii?Q?OWE/JXtOv20U+LbWOWmUtbTckcA25VcMaBYQvWFb8xT0V3mAzWWzqVEOop2K?= =?us-ascii?Q?RGhRvQjyONEBR+udeeUbnJ6bSLcFdELwCUT0ZaoRVmvyybkEyEFSuZvIlBbR?= =?us-ascii?Q?coSQHPuqbhgSRvBkw/CFsPDisfSaC7TLUYuwA1YjyQZXK25bkCaYecZ0AFw7?= =?us-ascii?Q?LI0jcjdXm66rgimfYLA5XiDWy9obeAQoPfljgdVMCu3bIKK/Ha83sK1H5yoI?= =?us-ascii?Q?3fVNVNRHTYEquMZRs0vpVZZJnrz4RKoQNWcW07QshCRO3+m4HCMXanti0ihC?= =?us-ascii?Q?msmdlZ93bO2/ciILA1Eg6F87FiDk+v3WmL0N0U+NjHZitEzmB1wKeVavM1qG?= =?us-ascii?Q?OGcY6ndt1GSAQgwWzG6q0R/poY4tyApIGSUYaavr5zjJQv30SHgaG+6nKA6s?= =?us-ascii?Q?UfCV+nyaIqeiuwT/kn0wrzCvYeX+YFINCFilFzSVeK22QijYV0PBugPmw2nD?= =?us-ascii?Q?J4etLDb+5Q+TroR/HAL8gYPbiuIj2Mi2eW3W6IBN2UUeCcfB6Y9P3ncNyv1q?= =?us-ascii?Q?bS4DVdf8CxqwUTO6Gbakt6Gvt09/Cs+aKvqG6tGb8/Jogz97WCbi4ghfYBnl?= =?us-ascii?Q?8VP6/1+FZNqWRNjAq+JwFsnNAGZGR2RmgiYkv56RsMLL74fTi7W1Fz7p5pVz?= =?us-ascii?Q?Z+RA2ysmbn8I2vp9D89RUH8GPN//EeUO9vo+EGsXFisslg3KtSBhVJKb+Fh7?= =?us-ascii?Q?VjRkdMFwDb5E+a82NT4mPSQZzJDLbTg9CutKUFq2xBU7zxGILxEjbax7oIyK?= =?us-ascii?Q?WsrlvOUDxSwTRQpyv3L/dRGEr/S/f0pp+yoSmVf4FfUleYu4bPg7NzyP3HJz?= =?us-ascii?Q?32p2nMBeOwL8rv7kIpZb200FqUAuNSxWyObyTaVe7Wz+dsTRevAr3K6PPD2c?= =?us-ascii?Q?sIDfBacPBALNAAbYzVPs1aV1IutYCly9hLfpJr/iH5+xZUqcu5nKdkuOQMc2?= =?us-ascii?Q?w=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0842; 5:pZvD/V+KdWRDiom+Bc/mEg3gIp+9cUazbaUP5EqDNbpXFhJmKERxd/F6wHRMV0VXH85uMWQArdn1FvDblZzugAJePl0lOs3JBsz5RXKE0RMt36xQh1EKWkP8oh6oHu3pFaBBrtNlq4yBaoyzzrnK4BfxvIH/abugU7sT/mWGnMl8jctVL+lXb4Zp1l34J5qVGkwAs+uazlJfnHz21JM3JNrMrONjEN2T1QnpAlfjD46kVBFbSqkZoj7S1czphki7QAeBoCKWrd0Zy35is+Sp9WzmI8/yLOCKzfLW/CXx9yoowHfQr8Z8GCK5FsIuf6qHzRAIegjw1XOGiKfSDIB667TAooLY8EkCuXoS+TGzTIUcWQIWmEJTdhDLT9dGdaf2GiWgSZy7OfnO8G0PXWoBDPGIe1oY1C5isNqtk5x0b1kNjPoUWjUR/J2VKes4BIR7xJeNaBQJniZeEnhNzno7e8Ig1m40DVORKmnx8HAXcoBAmqi80PxVxS/BP75WoO/d; 24:fA/Hc04w2zcWBZ/3c1KvjFSAajavNJY9kfUKtL0nGMSJ9xLyQ5QrjVB4f0/xEvCqsjlWgdyGZ7hH6aqEHRhJs0yhmlRkFYwbad/TDl4goTQ= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0842; 7:HPtWbcj9ws7ZYLe1ucb14eJa0AtNHIW1IGbUg4iAW5k+5yRskgckRAA6poamrYiOnofeYExOWm7Kc2xNKmi++GGkmy2PHpH6CgVeNVKK0Y6tNMAyhYiITZWOtFNPVNkSkIp2pGMxixX6pPvZsbC6dkFyPeQwLHtyFmDWAD0RQ9OQRa2E+PnKpjg9kgpBXh467j7hYJ+56iwDZcdvqFhDXZ77lH7GDp6Hi4oy4/ryoxzvjggp6Xv01w6KoAac+9bQIGqIY9VbUJ2OwwaxrMHClpge4kwxIMyjBBMCBYK4t716XmHYC5SoXdxHcnRJTVmXQtKmToNrD112a2ZkDgPIeZ1K3eVuS7ARy14y2DqZn6uw/UCyjCo67MrdX9jkyaRE+pCZzaILbW5XIsdenG+V5+ZiYwshSfqbNJQz4voyliCrFTlp7/nCIYF7Z4nHlyZHliBCArlyqKV2oSzICqy+zq/B5U5CtgOEN81Qel9gL+K+3tKjWEdYZmxkI2oRYPXIUL4ud2Nk4C7pgGw4b6wTg89y+eCM+kMpdXMliQGsZuoSaq5MWM8tA2WsCo0sZ6oZR5d/BbviFtLF1F0cyqsVsfxp5jK2D2z9aEs0jk6MyCW6kfu9OVpVwh+q2Ts3hDITzfoDGm0x38H3b8Who6f+3kLXWd/cI2hA75FOVWdQKBgoNqGZEBhkKvk2g2zWUz851P7afGB9+KpuGmefw6evaYsL5tk9itpteZf4wIzKW+oqoKglEF9ZNToVkl7GDbKc8iYNl0gWvUN+HuXYyvIxNIvEgUAJM6GeBZRvaByOrOg= X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0842; 20:XyWRTmNhGBzMG9wD5p1DYDOGTPQ9O+M/dctLwV5/kJz7O8raddCWVF13atrjywFZtUyXhISb7ntvN1lwd/5H34e0Znhz0eDGha90grlp24trySU1VUTcZU40ElP/HVRvi1FTKAMJhup08MncCiC1WKlzYydTzjcdvT1I5nD4B0M= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2017 16:26:35.0678 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR08MB0842 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.3.102 Subject: [Qemu-devel] [PATCH v2 20/23] hyperv: process POST_MESSAGE hypercall 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: "Denis V . Lunev" , Evgeny Yakovlev , Igor Mammedov Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Add handling of POST_MESSAGE hypercall. For that, add an interface to regsiter a handler for the messages arrived from the guest on a particular connection id (IOW set up a message connection in Hyper-V speak). Signed-off-by: Roman Kagan --- v1 -> v2: - use single mutex for evt and msg handler lists target/i386/hyperv.h | 5 +++ target/i386/hyperv.c | 87 ++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 92 insertions(+) diff --git a/target/i386/hyperv.h b/target/i386/hyperv.h index 46c6836..f101144 100644 --- a/target/i386/hyperv.h +++ b/target/i386/hyperv.h @@ -43,6 +43,11 @@ int hyperv_post_msg(HvSintRoute *sint_route, struct hyperv_message *msg); int hyperv_set_evt_flag(HvSintRoute *sint_route, unsigned evtno); +struct hyperv_post_message_input; +typedef uint64_t (*HvMsgHandler)(const struct hyperv_post_message_input *msg, + void *data); +int hyperv_set_msg_handler(uint32_t conn_id, HvMsgHandler handler, void *data); + int hyperv_set_evt_notifier(uint32_t conn_id, EventNotifier *notifier); #endif diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index 8abb418..f779977 100644 --- a/target/i386/hyperv.c +++ b/target/i386/hyperv.c @@ -246,6 +246,14 @@ static void async_synic_update(CPUState *cs, run_on_cpu_data data) qemu_mutex_unlock_iothread(); } +typedef struct MsgHandler { + struct rcu_head rcu; + QLIST_ENTRY(MsgHandler) le; + uint32_t conn_id; + HvMsgHandler handler; + void *data; +} MsgHandler; + typedef struct EvtHandler { struct rcu_head rcu; QLIST_ENTRY(EvtHandler) le; @@ -253,15 +261,51 @@ typedef struct EvtHandler { EventNotifier *notifier; } EvtHandler; +static QLIST_HEAD(, MsgHandler) msg_handlers; static QLIST_HEAD(, EvtHandler) evt_handlers; static QemuMutex handlers_mutex; static void __attribute__((constructor)) hv_init(void) { + QLIST_INIT(&msg_handlers); QLIST_INIT(&evt_handlers); qemu_mutex_init(&handlers_mutex); } +int hyperv_set_msg_handler(uint32_t conn_id, HvMsgHandler handler, void *data) +{ + int ret; + MsgHandler *mh; + + qemu_mutex_lock(&handlers_mutex); + QLIST_FOREACH(mh, &msg_handlers, le) { + if (mh->conn_id == conn_id) { + if (handler) { + ret = -EEXIST; + } else { + QLIST_REMOVE_RCU(mh, le); + g_free_rcu(mh, rcu); + ret = 0; + } + goto unlock; + } + } + + if (handler) { + mh = g_new(MsgHandler, 1); + mh->conn_id = conn_id; + mh->handler = handler; + mh->data = data; + QLIST_INSERT_HEAD_RCU(&msg_handlers, mh, le); + ret = 0; + } else { + ret = -ENOENT; + } +unlock: + qemu_mutex_unlock(&handlers_mutex); + return ret; +} + int hyperv_set_evt_notifier(uint32_t conn_id, EventNotifier *notifier) { int ret; @@ -295,6 +339,46 @@ unlock: return ret; } +static uint64_t hvcall_post_message(uint64_t param, bool fast) +{ + uint64_t ret; + hwaddr len; + struct hyperv_post_message_input *msg; + MsgHandler *mh; + + if (fast) { + return HV_STATUS_INVALID_HYPERCALL_CODE; + } + if (param & (__alignof__(*msg) - 1)) { + return HV_STATUS_INVALID_ALIGNMENT; + } + + len = sizeof(*msg); + msg = cpu_physical_memory_map(param, &len, 0); + if (len < sizeof(*msg)) { + ret = HV_STATUS_INSUFFICIENT_MEMORY; + goto unmap; + } + if (msg->payload_size > sizeof(msg->payload)) { + ret = HV_STATUS_INVALID_HYPERCALL_INPUT; + goto unmap; + } + + ret = HV_STATUS_INVALID_CONNECTION_ID; + rcu_read_lock(); + QLIST_FOREACH_RCU(mh, &msg_handlers, le) { + if (mh->conn_id == (msg->connection_id & HV_CONNECTION_ID_MASK)) { + ret = mh->handler(msg, mh->data); + break; + } + } + rcu_read_unlock(); + +unmap: + cpu_physical_memory_unmap(msg, len, 0, 0); + return ret; +} + static uint64_t sigevent_params(hwaddr addr, uint32_t *conn_id) { uint64_t ret; @@ -383,6 +467,9 @@ int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit) uint64_t param = exit->u.hcall.params[0]; switch (code) { + case HV_POST_MESSAGE: + exit->u.hcall.result = hvcall_post_message(param, fast); + break; case HV_SIGNAL_EVENT: exit->u.hcall.result = hvcall_signal_event(param, fast); break;