From patchwork Wed Jun 21 16:24:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 9802273 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 4A10460329 for ; Wed, 21 Jun 2017 16:36:20 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3AC82205F8 for ; Wed, 21 Jun 2017 16:36:20 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 2E3CB28501; Wed, 21 Jun 2017 16:36:20 +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 02FB3205F8 for ; Wed, 21 Jun 2017 16:36:18 +0000 (UTC) Received: from localhost ([::1]:55075 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNic5-0007CM-Q9 for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Jun 2017 12:36:17 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35459) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNiSl-0007f6-AQ for qemu-devel@nongnu.org; Wed, 21 Jun 2017 12:26:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNiSi-0004mU-L3 for qemu-devel@nongnu.org; Wed, 21 Jun 2017 12:26:39 -0400 Received: from mail-eopbgr30105.outbound.protection.outlook.com ([40.107.3.105]:22688 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 1dNiSi-0004lT-5Z for qemu-devel@nongnu.org; Wed, 21 Jun 2017 12:26:36 -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=wvb0J6EwxsuRKupKX7OL7YwDcQ5RmwEISgd7uVPRqdg=; b=ei0mYGcn49Ni2Ki8PREvykOUXMhDSzwcEx9zUrtksPtvi6j5CNrRxpTN9QjOASsfOn0hPY+FHFCaV4kxtP1E7x6471S0SjfB0gEADpmUg/UiR6Nqg3Xdu7BpU3X+O69zjkjIrSlcySZVCxEPyG8em/iBpNjNCzcqD6I2s28ujCo= 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:29 +0000 From: Roman Kagan To: qemu-devel@nongnu.org, Paolo Bonzini , Eduardo Habkost Date: Wed, 21 Jun 2017 19:24:20 +0300 Message-Id: <20170621162424.10462-20-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: 6445664b-b06d-4a59-cc44-08d4b8c2482d X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:HE1PR08MB0842; X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0842; 3:g1Vm23J05gAhISee/lmLz69At0WECNJqQzaPXNORdALnOgm2ai24g9hfY0IP6Omxeeg13WefY9I4sRQ1SPh8XmwmOQJ5ouYGVUrz3xi/OBXWuunXx4FIogzlAnAbX2ySowtgnwq3U3Ip4hJY5h4xncBueGvT+G4m4Jg21gvYeNeLet+NA2D+gDHhFD9ohIFbNIJzwW1rMOpHCMJeFH+gtP2o4CvAecvrVQDH9LR36kV4LNbKf0YldAQp1vjF0lGbqQzbNlOaIWboRpWtyTFcNAq5Pbq7ly9Wv7C9Sd/eWYcOfjgq9hckNrLJHw7fRspSQnrwaB6NKS7o4q5GyHI7Ew==; 25:xU9Dwc0hSa+9EmqEPXPeenwV+/LNPXRspAnHGDsfx8T4O8si6/aWlZiux78D2rmwqogHwgLg77wfn5VKv0rOhofFwpkvyahm8Byf9Y3FAjXdqxp7RlMxBs4jjJrnqX0YW3kAfhbb+i5oD7dKdaF9RzpYZMywMb8X8UdolYNbZq9PuGCkJFfCD1+BWNBECFAuQZ5j2gKzIMilooBpVORLJYWtFpm1Q/eV+AJGVr/sJPFwMEtVGFmPlxcZPBVHFprEv6Cvz7e8GuaFHiMSOKbiMbbC4RgRiu0ZzUPnmchK66kgY+NZT2ZgmXksTbeOrgFPzxbyECvzmhmeVSmJgvL1U15vYSOAwowsfkAQTeMJ2AG24mq2R03wjZo4ovza5ptFQAXbdYuNfHSFAk+9805TlJmQXvWih0fg08roA29G9Y/HtYpdHbcpxhEfRxehO1qEidbIwBlvSOhX9C5b8jcMXBVZC76v1uNV40dJVFcTrrc= X-MS-TrafficTypeDiagnostic: HE1PR08MB0842: X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0842; 31:3YRveuRqJZM4ZE/KK8d3xmntsJPE2GIiEGsRnEao+7GQn2IO+f/SzT+7EWMDLXKZ2VlwOvIBqkbq6myi3JdngzwJDQDcE6YsSjN+LZEQ6jr9YKRRMc83bX8urfNbceZC+8bvoZXfPMWsMBGri/l23FnXiUoMWI+gBEw3n4KCts481H6xeK3PkqCh5u72dQyEihlaqd6H0pGm+DvGl42qtE5RhJluTbo+l2LHWSX5pXk=; 20:AE4L0hpqE02LEbYGSr8ZbZtKTXolIE7yN/lNYmwcaz4yM9LWdagnZ48gebiPy/CXA7vSTIL1quPGIfBh30etMXoDiWWGffSltzFeuEybbPTfHHRspLvZgwc21SU9mMj3eul1Es5oB4+azwLLIPSfMesL9bgBy+h6lHzsOEyeqw38A0MVRqSD0C1ZSJqKdQm6QwwxFe3sj07g0HAOW3HUhNYpjU+mjcjjQ7o0NPqre4VMPwq6q9gXYYuP16HOl07/hjsldTaa8X4T7cKasj0lptC75/RpaU8sTXUqb5+DUPX4UpnCj7jxhW3msgYCN88OSBrA/faAvp8yFZB5k+MgsCbYEoSCXFgWmopFkMwsuXKaYeJCjwUIYPEfRAfkhlbQBC7g3nrhJWKAQSxlOwIm+kndh+VGLOAIIdjjr3SJHZU= 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:EKMhFx2njqEr0haHxsS/e6U/Cl8ln0fW3Dlw5upUhh?= =?us-ascii?Q?/5j2hj9zbnkp5AhftkMsQRFj7OLt0Yf9k91Mc/SDGvcjBA+nEbmiUgbUa5Cj?= =?us-ascii?Q?6Mg7yRkY6VLeX9aw+9X4rzzlgFvzxFgKhwzkRn1ZwQoVVrQAT7rGbnvCa0K6?= =?us-ascii?Q?xOwCezElYLrDCd77bX1wf7f+j22XTRCv+Dmuk9hXh7iFGeUTt82d3+1PBTcj?= =?us-ascii?Q?tbY+Y0bkkRjE3D704dDLh9VJlNhiSTx3TQLWiOVgQ5Dvo34dPXwA5geHxlGa?= =?us-ascii?Q?cmWr97BiK6s6z++d4EETUUWwAN3zOdPJ0UqKaNtwOlbSWNyt/b0tNlXQIwDZ?= =?us-ascii?Q?VfwTWjpO31hZ7bR5giQo8Uxg30stI3KPHDsYVvkbFi9TEbscdnkKgr0jEs/8?= =?us-ascii?Q?kYsWoVZSnsroDt7tLOsu9EP8H0XPYNKf/QPw2gzWztkHqeFM0EAX+62PB56Y?= =?us-ascii?Q?UqUZwQLYG6fPLwm0cwXCcdhjV8cmLIu41f95/5fS9IzGojzolZdn/BzMj9B0?= =?us-ascii?Q?4bXAnkLsplPQ3fLi/Fz4qFwBRRTRb5dEMlibQC/CEj46VUg+qdSOZqrHBzQk?= =?us-ascii?Q?nVfQyKkUQyNt8JumcUiDPIifTBDZ9tbEDsIzj+obDUenUG9RD1gvb3Q1ErZs?= =?us-ascii?Q?LMVjdYzPrO/Bl1QUs0en8SPnBIt17c9+86sufZwnF+aAUjqTp1JobZpiwtqg?= =?us-ascii?Q?OJOZmqDid2ecMQ0+7c8caQOo61vDI3fhBaToTRIzV8FnlYKRn/yvxvJtjBTu?= =?us-ascii?Q?gvZ7l8jFFf3qzFazsaWSsq6U5JD+uxoB2qV+i8kRMotPU6lmpJ7UtyXt01iK?= =?us-ascii?Q?Ge8GUR90Xrx//Vw909wrfKLTod1a74Lu0/x6Nmu0cI1ucJeCwX6jGO/eFZia?= =?us-ascii?Q?3U5uJn3UtJWt/r8bWqt2EELLlRN5eHSEZeGHe+egwmsk3LA9wPNp7v4qDHUU?= =?us-ascii?Q?w9JN9d6gJYL1gh/d4RHPVpITx7xXEV4jMIxXmh8YaoAsUwlsgobN87MzDdJ+?= =?us-ascii?Q?QYSzzI7QFKxD9NpYGyQWdgokVS0xuNfBi9t5xXhunhDMDr2wMp2nPRMEaCFu?= =?us-ascii?Q?Rj39OXaSq+ML2HLA83kOEnxVfdAfHTfSFjcppUpjYwDsiuJr+6347324Ct02?= =?us-ascii?Q?6S8lRL4daY7V97xkTF93tO+CgoDpuA?= 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:lTku5PCsp+XbwCctigClGRL9tlspT2LRlCY7k3qBb?= =?us-ascii?Q?HF+qxhmn2C0XI+pt4STL0luZKnPtAEdkJ+XIrceLS9wiHbbxTWPvcXJL0k2g?= =?us-ascii?Q?17w8v9+A8Ao1htzdQ8Yv8dUwtRkBpyr23A5lNL4aO29sAekvkH29pmtJyYbm?= =?us-ascii?Q?OXfmoJVB689TwNyVXDfKQnMlkaLXqeTFw1lO9A9B7U7e5bc3GO53vJVysDEz?= =?us-ascii?Q?czdXACu5c/M9BtnbgN21eMEK0kjDoOc6emW+C44U+g8AE3l3+kb8CRorRXG+?= =?us-ascii?Q?VUtMtnIEhz2YobYDfq3m8Bi11Oo6BkMKWNctGXG5NIHqj97OXLuxmuHZoIeM?= =?us-ascii?Q?bhG6eSHas7VST/QDolSn1/IBrkQfHBFCf8Oh6zAeZ6ZK2MHLfhWJAB8+xSh9?= =?us-ascii?Q?n8A2OgeRbz+gC6zcRGRjtsSgLVGFhEVSNte6XwL4wIrwcUbvFSFtXxR+wy2Y?= =?us-ascii?Q?PvHMnAGgc+K6ouOYcsu+X4uxauFcV1dDWLAxuIycVzezFtDMSmzVenTR6rbX?= =?us-ascii?Q?KxNDJAAgeYLsMxdmdxLo+HqxbJpvtVLRNlO59vJvDM+xmn01x4fi7MHzwzNy?= =?us-ascii?Q?yvOn6nB/DnrDwTUTKGTC+7gYr0hY6PFfR+JvDCoBff4H89bZOvIsYvYk+WFZ?= =?us-ascii?Q?sAErkNEjjA4c7oDZfRMqIIQAHbiP/F2FtAtQCY8+tmwHTNqnWtpQRF293muv?= =?us-ascii?Q?2LHbC5/jEu/SiL9lSos0cxZaTi1M2IJzNZt5msovcd6I1DE8op3pfmzViBUG?= =?us-ascii?Q?pck+QjKbetb0/ztHLeSpBLqT1objTmXhQju5/6VT79IbI4mXF3+RanjqsHV7?= =?us-ascii?Q?/X4o2J20LYJC/TjRji+Yplla8z3LRUtiOXQuermQov2SagaFI7Fuy+6lpo7z?= =?us-ascii?Q?lcR4d1gZlS6Y8cFQBMnhj0nXeaSVws1BkoAEfAoj35v8LAFpPY0DIdnjydvw?= =?us-ascii?Q?6tLVyEKKVbRfFF42l23A55TJQaBrsm62+hkEsR9ZAIdfuVkscUQrPXUUq6KQ?= =?us-ascii?Q?no=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR08MB0842; 6:QtAuGMNyCo9LLBOY0AITwwaymSsG9HE4wU87DsRM/0?= =?us-ascii?Q?dcSdha6GSDoEDdg9ZNTT8xPlTMExVG6o2jjkCkbsAg1uVv3aolAcZBzmbMGi?= =?us-ascii?Q?PsM1LPuWDr8d+JXjEszpMP+F6geULffDBXKOTXsY4exNtDFSuLTsa4KN10GV?= =?us-ascii?Q?4bNQX0h/3CV24zi9+afymqXmxPek3LLt8kyWjp4LcsPA2FncnFv8drh6Q5Ta?= =?us-ascii?Q?Es5rdiKmHPmjm6bG4oF+3qp0v31nps/Tfkxp/GiuXCxMr2sWBwHMsX+/ZoVb?= =?us-ascii?Q?S71j7cOnS696AAJsXkVbvAifXML0J3CG9rufjjAu1jRWP50qpfqHzXX3Hhsw?= =?us-ascii?Q?OwKPjP39XDiIS5W3kegXQdxoapGwdfHUw5oDGsLtpDwa7U2BVyfYTrWCHYFz?= =?us-ascii?Q?+n4k2mqgysCuV0TmAeWkMs30GX9DKNEldFOoUXYlhuLU6t7qMXt21zpUaaUM?= =?us-ascii?Q?lljnflaWxgxhsMBraNJze5ETYo59Vd1FmLzSMRPD2f2T+aBPmLYdMtltMXnQ?= =?us-ascii?Q?92te442/M2By2mxdoa8TeEdXCnEezFfTKPTt09vBW0KsqFg20QRFsk0u7ZQJ?= =?us-ascii?Q?v8noV82G0jHpzCf2wKOjCxbpyPcJyKY6JqqVtuCqZlVDUFrknbhJpz9Ml1G0?= =?us-ascii?Q?9eNp660cE2cnbV8p13PS9rPaLrDr8128WZjSgaa20EhtVVh+4+dvaAlGVO2s?= =?us-ascii?Q?adHwztvQtTN23foNA0+zqaqRT6hitg/gz48+wcuDSVnbRQNgNI6+LRu9TpnS?= =?us-ascii?Q?a+oKhgjee3j5epaiOSCofRaQX/Rdqeiuecg6nHphTIbLrEmKHZt6tBhxnZYn?= =?us-ascii?Q?bR/lcteXmH4kr++IlYHIkLOssSaGNMKWSg3UH6eH41sDv9rq3NIw8LHMicqF?= =?us-ascii?Q?FcprNoRUdeSfnJlbb+5pzWQxHRoBynx+9TF2G5vpFKhWzs0r7fIM+vpZuPbL?= =?us-ascii?Q?lUEkiA8sapono2pwAWzBRGqYxLZ09BB1RQpTDV3prxVf4dhYjBw83qNy2bZi?= =?us-ascii?Q?I=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0842; 5:tlpTXXAM8WKa3/PEslBr05iZ4IJobDAF9kx46xRP5+7FzykQ+qe9iN1AyJrYOx8UCM/jF7hK8AzhGAuRc1JEaiAqtbD84vztrgAJ5sxrytAVR0dcwtSQfwLAEfd+W74fmh3tTL0C3PzS6S+tg9Iewy9o9GdI/ZdELRGQGAKNeoi9IQDmYWCAxqGhDjHpYHIRpDhPFdb2rRHhyWaBXgABn+9Dtn+Tg15AN5Kp3hSAOYDcuD4ttZNnnZ6CGb9CDciI+QVIxTy/0MCmbA0f+X6pOXQlE1LzvUcTSpI4ZzC0DHE2qjbNRlVSKpTTCTpzDCop8K2R9n54fzM/aWAFTrSkJmXdpg9Zk06uMGU1y2QNnlqZ4Pxshl5ci0W4ZwZ6orrwGW965q3+SS6UWF4slGJNklL887h/IFVugTisGfsnYyji7Py2SBIZO3HbtAQJufELk2/OMGI0FD/H1l8SaL725yIsCa5fLHoOLiRNlmf69VoyRx3IfNpm46FwkUD5DhHo; 24:tG4uy20j7DswEGjXApVTI0jjviuNqWdz9xzSJ9NsF3pblb+3d4ogMUz7Rcf9QOJ4f/kZCfUZ2Gu5DrEGUSW9ZDwQtyE40WMKhqrc9wRalAI= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0842; 7:S7riIn/WbGc9xjnqWwHtvL+aIZ0BkS7tYoaE+YDUkpQ9QC7nkFkGpbVSp3vzAl3tVT+tV3QWs7WZvMQc2Lg6MRoN4T6Vc3NO71gzZVHBl3vj/g7Ywfx9tlzHx5DDr4OvZaQOVyyXx8YL4srN9R6T3thUtbDWwaBSM0xQUDd5nh8Svf8T6ukn/qtF2uqxH+v0xoAPa84AT/AQTUDk3hxbxnY6uInubTvjLAIU9Dq8ED6CEX9oJEOen8Avjh80GeYCKn75F/c0nlnV984oZptRPUZxUQv0X2R2313UWvKiuMuXFS3j/aWcHqdg2GzyyRF9zn/XBLA4lhz5BMkA0PsZIgBi3i9Gv1UM3OSZa72v1e0JZQ1hcE5sH80hNV3Lj/xLqr931SxDHZMx6iUADR6wOqoFFX5cQ/YXm+2OwlvQiopBDADpY3AzBcdjyutjZhmm/wQDrQg8Qtvj5BVkd4qDTy0cVy6C2ptVv8fMpG1zrTiX91W1dVpP5VBqpS15TSZ9VkJMeOW8/RYXpNBbhnUs0IupyCWwJ5ymJ7TopJw8BK9hnP0JA+5GaTgmZGpAJMh+Je18oMXApdrABkLSMu2GrJE1gGVQRO7bx2oYLH7N5aLp5AW8i/1S+JPJe5N5n9FiyNc5mPZR/PBv2eJgF+mMENrBwAnLIOhegRwnhsE01lFzNOeXkVnoT1zJCKW1g2yDTIAtz9tfOOAtDWrXCO8vuzRVFM7lfhBdDTpgNJ+n97Ylv979TV5rCvp0DZd4RzPiANNJ/lqLyHPTLUBQZ8HFbXTFgJbq+Lh0+iABY1eids8= X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0842; 20:Jnfrkfm/d7SrXESQuAvZo0oiMrZQjD+rh3kWViq523ToEQQsDC6ozG2a79/4zeH31MjIGPoEz9WxmZH6F0aoWOlzFMoS+PDc02XEvtYHSaj18m+fqc1qQ8GQBvdBIOXLVqQjpwaSOOgFE5kMUwk+Yp/E5aHlInQnmGI4TAJy4/w= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2017 16:26:29.5989 (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.105 Subject: [Qemu-devel] [PATCH v2 19/23] hyperv: process SIGNAL_EVENT 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 SIGNAL_EVENT hypercall. For that, provide an interface to associate an EventNotifier with an event connection number, so that it's signaled when the SIGNAL_EVENT hypercall with the matching parameters is called by the guest. TODO: we should be able to move this to KVM and avoid expensive user exit just to look up an eventfd by connection number and signal it. Signed-off-by: Roman Kagan --- v1 -> v2: - use single mutex for evt and msg handler lists target/i386/hyperv.h | 2 + target/i386/hyperv.c | 113 +++++++++++++++++++++++++++++++++++++++++++++++++-- 2 files changed, 111 insertions(+), 4 deletions(-) diff --git a/target/i386/hyperv.h b/target/i386/hyperv.h index f171f7b..46c6836 100644 --- a/target/i386/hyperv.h +++ b/target/i386/hyperv.h @@ -43,4 +43,6 @@ int hyperv_post_msg(HvSintRoute *sint_route, struct hyperv_message *msg); int hyperv_set_evt_flag(HvSintRoute *sint_route, unsigned evtno); +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 a96b03b..8abb418 100644 --- a/target/i386/hyperv.c +++ b/target/i386/hyperv.c @@ -18,6 +18,9 @@ #include "exec/address-spaces.h" #include "sysemu/cpus.h" #include "qemu/bitops.h" +#include "qemu/queue.h" +#include "qemu/rcu.h" +#include "qemu/rcu_queue.h" #include "migration/vmstate.h" #include "hyperv.h" #include "hyperv_proto.h" @@ -243,6 +246,106 @@ static void async_synic_update(CPUState *cs, run_on_cpu_data data) qemu_mutex_unlock_iothread(); } +typedef struct EvtHandler { + struct rcu_head rcu; + QLIST_ENTRY(EvtHandler) le; + uint32_t conn_id; + EventNotifier *notifier; +} EvtHandler; + +static QLIST_HEAD(, EvtHandler) evt_handlers; +static QemuMutex handlers_mutex; + +static void __attribute__((constructor)) hv_init(void) +{ + QLIST_INIT(&evt_handlers); + qemu_mutex_init(&handlers_mutex); +} + +int hyperv_set_evt_notifier(uint32_t conn_id, EventNotifier *notifier) +{ + int ret; + EvtHandler *eh; + + qemu_mutex_lock(&handlers_mutex); + QLIST_FOREACH(eh, &evt_handlers, le) { + if (eh->conn_id == conn_id) { + if (notifier) { + ret = -EEXIST; + } else { + QLIST_REMOVE_RCU(eh, le); + g_free_rcu(eh, rcu); + ret = 0; + } + goto unlock; + } + } + + if (notifier) { + eh = g_new(EvtHandler, 1); + eh->conn_id = conn_id; + eh->notifier = notifier; + QLIST_INSERT_HEAD_RCU(&evt_handlers, eh, le); + ret = 0; + } else { + ret = -ENOENT; + } +unlock: + qemu_mutex_unlock(&handlers_mutex); + return ret; +} + +static uint64_t sigevent_params(hwaddr addr, uint32_t *conn_id) +{ + uint64_t ret; + hwaddr len; + struct hyperv_signal_event_input *msg; + + if (addr & (__alignof__(*msg) - 1)) { + return HV_STATUS_INVALID_ALIGNMENT; + } + + len = sizeof(*msg); + msg = cpu_physical_memory_map(addr, &len, 0); + if (len < sizeof(*msg)) { + ret = HV_STATUS_INSUFFICIENT_MEMORY; + } else { + *conn_id = (msg->connection_id & HV_CONNECTION_ID_MASK) + + msg->flag_number; + ret = 0; + } + cpu_physical_memory_unmap(msg, len, 0, 0); + return ret; +} + +static uint64_t hvcall_signal_event(uint64_t param, bool fast) +{ + uint64_t ret; + uint32_t conn_id; + EvtHandler *eh; + + if (likely(fast)) { + conn_id = (param & 0xffffffff) + ((param >> 32) & 0xffff); + } else { + ret = sigevent_params(param, &conn_id); + if (ret) { + return ret; + } + } + + ret = HV_STATUS_INVALID_CONNECTION_ID; + rcu_read_lock(); + QLIST_FOREACH_RCU(eh, &evt_handlers, le) { + if (eh->conn_id == conn_id) { + event_notifier_set(eh->notifier); + ret = 0; + break; + } + } + rcu_read_unlock(); + return ret; +} + int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit) { CPUX86State *env = &cpu->env; @@ -275,16 +378,18 @@ int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit) RUN_ON_CPU_HOST_PTR(get_synic(cpu))); return 0; case KVM_EXIT_HYPERV_HCALL: { - uint16_t code; + uint16_t code = exit->u.hcall.input & 0xffff; + bool fast = exit->u.hcall.input & HV_HYPERCALL_FAST; + uint64_t param = exit->u.hcall.params[0]; - code = exit->u.hcall.input & 0xffff; switch (code) { - case HV_POST_MESSAGE: case HV_SIGNAL_EVENT: + exit->u.hcall.result = hvcall_signal_event(param, fast); + break; default: exit->u.hcall.result = HV_STATUS_INVALID_HYPERCALL_CODE; - return 0; } + return 0; } default: return -1;