From patchwork Wed Jun 21 16:24:09 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 9802229 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 58AEE600C5 for ; Wed, 21 Jun 2017 16:27:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4794128638 for ; Wed, 21 Jun 2017 16:27:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3A43E28639; Wed, 21 Jun 2017 16:27:00 +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 54E2A2862B for ; Wed, 21 Jun 2017 16:26:59 +0000 (UTC) Received: from localhost ([::1]:55038 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNiT3-0006ps-PD for patchwork-qemu-devel@patchwork.kernel.org; Wed, 21 Jun 2017 12:26:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35112) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dNiRn-0006mw-91 for qemu-devel@nongnu.org; Wed, 21 Jun 2017 12:25:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dNiRk-0004U6-JB for qemu-devel@nongnu.org; Wed, 21 Jun 2017 12:25:39 -0400 Received: from mail-eopbgr30110.outbound.protection.outlook.com ([40.107.3.110]:49429 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 1dNiRj-0004Tm-VK for qemu-devel@nongnu.org; Wed, 21 Jun 2017 12:25: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=opUgJsBsaf/o44pwM/grs6CRn3zoyfDKG7ztI9ZhyKc=; b=X7UlL7jPwJD/LJP8Gt6QOWqYWfku0t5R2ASGrP+OJLX7ErJ/ClS2iCeMnBxlcqjSRZb/EjBVfeluwdrGGu5con5lNMFRDjHLehJYmXa+N7J5f/LmNsMZ2XDDKBt/ogzzSmCSUranjMBkj5ioGxFhimZphqZlOPE4p9hlC/SZ0zA= 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:29 +0000 From: Roman Kagan To: qemu-devel@nongnu.org, Paolo Bonzini , Eduardo Habkost Date: Wed, 21 Jun 2017 19:24:09 +0300 Message-Id: <20170621162424.10462-9-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: 6f0df64b-4e19-4c91-9247-08d4b8c2240f X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(201703131423075)(201703031133081); SRVR:HE1PR08MB0842; X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0842; 3:nNJjOVnoFs3ZK3m8f2VmwTM8rfT9iTTxtphOoPYCNFRV8RpnwxTEqVPO/4Ou8k5JBOIODKO95RUq9AHkWNBovPRZW/jrVvwtFmISNF7P+s636QyyMtsvN9xc1qe5H0oQsAJbYGBIsdJjS0QVr9T0U/aKXMfgLMsWoCmAp8e8yRc0hcjpxhaxyxGz3T2B8H3NzBqB8+G1vmu7+1Gl5jjGYQeowhhZAY1u9njS2EYpcto7mdiBAc5MqHzuKXaLDI/x9gS6/qlQKSradvCKIZ8Tzi+ku/oa/rI8+3bjR5JsizP/8JX7hKZtKKl/xiAQMZg32MYOvn1SCjgzs5wXlev5aQ==; 25:HlslMdyQlsAh8PFRle6xuzqGFusC+OcjbCoAQQ5aiHG3pgqgi0drL1F/8R3FqlWz3K8eqT4tRri7cX3ICxWUoq/m0jTshd9sIiTyJ3g0DBs0Urkx+IqxnQFcebu3ryN74irxAbdzTDBQHmFCA8osHToY9c+O1MtzajX8CV6DxoGpW4s19jV9t5HAw6vmlzmyLuYRFBJdP0Fp3N655mKjJahNrwp76wC1QcW2aCxpiJ+re1ABBldeg9ssS3itJLA/0pYj6Eob1E6B+v5dlRynSwVtxboYiswJj0wP87lUDflroMfLJQ2mRruaV4n1CguTHavSnfFNR9fqGe6pstU/V9NQMWVYaRfq7wcnJ1tHtTPTq83XN+W9KtxAApDKy3RqfeQBFpdDni/S/UfQ9cqa3W55z1dcLqDq5hVzUOJvPBlBCsTDt/ajC8dpSMrbktMpulqhbRRFThI5Q7v42rnpEH4JlpH4DU7I/+S+6oKFOnU= X-MS-TrafficTypeDiagnostic: HE1PR08MB0842: X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0842; 31:8sU6x26YsMlmEUWIyOlP52BtySEjicQ8LhnU/iWB+HORBrjMg4YedCc555dzZW8vqkGA1J9f41Zj2Vv+R1F8O8dUoDr6p8BnbIzm/bLPB9EYCfagBmPm6hUIWboL0Yu8oqMjJskpaVbnSPc4aWFagzC1s/eF3bJIBlkYOZ19s0FqE+zmHAdDJPQdTHpOykO4VGKFhvLEgs4uMLjRY5aS+uHC0ytb4FUQHzesd6eabpk=; 20:oQkjLKjaNzNfAHPfA79J2JCAaDeUUTdrRll/HrSvwL9siuMaF2s5Pku/357lwa7SYi5rSfZx1onCg7RldpB77gtMQR5ArJNjXxwuJXnoK/IXlUUnReYijcs1oVQhFwSpgLv0MjzgZuOXog/ZRplw+ofa5RtQzaoTg9zdzLQy4F7TBbgjqEclsGuqpq3c0KztNers7ii7Fx8WZeEKqBKzrKuumZn+CZ9UK1CC1LGw2MdzEmDRcQiMfPBjrIW8kxIyZKYYRkrL+Qe5coWf/+5KK/DQjXUfWBfv+eVpADbXwaUtnjo2Hd/DM34P63OcsAmshNLF9eloPdtXBgPEz2KWkC/JaHJdN4Bsz9tlm++vMO6mo+OkLc6adA7lXWJ5MtiuzbnMHpBYc76bQYDeDLKFRntaxcRY1mSNM/qExlrknxI= 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:2lKy0fIfjpv0qzj9Yft1s3Xp5GzKiBRxs3V/APS3mc?= =?us-ascii?Q?IkWm+2CQPtCouAyMSZysw6Cd59jYHYyJ8Bch/bdWeJ1SoRyuiHuahbaowfNB?= =?us-ascii?Q?iJuHjte1Y4B6nzFXo3X9mDm8Rz7DOGIhJm0Nk2joWGC3mtCvEzJQtSGDQZzM?= =?us-ascii?Q?MpCAqcMWdAipmcrhKumF/ttpCc9WSDp5XdmcYORSWnbMSEYcSzbAjx0Yy/1R?= =?us-ascii?Q?JgsXcBy31MjSFP/JgiwxY+JSz5FMrUcxygUmd22tZq1pTlQtm2BwSpPXpGLl?= =?us-ascii?Q?xlf22QaRQdE0wm7M8OdAODFSnw/V3777nByWdnXHQTcbQQpriMo4mz+fJC+b?= =?us-ascii?Q?NtRCqmqwuKJYN6Bf0G5Lu1IHxlLwo2RhuWS7JMQ6GirjI+PZI2zNbJTJDyY5?= =?us-ascii?Q?t0KbVJYIxMDxyV5trcab2lnVscFPJucd/zOTQauSIOwATMUbjCpGEv9dmNpq?= =?us-ascii?Q?IOA6of1f4zyZd7fYuOhvHBy7OgsO2G6xIjo9bxO1IamYQgET+w8wtGjwNjYi?= =?us-ascii?Q?devESVyTE2RNhzG4tCt4yp5AI1Zh+k6RoMNMdZWmZRYIi49JXeGrmCMAj9s0?= =?us-ascii?Q?5UsQoeeEHilN/+tcFKne9fD/jzXOJeXi7ElFRwa5efWjpdufBBoyj8Ko1SXC?= =?us-ascii?Q?BKH9T32mGtpr6J7K5qqhmW97YO9JOFfNlvLcBc1F5YBjLpTDzPP/KFoE0etl?= =?us-ascii?Q?FAPZ2zME1Ol3kMgTw+nGfxEU6Fzv8GdrPoLX3f0kIp2abzP7lAXeOXDmH9HT?= =?us-ascii?Q?wOzPfb0Oa1Aly8PMMncU1d/3y1FVJyg3X0DWkTYNrpcu2CvHPeYhlYz1IvMl?= =?us-ascii?Q?ZziNlr+1EEBbnxPtkGjO2q9hwmldZAYoRj7oKnL8w884Sq5PgoentBGPjSTy?= =?us-ascii?Q?xjbF4RSJy59hOJE36DsHUB767VPZRrpu4bnMg2RPf5jQOS39OpDNK2YQIbfy?= =?us-ascii?Q?A997+aNgfD5PiGY6fuq9iAJxehgy3EnnTpbuEdrhXeS27Sjt5KkewyyjhYcC?= =?us-ascii?Q?HhhyTUVyhh5V9eSlw+cF6wg+wfLqWbtNUQaCrLk+hrz9qhEwdmKy8ScHWE6n?= =?us-ascii?Q?xFABE5qpIthchFKSBn2kZlllXoDCVZFB98Xz1UD3PBr8afdcOQmZSJ2Akdis?= =?us-ascii?Q?Fa5an77C/v7MAYBmKA/vzcirutSsUc?= X-Forefront-PRVS: 0345CFD558 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(39450400003)(39840400002)(39410400002)(39400400002)(6666003)(4326008)(2950100002)(6512007)(6506006)(5003940100001)(42186005)(53416004)(54906002)(50466002)(86362001)(38730400002)(33646002)(478600001)(50986999)(76176999)(66066001)(53936002)(81166006)(7736002)(6486002)(189998001)(8676002)(50226002)(305945005)(36756003)(25786009)(5660300001)(1076002)(3846002)(6116002)(47776003)(2906002); 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:9gSpgdhs1brljqicQ6fEYaEQBnaGSazfFun3rf/Zx?= =?us-ascii?Q?bQrBqBt3rv9OC+lyWMhYSmSb+VYtAZ+Cd7RnTAgWTpWsynGqUsiKWhQ4G04J?= =?us-ascii?Q?F5Ve7569PyZpdAQS0G+eAfy2pc4yB+MKgw/TVpbCW2LMjpMCKJ2GjDnBKGS/?= =?us-ascii?Q?I0hXJjpyTqIfP0QknYhxx2hgEl3lOu8j+D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/?= =?us-ascii?Q?WhPNalHl4SkB8YobHs1VTao2HMHYsYcsDS3O2e2DxKHMJhIKmHWRf6EjNXwc?= =?us-ascii?Q?qeO+rhrt0g3+DA1sFzKgP9Rg4pYf1O4dqBveBrQshzn7Z6j3uiwzelnlB//k?= =?us-ascii?Q?w=3D?= X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0842; 5:67zbgDa/+SYDH9k2n1Dqlrd9uw4kS9EsE7GYpk8X7XPZTBcj1c7qb+AjweYWd2X62MyzkimW1QCoSdjMSYYZ01eFPE5Sqp+OEvbUOQ8p0hWC25VERK+M1wTGyIFVpotuwFgWp7ziJl5doj5rhlm4xCXPthKtzk97SYqjRIdaz2XjOX/loVX+CkX/hA9opKZGf/aCTqoGkuiPsmadVXOVQnJWGcIduHbnmyQCHQQHCsbivoFuhSCiQ5FozZOgSw4yWm5sPMewJgFCGJkdiedmFwSIcLAzBQlp8SS7N2ESPdBrx62gFJ1Q7ewm4l0K/c0dY9uFT4ycYN/rGPTavb8YR+PdqEY0t/g3HRyKCDqaLOvVmxWjKdNt6DQVw3iouQ8srmabchE3i9kKEpMqzRMq28cqRmISul0ulyHzc2m1rj7cYjZPsqSa11fm6MLk53kIw32/c/5bngKMlww8WWUpvBlmRyvRXQf8bthLsObNix9T+u4r8PMB400CmoNoNU87; 24:Xy2ZAOpK6gn/IJWK4a3isj7CryVJ5ehzfJd/cyOdSRnvfXTnGMrWhtCgQ+PRqHMqW/a76tCF5FtOaA4ennw7sbTGlhTr4cd4JvnpJcqPLRs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0842; 7:BTIn4Z0e4Vx7Ou4aBmJyWcO8szgSOCJfVUrkaButAP9jm7EnswtTEG4f6rsO4ApWfK1aPDZp0RB/JZB7mHsHxiU0ekUyCShTXZWL9CwPyqrT+UMaopI9Oc7IslEk3pncoFt7yoXbcij7VVo10rEKQLJPsqnXe3QdMIK+jRv3ZSvn2ZFaHzAGQ5QgV7y3uKRvARuPumcnoinIY+KpV9RGqb3btLWS2uQ/+FIT3nVkPl4C5HliMQuclE5lqnEWN7joSYg6wWKa9qSmd+Fi4Wea175gmcQgaaWcGTAgX1zP/ll0Kf4TOfXenAvVVUU/M+IPPEmb4B7LYGd8iUCWyOzxktKN2k/rtRDiFRRxFKIiEgKeRDoM4R4o2Omrh3U32OcPZj0kkjUAvoI4d32TvEsrT6TwHNxx3OCa0eLyUihNiV2+UqWzt1MRHdawBAD94zNuwsOPiVp2Zn2icseFVHY+ZJvkqdTYazENPdwH4EZoOzNILUsw8meZdpvAi9RfDFxpcsecx89dOBhyz2l0BbjbI0MALbvcLR3wpW1HlEYDWlhPuBU/dnvnZE1gVaTVLN4Ibt5bBllK7W9CEipvenw8Cvt8mior/+XfuYTzMTKmQKeJIYQrKCsQYZplK2lM7+rVLu+Gxfid4/f4Zq1uiyeONSV12kdYSYWsaKD7uPatjD8ZGMzYhzrTg6gaVMF7MQfgC629MeDcooFQPA6QvEOBQhc2z1w8EuxifnOjeAYvlugFud4Mom7R2BsxWkYwVY3/9G33aKgGF8Fv0kTlK1rGWAbg6dfIT7+ho6D2peQOrmU= X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0842; 20:ABoj99HVIiRlwVjQqEb1O9kVq4QdPzL4jkesV6Xji+Y4y9ZInYyZh6UyqCqGAXhxggPVRq6oZrodAol271CpJztcnjQimv9mZfuwKUfqD9FBm7qLf4/Do+fpmP/21TC2wetlJUu6bPhRNsHVd1L35HfXif/2Wl93Gdq4hI2Caig= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Jun 2017 16:25:29.0028 (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.110 Subject: [Qemu-devel] [PATCH v2 08/23] hyperv_testdev: refactor for readability 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 Make hyperv_testdev slightly easier to follow and enhance in future. For that, put the hyperv sint routes (wrapped in a helper structure) on a linked list rather than a fixed-size array. Signed-off-by: Roman Kagan --- v1 -> v2: - was patch 7 in v1 - renamed the variables to distinguish vp_index from vcpu_id hw/misc/hyperv_testdev.c | 114 ++++++++++++++++++++++------------------------- 1 file changed, 53 insertions(+), 61 deletions(-) diff --git a/hw/misc/hyperv_testdev.c b/hw/misc/hyperv_testdev.c index dbd7cdd..b47af47 100644 --- a/hw/misc/hyperv_testdev.c +++ b/hw/misc/hyperv_testdev.c @@ -12,6 +12,7 @@ */ #include "qemu/osdep.h" +#include "qemu/queue.h" #include #include "hw/hw.h" #include "hw/qdev.h" @@ -20,12 +21,17 @@ #include "target/i386/hyperv.h" #include "kvm_i386.h" -#define HV_TEST_DEV_MAX_SINT_ROUTES 64 +typedef struct TestSintRoute { + QLIST_ENTRY(TestSintRoute) le; + uint8_t vpidx; + uint8_t sint; + HvSintRoute *sint_route; +} TestSintRoute; struct HypervTestDev { ISADevice parent_obj; MemoryRegion sint_control; - HvSintRoute *sint_route[HV_TEST_DEV_MAX_SINT_ROUTES]; + QLIST_HEAD(, TestSintRoute) sint_routes; }; typedef struct HypervTestDev HypervTestDev; @@ -39,88 +45,74 @@ enum { HV_TEST_DEV_SINT_ROUTE_SET_SINT }; -static int alloc_sint_route_index(HypervTestDev *dev) +static void sint_route_create(HypervTestDev *dev, uint8_t vpidx, uint8_t sint) { - int i; + TestSintRoute *sint_route; - for (i = 0; i < ARRAY_SIZE(dev->sint_route); i++) { - if (dev->sint_route[i] == NULL) { - return i; - } - } - return -1; -} + sint_route = g_new0(TestSintRoute, 1); + assert(sint_route); -static void free_sint_route_index(HypervTestDev *dev, int i) -{ - assert(i >= 0 && i < ARRAY_SIZE(dev->sint_route)); - dev->sint_route[i] = NULL; + sint_route->vpidx = vpidx; + sint_route->sint = sint; + + sint_route->sint_route = kvm_hv_sint_route_create(vpidx, sint, NULL); + assert(sint_route->sint_route); + + QLIST_INSERT_HEAD(&dev->sint_routes, sint_route, le); } -static int find_sint_route_index(HypervTestDev *dev, uint32_t vcpu_id, - uint32_t sint) +static TestSintRoute *sint_route_find(HypervTestDev *dev, + uint8_t vpidx, uint8_t sint) { - HvSintRoute *sint_route; - int i; + TestSintRoute *sint_route; - for (i = 0; i < ARRAY_SIZE(dev->sint_route); i++) { - sint_route = dev->sint_route[i]; - if (sint_route && sint_route->vcpu_id == vcpu_id && - sint_route->sint == sint) { - return i; + QLIST_FOREACH(sint_route, &dev->sint_routes, le) { + if (sint_route->vpidx == vpidx && sint_route->sint == sint) { + return sint_route; } } - return -1; + assert(false); + return NULL; } -static void hv_synic_test_dev_control(HypervTestDev *dev, uint32_t ctl, - uint32_t vcpu_id, uint32_t sint) +static void sint_route_destroy(HypervTestDev *dev, uint8_t vpidx, uint8_t sint) { - int i; - HvSintRoute *sint_route; + TestSintRoute *sint_route; - switch (ctl) { - case HV_TEST_DEV_SINT_ROUTE_CREATE: - i = alloc_sint_route_index(dev); - assert(i >= 0); - sint_route = kvm_hv_sint_route_create(vcpu_id, sint, NULL); - assert(sint_route); - dev->sint_route[i] = sint_route; - break; - case HV_TEST_DEV_SINT_ROUTE_DESTROY: - i = find_sint_route_index(dev, vcpu_id, sint); - assert(i >= 0); - sint_route = dev->sint_route[i]; - kvm_hv_sint_route_destroy(sint_route); - free_sint_route_index(dev, i); - break; - case HV_TEST_DEV_SINT_ROUTE_SET_SINT: - i = find_sint_route_index(dev, vcpu_id, sint); - assert(i >= 0); - sint_route = dev->sint_route[i]; - kvm_hv_sint_route_set_sint(sint_route); - break; - default: - break; - } + sint_route = sint_route_find(dev, vpidx, sint); + QLIST_REMOVE(sint_route, le); + kvm_hv_sint_route_destroy(sint_route->sint_route); + g_free(sint_route); +} + +static void sint_route_set_sint(HypervTestDev *dev, + uint8_t vpidx, uint8_t sint) +{ + TestSintRoute *sint_route; + + sint_route = sint_route_find(dev, vpidx, sint); + + kvm_hv_sint_route_set_sint(sint_route->sint_route); } static void hv_test_dev_control(void *opaque, hwaddr addr, uint64_t data, uint32_t len) { HypervTestDev *dev = HYPERV_TEST_DEV(opaque); - uint8_t ctl; + uint8_t sint = data & 0xFF; + uint8_t vpidx = (data >> 8ULL) & 0xFF; + uint8_t ctl = (data >> 16ULL) & 0xFF; - ctl = (data >> 16ULL) & 0xFF; switch (ctl) { case HV_TEST_DEV_SINT_ROUTE_CREATE: + sint_route_create(dev, vpidx, sint); + break; case HV_TEST_DEV_SINT_ROUTE_DESTROY: - case HV_TEST_DEV_SINT_ROUTE_SET_SINT: { - uint8_t sint = data & 0xFF; - uint8_t vcpu_id = (data >> 8ULL) & 0xFF; - hv_synic_test_dev_control(dev, ctl, vcpu_id, sint); + sint_route_destroy(dev, vpidx, sint); + break; + case HV_TEST_DEV_SINT_ROUTE_SET_SINT: + sint_route_set_sint(dev, vpidx, sint); break; - } default: break; } @@ -139,7 +131,7 @@ static void hv_test_dev_realizefn(DeviceState *d, Error **errp) HypervTestDev *dev = HYPERV_TEST_DEV(d); MemoryRegion *io = isa_address_space_io(isa); - memset(dev->sint_route, 0, sizeof(dev->sint_route)); + QLIST_INIT(&dev->sint_routes); memory_region_init_io(&dev->sint_control, OBJECT(dev), &synic_test_sint_ops, dev, "hyperv-testdev-ctl", 4);