From patchwork Tue Jun 6 18:19:35 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 9769595 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 1E60B60364 for ; Tue, 6 Jun 2017 18:32:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 17AE4283BE for ; Tue, 6 Jun 2017 18:32:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0C30228415; Tue, 6 Jun 2017 18:32:33 +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 4AAA6283BE for ; Tue, 6 Jun 2017 18:32:32 +0000 (UTC) Received: from localhost ([::1]:39674 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIJHL-0007sK-C7 for patchwork-qemu-devel@patchwork.kernel.org; Tue, 06 Jun 2017 14:32:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47453) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dIJ5P-0005pP-81 for qemu-devel@nongnu.org; Tue, 06 Jun 2017 14:20:13 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dIJ5K-0007I7-Qf for qemu-devel@nongnu.org; Tue, 06 Jun 2017 14:20:11 -0400 Received: from mail-eopbgr30097.outbound.protection.outlook.com ([40.107.3.97]:4272 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 1dIJ5K-0007HV-J1 for qemu-devel@nongnu.org; Tue, 06 Jun 2017 14:20:06 -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=q2CvcEfzCJJGpYTbbVTq7X79KJCkgq8pnD7Is1IALu0=; b=NV8X4S3RAu+AJYNEtAt/1jvY40nw3at+4MJk2u1RgEf9OCUM8abphbPnFklN07p37+J3zSYIQ0nwRjqXGuXrqcfl5cgQyHJ4DF/2bh/Pe1kyutfZcKk7STiVGHghpMhqNUjOfJh5ZD1/Sd7Ol0XN3M2+CKN4SZ8yhCo5rvxqTeI= 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:03 +0000 From: Roman Kagan To: qemu-devel@nongnu.org Date: Tue, 6 Jun 2017 21:19:35 +0300 Message-Id: <20170606181948.16238-11-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: 0eecddbb-edb8-4b93-d8f8-08d4ad08a7a0 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:VI1PR08MB0847; X-Microsoft-Exchange-Diagnostics: 1; VI1PR08MB0847; 3:5XKpoCL+pwc7UJ7MVGemrazfdKVdSz+A/xoRyVb2jXfl0h8GG1CqmAIRR3p+3DDZwGGfJbRHhlbog0t7dIf0hMBZeGJVca40dwit5UjDP5pY6sOmDdbQv2XHqlvmwBn0nnTWGpG1R8QhqmiDUsvQN8wLh8oXARvzbrEZSIfwkwSZWvY9WpbiCO7NvoAFh5RJHEYpYDN50HvRS2XYmB++LAo7wP4uGTII3swPDKzDrOX8AZAlJ5BhU84O4+fQfjMvPZIU8Qlv3gFgNveSmcD+cKyxyDDJkb8BHWkDcQ83yUZhn6/EcNeQYPk7Ptt4bWQmjyeUZSdSSQ9whk4dWb6bsQ==; 25://DH+d0ablAzWaUw4Ttr451yvUagJH992BRhd6VRWsZqR9UpHyjO7Jj1uzjU703A9pndVt5ou02QwWFDquno1hUFMznWU/DZODVPAQTPdOQ/HAhyBWzYbYsphf6gKvCotdLYb0V93DLBsc2Ul8hZ+JaQPBIIbFOPMnqCB0rz6TdOliWh40Ef5gPrx5hv2D2QPKM33Mo0Sa51Sj8s6m1La+3vZs67CDixmSQfVRfU3EECxHoQRPfv4GjHp3aSArvAam+BsazB/lYF9F8N/td74qzt2E5ut0Nc7WR7VAx1jVtLT9kciZzGcO+w0TuVJuwCbMad6TagYcvPKeF1eULOkYRYtkVlHx+1j8VpaNMeTSvJuWq/gxmOGuktQSHzX9TEfMFRuL6fPNT7OLAGUVoPYOTauHy4OWHRxnUuDSe+GHkIVTRp3Or1Qark4rplwjjPf80OUVxCaDPXC1q52slinVpW+VEt257EG8sxwuxFvcY= X-Microsoft-Exchange-Diagnostics: 1; VI1PR08MB0847; 31:RYqtXFT6JZKRnZpRxS0it376kFCCehJm3uMg15D6LyFnsv8aoma0hugA0f3vZuP4JAoeAIU61/yrZkQeEzvG+qVng1vfzaGZ3j/S5yBGDF5R1pcQzhUwnxyXfTLPD5t58BNqdWKmz3zRYUkWc98svZDaN1t2V8NisQtfe6qV/z7ix6RUCJItplkvYu9W5aloYxMxtchGZ4Zfr0iqNw9o1YU7n1pBDmvRA5GEvef/L+o=; 20:f081NVOo3WPH3wNE2VZwfF880TBUBc/AqFolqGRex44FPeCkKVlN+ePZvf/I3jflZDRyJKpHD//WXuf91PkwrFx4yFME1bPCi4MoRZxPC8BGq/qR3l7io4SWBTxgqGfLxbkaIXyHc7GsQNy1ilGd5nMH+L0jW2t8zCnP3hh/5V4QLxnfww72OfNOc1gffCIzyNKf/ridcDaDYkCeMPBXIsEFYOYI6rgIB/nfnV/+P9qZdolr7/+xk6HOOMyl9T77dSCxgQRR5qXcko9okImQoht+b+l33uVRl/ksAPjQ188jAF7cK5YzjUg/+f4nTUSkHNiXxn6w1x/Tlz2t8j5Lg9Of+FTT4YhpfqzW1mQZ+N1Lm0+Sk09/V3Cg1YF8Ld9Ve88BzfusM7oaof0anl8omSmCm+D7Yrk0iQGzCUCCgD0= 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:lW1Ad3ni5Re/31xlBuHABHso2+7N+tUrYhQR4QkuKd?= =?us-ascii?Q?zjOcnlXPHnCO6UvNasckAKiQ4mRxf28WpurscHoSAY/TotehUAr4DGCFk195?= =?us-ascii?Q?vENcuIzBC9QrQvJo4QW2daz+h6jLMGE+rZz4uJE7t+svTc+M+Vhv3nGa5t3t?= =?us-ascii?Q?pfUHK9fzd7u2lKO7pPDxGodmVgB5tzZP2ccEw7t5U9zOUiMeCtrKmBB8qRdT?= =?us-ascii?Q?WSFy5xKsHvDD/LKnBzUcEikaZRHE4mpt5WWa5uacR138OlAdU1FPtbnNf9Y1?= =?us-ascii?Q?yTUZ5JcjilGpqsS2Q8RnereUbfE/MGZD4tbb+Nu4/PxK2iQXxQU7wZyaHGP6?= =?us-ascii?Q?kEAncRMy/MqjDyP3FqqJp7viJuM3Vo9fI6HA1VwOHVk8HtPfddkMJOWItQ2J?= =?us-ascii?Q?06APq4TGMKxKD//1O81ZGvYweoBMpdTqw3T4qGTGfUbVrzJRwBM8cnfyKIRj?= =?us-ascii?Q?Z0R+cApMFAQuImzXFWQBEBSUqudk2NoLpnGW+RmdI4XhZWsYIXnMjKJDvpOp?= =?us-ascii?Q?fZCDXrUFJBcRQWZyvC+PMZIyAL8zsRcaIdFccIRMB9WEoMguEr8/OsREUPj6?= =?us-ascii?Q?RwNYDiwsbu47k+2h4ymzi2kmmuE7iNjQ75hACyG+erjzpAJpUpJv0+nYdS8O?= =?us-ascii?Q?iUmvdwi8AyaX4H1T/gTILPlcA9gbU2zYD9ShV1cuTdNRD56J5pW7QH8K4Bhb?= =?us-ascii?Q?agyi2u1OYtFY9czAonSh4EyO55zGUSCQVVwWiJ2ofEac5mbPfCEL1GaZHBUH?= =?us-ascii?Q?+GH6fj1YNfTW3w3ywZ6FFwGAbbZ1f1J7U/XahVmZVo/8TVb3DrQhspDD1QNL?= =?us-ascii?Q?Mq9cGufe5HAQRsr0SP1suoYmrnmRkQyAs6kMLpjm4KZlLWFjTII3B2NTqATw?= =?us-ascii?Q?F+ozKCUKFoCxEY42VlF3p0aJ5dMFyXaR/DcPpZOgjRjkdwHvWeUf0GFZa4ip?= =?us-ascii?Q?ZlJE32zkv48/5ombhS5hNajkF0Mejmkyn8WeGq6YPkp+RI1hDhnJnygiFjjA?= =?us-ascii?Q?gJV32VLWibyqIrLTx4gir/JftLUyPYnjrNFt13WBkpeRjYr53NnTsEFZl4y3?= =?us-ascii?Q?mXuPmS52P3qmEqfOx8amD2bpBDJLpxdlQ5IT2e1b9KnSwo0MNW29S9W7dReF?= =?us-ascii?Q?ufNROnZt4WtpEZfejUl5cQMXePEeaS?= 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:7zEf/LX8RiPHug7mS9KwKVphhFwQfB1n0ZRoBWHE1?= =?us-ascii?Q?SBUi2ioXKYtaEaxjr1U8lIor4B9E1cIEh3rgnjth5K1XMLvJLLqqzUeumF2H?= =?us-ascii?Q?CXDWrKvHZ0obniFj++UG7Hb5VVrkDxihZtvxwvWaA1lrGESdTfqr0j2SPbgc?= =?us-ascii?Q?1TUA41o4yURigwJ/py2qt8YxSIyhx/yo/enr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411HdCI6nwiCHncFkWyK7B3FpMF4pqtbCgZwpd652axBldvmQDkOql64/nzmKY68e50ExHYyuYpX68ja6Meyv2GFddNFX; 24:jiIsI4uX4W2WWek7C/bcTkfDAk7TGNX5j7CEyN1J1gtp0qeFbmXzkybsMWVTg5h9ohMuo12WO0KgLzx9YexNPeHeq7Dq1gKEVCTnE8sgpSc= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; VI1PR08MB0847; 7:2BqaEk2QWQGOibPGUgPj+1JUAw8CMaPsIXRyktcX2YGEplf8+n1diXE0dWAssVbU0uPvHXjyPJdi/aAGe70yhwL4H2E/GdRALtSkSeiViDjjq8wFrCGIJ4jux270WezTlACWbX5O9wJZM3lPWVcNjs/MqCz0l7Cjw+DO8zvgWrmt1Yj2bLy5uRVtUuhMXyAPIjbBeVLPIzQcEwn5H/qEIeeTSdHJonhCggWj62seisO73SCfdNzlQu9FfLgKQn3HciSjLdbC0FujvfR5I4DLz2BIp6bgXS9/PixKD6kHAVIYdB3MHLJ9RemkdFtTsKZ8cPwagoZAiyuXimozpjq2rA==; 20:S2cozj2crMFLxteaYfhHC4Ctx60UNqPi75mdT13SymCuNAmacgttiHkwUI7Mx6wg8x/4uT844O0YDA7ZTdGlZwR4uox52CH14x66CnTmoqbWN9mi0pEqbF49bYKWzpyKMO5eXVtzYAnj+kASF2UfhU57d+qS/N6DCMJn/O7UwWk= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Jun 2017 18:20:03.9137 (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.97 Subject: [Qemu-devel] [PATCH 10/23] hyperv: allow passing arbitrary data to sint ack callback 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 Make sint ack callback accept an opaque pointer, that is stored on sint_route at creation time. This allows for more convenient interaction with the callback. Besides, nothing outside hyperv.c should need to know the layout of HvSintRoute fields any more so its declaration can be removed from the header. Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 14 +++----------- hw/misc/hyperv_testdev.c | 2 +- target/i386/hyperv.c | 16 ++++++++++++++-- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/target/i386/hyperv.h b/target/i386/hyperv.h index c5843c9..bf7f47b 100644 --- a/target/i386/hyperv.h +++ b/target/i386/hyperv.h @@ -19,21 +19,13 @@ #include "qemu/event_notifier.h" typedef struct HvSintRoute HvSintRoute; -typedef void (*HvSintAckClb)(HvSintRoute *sint_route); - -struct HvSintRoute { - uint32_t sint; - uint32_t vcpu_id; - int gsi; - EventNotifier sint_set_notifier; - EventNotifier sint_ack_notifier; - HvSintAckClb sint_ack_clb; -}; +typedef void (*HvSintAckClb)(void *data); int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit); HvSintRoute *kvm_hv_sint_route_create(uint32_t vcpu_id, uint32_t sint, - HvSintAckClb sint_ack_clb); + HvSintAckClb sint_ack_clb, + void *sint_ack_clb_data); void kvm_hv_sint_route_destroy(HvSintRoute *sint_route); diff --git a/hw/misc/hyperv_testdev.c b/hw/misc/hyperv_testdev.c index da87630..97ea959 100644 --- a/hw/misc/hyperv_testdev.c +++ b/hw/misc/hyperv_testdev.c @@ -55,7 +55,7 @@ static void sint_route_create(HypervTestDev *dev, uint8_t cpu, uint8_t sint) sint_route->cpu = cpu; sint_route->sint = sint; - sint_route->sint_route = kvm_hv_sint_route_create(cpu, sint, NULL); + sint_route->sint_route = kvm_hv_sint_route_create(cpu, sint, NULL, NULL); assert(sint_route->sint_route); QLIST_INSERT_HEAD(&dev->sint_routes, sint_route, le); diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index 3ed5a48..ac7988f 100644 --- a/target/i386/hyperv.c +++ b/target/i386/hyperv.c @@ -16,6 +16,16 @@ #include "hyperv.h" #include "hyperv_proto.h" +struct HvSintRoute { + uint32_t sint; + uint32_t vcpu_id; + int gsi; + EventNotifier sint_set_notifier; + EventNotifier sint_ack_notifier; + HvSintAckClb sint_ack_clb; + void *sint_ack_clb_data; +}; + uint32_t hyperv_vp_index(X86CPU *cpu) { return CPU(cpu)->cpu_index; @@ -77,11 +87,12 @@ static void kvm_hv_sint_ack_handler(EventNotifier *notifier) HvSintRoute *sint_route = container_of(notifier, HvSintRoute, sint_ack_notifier); event_notifier_test_and_clear(notifier); - sint_route->sint_ack_clb(sint_route); + sint_route->sint_ack_clb(sint_route->sint_ack_clb_data); } HvSintRoute *kvm_hv_sint_route_create(uint32_t vcpu_id, uint32_t sint, - HvSintAckClb sint_ack_clb) + HvSintAckClb sint_ack_clb, + void *sint_ack_clb_data) { HvSintRoute *sint_route; EventNotifier *ack_notifier; @@ -116,6 +127,7 @@ HvSintRoute *kvm_hv_sint_route_create(uint32_t vcpu_id, uint32_t sint, } sint_route->gsi = gsi; sint_route->sint_ack_clb = sint_ack_clb; + sint_route->sint_ack_clb_data = sint_ack_clb_data; sint_route->vcpu_id = vcpu_id; sint_route->sint = sint;