From patchwork Wed Jun 21 16:24:14 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 9802265 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 2EBE560329 for ; Wed, 21 Jun 2017 16:34:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1EE4C22638 for ; Wed, 21 Jun 2017 16:34:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1351A28631; Wed, 21 Jun 2017 16:34:44 +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 4764822638 for ; Wed, 21 Jun 2017 16:34:43 +0000 (UTC) Received: from localhost ([::1]:55068 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNiaY-0005v6-8z for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Jun 2017 12:34:42 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35313) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNiSE-0007An-2m for qemu-devel@nongnu.org; Wed, 21 Jun 2017 12:26:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNiSB-0004c8-Fv for qemu-devel@nongnu.org; Wed, 21 Jun 2017 12:26:06 -0400 Received: from mail-ve1eur01on0123.outbound.protection.outlook.com ([104.47.1.123]:21376 helo=EUR01-VE1-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 1dNiSB-0004bf-2N for qemu-devel@nongnu.org; Wed, 21 Jun 2017 12:26:03 -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=/ebLoJKfMxyI926IeVVCXR12ZoDFiXoR7mOqqKLWcDA=; b=PgGlSz123O1Hcb0aHaiSxabAdYl+sTUipysz0Q+RKFUCrjfziWT6TzGe0teJdSQ8LjnMSCZBFapG2Stm8zJHo1ZndEq0OuCvpRk4fzfyvvsGxscCwTUX0VyS4tPj6/yJJlv8ff/QjuoWRSeO5XKwPjr5iLF71plLok8DSieLr0o= 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:25:56 +0000 From: Roman Kagan To: qemu-devel@nongnu.org, Paolo Bonzini , Eduardo Habkost Date: Wed, 21 Jun 2017 19:24:14 +0300 Message-Id: <20170621162424.10462-14-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: 684a9f43-48a1-421b-2291-08d4b8c23450 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:HE1PR08MB0842; X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0842; 3:GzEFkomoiwJ1UKcw9UIbIL2oSn2GqBVHwXZNYiI9EN0nCkz0brC5IO5LUtqN53es0BE0EYhyuEJAkCD+GzWY7ddN8WsScxSFJq37ajOQ6W6q+g4j3ULJ07cOQPwbuCAz9gX73q5irwBr23K4+e3BvDIySsHMHi2fjEZPnOPVPlhNrh2rrkJKq0lQalpTq1QYtaz9SJVWQ3sZzdRAyB9nvZemAF1RhlaG9SnDPXOfrCTFXLT7CWoIvHpbWCjXgt6cfLd6v78gDBqodSTVCT5FMkr/OIENs9956GOzDqgqCl2FiAAIbgpp97Ke1P7LCucKPyitXpLITAnYbs7kW4WByQ==; 25:026gAhs9KsU0NEF4OpJynp4a93RCio1lF4WU4C9YqK2XOE7qg0LjmnlGoxOWuOWTXKzpBKiFyyd2i1H2Sgk2kmvEcBdyb0ifnUJLN8dfRQIyUSfR2JI6gMijQRRiwVh9uXdR62Q3so4yyarzuHUMOlXMiYDjoihykXHPMuwDgHFKuZICEqe+uJFGYiSEYjlIk2ZNTUZ57s9iWaDDjukJJfCnGwqHkSrRjG2Lynw0UrR+3HFFnGTWtCE8sw1SNyOkOfdAmB45ByoUj0OfvBUmQpFmXG02jC4zjiNMu1BBbhgBHAK0nqnXnutXdTbvfkrajxh+mSsp8ToPrDlexING3EJOtYsr9cUZydj7PqejNKO3jsuoNFZivwa9aPS8ej/b4y8YTlCGGcQwarj8DyRWoOVjpmqYjkEJcqI0smbF9Na+GVt0eh4/EW/a1L17sm2Ey4tN9KZ41N5abUSDX7bfPP2yXFPiqxZAS0vsnW3TAQI= X-MS-TrafficTypeDiagnostic: HE1PR08MB0842: X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0842; 31:7lng3l2ue3dffB9ebhAbSIU+7+czLGlFFFQvgir66ctUJbtNwUL35s0+ewZJSBLMktVZox4vYnLgXOHLmKEu07LK1VOVo9/nREpJQr0wmra6iE19hcSkcs9Uu7/++jIdFz9A7TjflZyRiAZ7ywrjCkp81DNXltaYL7eYD9waHzBII9zkCx9MpTTSjuHoVuToZPDF1TeqG6feomnpCmPP59JimJlWRMNa1BUIF/iKsvg=; 20:zmO4RXePbm2ykGOKPiGhSBKS6QKmy1H38ybGgotNAlXlow4H51/a/vNBdzREKpiEweUDT1o8fuloAkkUlHzabtgQdMFkWOSWkXY5ejWTyidCBv94gd2MFEhhwvQEVsut2tQWSkEqbXaqCRYt9DSrE79SS9Aivc9U3XKN2xV2JYOalIFZA5Y6wE9tdOQ4xbdxHVY+/PdOgJhk72S9kzfH2J1I4k7lXzVnU7ABv88r0QKa0723tm9gTvCLpgAYjdaEx8gkON/uMqnIOqAOjfahCsTtXJbjPUdvlCdsgZU0zfaHDUQ/DgvDGGCxw3fczS5FZ7osjHfi4OrPds7MnmSveFLvRfNjHHB8DCn6kY23w/iE1i4cVlPzfjq8TfNGLN0hX36+qzeWQFylvE5wIaQ3/fpWo+5nw3TfVbo5D0KqNew= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(60795455431006); 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:/Zp9LGef50+9poAGRbCANzwIBh4yyKO4oOR4JDdDAQ?= =?us-ascii?Q?RDw6Q13MXlb3yiN21lu/dOVn3QbMq7feS4lSJWCP5SK/MYha/JRmvcUq0M0p?= =?us-ascii?Q?OHKJ7IwObTIl5qk4nsD5cSjj5FjVf6CBRABdOAZGoKjizKteNALMJx32BFhP?= =?us-ascii?Q?Je7OsMPkYSTnFyr6g/Kkll4eQNAL6nC63tnNBO12cuN0rsFt7Kd7147RT/e/?= =?us-ascii?Q?E3OUdzS0oD+YzZWqMgvF7tgApAGUVN0v3KdPGb11vD0m2G64m3O9ZmLtGhjw?= =?us-ascii?Q?78qVke88enKSAxP6t17IsjOrqZyK2qZaoNAuiHp5yVS4BdHFFCkydbw1O2xQ?= =?us-ascii?Q?5yZFJpQ18qkRi8XRwfCFL0CshX0JCcMqCmrRIzJxBgij9Dph9mzotjBgUnlF?= =?us-ascii?Q?ARYajUU13mO2qahynruqvf5vlFfDsjT02AGKmoXuhzrKmOyImcgXxRzqnCy6?= =?us-ascii?Q?Clx9MldU9RAE11wuPPj7jqkvcpPGC3zYUkXzWb3swxoNUwBOu+hNKsfqpTjw?= =?us-ascii?Q?C30i2/csDnFfCxnC+jmTBPUijZ58mLCxUTIGttGFkrWNYB5IR6p0blibqMIY?= =?us-ascii?Q?B9Z22vMdbrC1UOGkrmRBRJo3SpNzUE9dMP/nFQx5iBCQEJ09qGr+fh24KxBZ?= =?us-ascii?Q?KnlhmysQDsE8b6rRBPYP2IIiX6bo9w5kxevZjADA4cmSo3lG5DLEhKK51f5J?= =?us-ascii?Q?eXOSbj10YV6dPGLkAN/Tp2dfIk+9gAqGKWG4I+CUIuGtUDU5tYliRzfF9Ou/?= =?us-ascii?Q?AZgXQ4JgWKrqRFutdUAeVk5k+nIqJI06jcSGkYhPfsPGpcEMRNifRO1p5L7v?= =?us-ascii?Q?JTQDs0Z1FzqJcBSZ9/U9bXnnNLDc7CuDgDglVDYhjnwIsfBHXQPzr1uncUSW?= =?us-ascii?Q?Xp5MHQWvJV2pffVvWyrvm8Tp6BQ/nm8tlhoHqeVtI6CgQXB7Ydllh+1WcvKG?= =?us-ascii?Q?gvlTP9bqRo5t3Rk87ozY8Zh4gI/xfW9kMQ2Wld+9zs0eiKOmuqyBfPEiTnGG?= =?us-ascii?Q?xuPfd3fiUgb8WLAqnDffYCiZJov9IFKhTOQ41kRMov/vAkbbxBh5p//z7YXA?= =?us-ascii?Q?MNh4ue836naP4WOjjcL5h9CZk9WGOrLKOCPgde9MIiochXm0LbBxhR7+0TNi?= =?us-ascii?Q?1LLV4txBb7TKt5r0J9pmhoH8gszaifsB64yzpL1LqZXsJ/Md7k7AKjAelIQ9?= =?us-ascii?Q?wk0wuHS5uQbHg=3D?= X-Forefront-PRVS: 0345CFD558 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(6029001)(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:vWUIZgBFdUbwE5+1hepXT8oU4xqlsY7oJFaD+3gQw?= =?us-ascii?Q?wEMkuBhTlVu2G0qKeWv6thSxwCy2G4omIt3EX0i7Of9PH4658ixDWRV6Qxyh?= =?us-ascii?Q?ewROGA9z2CDaiMWmSxEdF/AWCh1T/IFJQyycJutGJ9WwOZjlaD3w8ro70iMN?= =?us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ascii?Q?bV9YLoWX+eoucLNERLsS8M0gvR849uws7fC5CUsy2E9lHbBQTITDrCKmF3W7?= =?us-ascii?Q?/YwNqdifO3g+5XYciQZ5lOqmzbJAvpx/h309QbsxOGb+LlQ6WDj1yZ8wfKZb?= =?us-ascii?Q?BXIibKvdgfOxtit7fJc1fq+vWUF5QWKsyi1URo7EjhiH+CPTI1qonpBWwagq?= =?us-ascii?Q?8=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0842; 5:gHVYf5rI+tb4/S7mAr65obfP+TZ/8jBjRFgJq4nOM1+et8s99vM9yU/20rw7M3KlnzRaa7grDctzmYhBDv3zhbRhJkfMzYTCQYWbhuXFDQdlDk/IltepCN3u2DZ0LOgdGKiJYm91MMKEGCcD2FAgVmlCeCGyM7GdwrrvRLgmbu+9hNF+XfZjS+A+jc5wJ/MZ5vWaEi9LwJGujgon+PE9XdKm7/VySdqgdTwc+WbNMRllIVOcDQ2OcJ7BWOTfwLUUVDlx9H6IkQcYdcQzjzy44vtepeKXbvr7F2AcubBAoGb8MvRSLATFj2vcc8lVKv8/8uYl2fkNrrdQ0RxzurvcAZSjHcIXOEh5oCC9qe8FgdTz9tnyhvTAGAzAyF13vOhEfTYnEkg1YtISepOur9y+wCTti2bftCZKN03SrLaJcevTECp5oVYQaaloNWzGJWCnPp9WmEBuLnF9j/KsCMoBJAbljusiKUdLM1So0Kznl9yKb79rU4+iVnu9zRiW5fsO; 24:tsqWfrqboulG48iyd6YdcJDhlS3cB1RyyTrDOI2Myg2n439MSZCr1pmqtBBKNBQwFuJ0oRBjgYCmdRsZtx5NteTUqkzJhJGLR0lHcnkRrC4= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0842; 7:iU6Yi/QxsEfGuC0khMftZHGT0JU4wGHoLDqA/9OJRyTf5nJUbAw5d5zNGe0yLW80ugZbQ3f1xd4Qab1L4lwOschqA0bkkrcEGDkh+XEgiTYmdF4M7cxyvh45FGmQIh/H7SjRqtilfx5TTaZD1DM7kOCE6MqWlXLWZ+Gci77GbXvOaRFBkXSYdsosLYo8uD4y4Qf9Jq+3X6ZM9Z30DDbXRFj9Ot+aVzoMF9bBQUP5GmbaltdfibsUUNJExwJ+eSUdL/fPpNeeAhq8OjXdsa+WBetip1r0cXZFlLNL9yjL4uZI3/PKu1XjtOmDYoi141vbovTY9T26i6dMMPrYiHVICIP+GMMk5XDfdBqG2ekBhWhDjM4dPn71H7n+hQkOATX0JZ3r9Hn4RjQ2NNYhjab7IM2lbixToy7MC82TcQ4evdQQ5MW3jXPWpHAH0rbXkfAgP+cueQzloOnTRk3gdU3I5XTCOgovdXTCF3+U+6gWuyMPGl0F3s5xwpwee5Wa2yfWkzM8OcndRFMLSlT4In+3ddARQtVg8I/bLvf6/YmlB/vKIDwfwNkdYlo6SMpvjJmFmT0UpFnDDacCdYtBziFMY0HsplrPfOwFskfdCm3sOeTJiXvGGMrZtnmq9qL3gZDA3BIJGpPxy9iPDn4F4t6WBaOiTFyRaMqJy5d7ws5Ck4x8G9vDF2m0rCtUmO+316iRAOC6pwn6hcUK0jYBdrelSWqL2/ttRVO+A8kdLmVUdHlzim0EfPlADcCNgOjKRatnZtrHqgC0NDjHTEf3uuIOHKJ6N0YLtUDvSPgdG85sX3I= X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0842; 20:qFUpm6fO9ILFmhNHOepArUODZenRSm+NbRPk9cp/yfVqFyRT0Qy2bhr7dM8cRzm9OJ6xFs39UmblgXbK7l7ycwUo+DYQ/yEkUzOqs2XUnRz/kVVBTA1Mn0v4DhAJOE8z3zhSlNQvQVJVxY3FBGQ8FOFt34AO2stcLG+4vXK5FqU= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2017 16:25:56.2851 (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: 104.47.1.123 Subject: [Qemu-devel] [PATCH v2 13/23] hyperv: make HvSintRoute reference-counted 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 Multiple entities (e.g. VMBus devices) can use the same SINT route. To make their lives easier in maintaining SINT route ownership, make it reference-counted. Adjust the respective API names accordingly. Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 10 +++++----- hw/misc/hyperv_testdev.c | 4 ++-- target/i386/hyperv.c | 25 +++++++++++++++++++++---- 3 files changed, 28 insertions(+), 11 deletions(-) diff --git a/target/i386/hyperv.h b/target/i386/hyperv.h index 93f7300..af5fc05 100644 --- a/target/i386/hyperv.h +++ b/target/i386/hyperv.h @@ -23,11 +23,11 @@ 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 vp_index, uint32_t sint, - HvSintAckClb sint_ack_clb, - void *sint_ack_clb_data); - -void kvm_hv_sint_route_destroy(HvSintRoute *sint_route); +HvSintRoute *hyperv_sint_route_new(uint32_t vp_index, uint32_t sint, + HvSintAckClb sint_ack_clb, + void *sint_ack_clb_data); +void hyperv_sint_route_ref(HvSintRoute *sint_route); +void hyperv_sint_route_unref(HvSintRoute *sint_route); int kvm_hv_sint_route_set_sint(HvSintRoute *sint_route); diff --git a/hw/misc/hyperv_testdev.c b/hw/misc/hyperv_testdev.c index 827a8b1..fa435ab 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 vpidx, uint8_t sint) sint_route->vpidx = vpidx; sint_route->sint = sint; - sint_route->sint_route = kvm_hv_sint_route_create(vpidx, sint, NULL, NULL); + sint_route->sint_route = hyperv_sint_route_new(vpidx, sint, NULL, NULL); assert(sint_route->sint_route); QLIST_INSERT_HEAD(&dev->sint_routes, sint_route, le); @@ -81,7 +81,7 @@ static void sint_route_destroy(HypervTestDev *dev, uint8_t vpidx, uint8_t sint) sint_route = sint_route_find(dev, vpidx, sint); QLIST_REMOVE(sint_route, le); - kvm_hv_sint_route_destroy(sint_route->sint_route); + hyperv_sint_route_unref(sint_route->sint_route); g_free(sint_route); } diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index b5831bf..012c79d 100644 --- a/target/i386/hyperv.c +++ b/target/i386/hyperv.c @@ -24,6 +24,7 @@ struct HvSintRoute { EventNotifier sint_ack_notifier; HvSintAckClb sint_ack_clb; void *sint_ack_clb_data; + unsigned refcount; }; uint32_t hyperv_vp_index(X86CPU *cpu) @@ -90,9 +91,9 @@ static void kvm_hv_sint_ack_handler(EventNotifier *notifier) sint_route->sint_ack_clb(sint_route->sint_ack_clb_data); } -HvSintRoute *kvm_hv_sint_route_create(uint32_t vp_index, uint32_t sint, - HvSintAckClb sint_ack_clb, - void *sint_ack_clb_data) +HvSintRoute *hyperv_sint_route_new(uint32_t vp_index, uint32_t sint, + HvSintAckClb sint_ack_clb, + void *sint_ack_clb_data) { HvSintRoute *sint_route; EventNotifier *ack_notifier; @@ -136,6 +137,7 @@ HvSintRoute *kvm_hv_sint_route_create(uint32_t vp_index, uint32_t sint, sint_route->sint_ack_clb_data = sint_ack_clb_data; sint_route->cpu = cpu; sint_route->sint = sint; + sint_route->refcount = 1; return sint_route; @@ -154,8 +156,23 @@ err: return NULL; } -void kvm_hv_sint_route_destroy(HvSintRoute *sint_route) +void hyperv_sint_route_ref(HvSintRoute *sint_route) { + sint_route->refcount++; +} + +void hyperv_sint_route_unref(HvSintRoute *sint_route) +{ + if (!sint_route) { + return; + } + + assert(sint_route->refcount > 0); + + if (--sint_route->refcount) { + return; + } + kvm_irqchip_remove_irqfd_notifier_gsi(kvm_state, &sint_route->sint_set_notifier, sint_route->gsi);