From patchwork Fri Sep 21 08:18:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 10609265 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4D753112B for ; Fri, 21 Sep 2018 08:23:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3CCA32DAC8 for ; Fri, 21 Sep 2018 08:23:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 30E8F2DACA; Fri, 21 Sep 2018 08:23:34 +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=-7.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,MAILING_LIST_MULTI,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 A87AB2DAC8 for ; Fri, 21 Sep 2018 08:23:32 +0000 (UTC) Received: from localhost ([::1]:54376 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3Gip-0007l3-SV for patchwork-qemu-devel@patchwork.kernel.org; Fri, 21 Sep 2018 04:23:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47206) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3GeL-0003Y7-TA for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:18:55 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g3GeJ-0000rh-55 for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:18:53 -0400 Received: from mail-eopbgr60092.outbound.protection.outlook.com ([40.107.6.92]:32788 helo=EUR04-DB3-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 1g3GeI-0000gL-Sh for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:18:51 -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:X-MS-Exchange-SenderADCheck; bh=gP9QO3cA6DLSG290YmJ/C8r0B7D7AWYJm0+M+7ejm+o=; b=cZjhUmsjHjFSKR3dXMGvV33ZQPdcw4xENcx8So/MGPGx58l/cIyIqQBriCYZYz5gm2W53g3qNT+uiBKuuuuUkq4OH3aQKg4/Jm/74es0WvDUAVcHUOtdMievMJ6n5yFR73AdSZ37mzby7Ko1oXZve9lfzbC2xQDJ3B2P6pkwskQ= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; Received: from rkaganb.sw.ru (185.231.240.5) by AM0PR08MB3586.eurprd08.prod.outlook.com (2603:10a6:208:e1::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Fri, 21 Sep 2018 08:18:46 +0000 From: Roman Kagan To: qemu-devel@nongnu.org Date: Fri, 21 Sep 2018 11:18:29 +0300 Message-Id: <20180921081836.29230-2-rkagan@virtuozzo.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180921081836.29230-1-rkagan@virtuozzo.com> References: <20180921081836.29230-1-rkagan@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: VI1P193CA0009.EURP193.PROD.OUTLOOK.COM (2603:10a6:800:bd::19) To AM0PR08MB3586.eurprd08.prod.outlook.com (2603:10a6:208:e1::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 92aa4807-820f-4d02-e8cb-08d61f9adab9 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:AM0PR08MB3586; X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3586; 3:fU8daxIstPJbgXC/kmrcspVpQlleSz7ChYnaXE4p8KOYjSZMUy4GbdwMMSQnLtCtzQqDwaGMYbVmAEa1hGzJ4L0Za30MrTKgfjpbl+Mie0rpFM3bLiDu6Rq+rsGFDSZ5Gmex2VxeybZqUSYk/cWYqmSviy2kXU6fZNwNMUwMjZmzcjvcbMnSCqsio0riREp+GAEhfeZNAraUDnKzFV8zBAwnpDZOk2vADghtBisHfTdvtMsXkPgSo5Y/Pwmz/zIP; 25:Ex/Ed+0s3yfvcGmMEyDExoZfk3DJ7/8V1V1jF9vtXs25m0kh4d4WnkSMiHtY90y6Mo1EO1Mzxe8E4eoObOs6Mi5lg+m74EKWbwqBsat85S0BGkb8e2BrrnmZMza5ttDX4qGxw+jvrsHuTZSqD9NhS5peNJkXgIzYqaITUWYHHPp87bHy7/RLiIX/ghGwhbLS9W71mX571StS5OjDGa5Pt7VVTZ3V279UdTa5PGfg170GekIq1thnZ3Jm1biA0Y7D7zH03sIluiIJze1pyh2bQ/92rmwC5XRaoUQU7C2IdNki2mQPK91Rcsq7245+lZnKhZ0fteUMJcc4SPonkP5t2Q==; 31:T7qAD/PUctqkxHHNbvS3wvQElYo+zWWOOu+izvz8+Pgt4lI6YSp2ILjwTjtV1GlQhKRcDU+STz4CEfXehOeX89iq3g808w8XAh4z3VJEpVHD1x+fKR3SQBmrpAkfXSraXg71m/TvbgRbuiFpSBcvcU/hos96fLu6UatAPy57uCtaEsik35jMNXtdKSdIJ6OOli/1Uzv4sOStbYIhysL8864ShgWfjOeDsTryGDxP4wA= X-MS-TrafficTypeDiagnostic: AM0PR08MB3586: X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3586; 20:MT2BbSbGcClgujs8H9v60YNX8pGKY9upQbtu8NdJPYMhGdWPoge9qXvgf1F65EvsuzJVtLu1QyFlsP8OZ3IukAiZiyXcxD0t1oz6M9Tqe2P0qin8pIntg65jeNgJKtNtbc1tJk2ovNS8J0VXnE9hiMXgob0YdODNy1nf9c4GNBvGGGsP2/gLskpXG9k02OsfKxAcvUn1bo7ilDuKvNPOujeagGtkggKC1tiMDmvU6nROiYye8c9N7mlhn4wXVwx2JPxSM9NoQXj1v5qqIOX6H4jaMHJPQHk7iq+Rdvcr0T04FJJjA2WH1SZ71HULHfQ2iQq5Kuy2K51N9DG0xGGrONrWyyRWtclZrvU4uGYgFvfeQZ3HGBjCv0xX1cxO4i7oOdkv8phT3Egkr23Z3OU33VvEbY4cew3hTakOmVPheO3oznuCNUsfk9yRgvDYrwkhdtiDmUpuNq2x7Gnot1+Nl6u/dwlch9iiQHRUAEWs1m8fGEUZx5WawuMbJ/GOS/1B; 4:1LcM+QZz8xLchoMpM0KQ5xxRLlG/T8Sh3oPhMAlavZ4Wyi9txS7xtsPyQQV6WPOp7FPxJpPpeYrZhmvmFmK7mZkGfNp3oqSyZ3ma7rSx809zVasI/xx0slkxQ83y69Uo2QSLpu7NyU/z3h8ThwiPOVsoFxLlfafPxvS7vyxPwB2bFOg/460o8Pid0j0+zLFQrMJ/ZMAeiM/InkhQMQy7CUFG0JuF/Ls/UzZW3Fz74LbeeMg7CexS8nFl7nhkkUAldU72mlbvZVD9eCHn7DNF1w== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231355)(944501410)(52105095)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR08MB3586; BCL:0; PCL:0; RULEID:; SRVR:AM0PR08MB3586; X-Forefront-PRVS: 0802ADD973 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(396003)(136003)(39840400004)(376002)(366004)(346002)(189003)(199004)(2906002)(81156014)(50466002)(51416003)(305945005)(25786009)(2361001)(478600001)(316002)(7416002)(54906003)(86362001)(16586007)(26005)(52116002)(48376002)(8936002)(36756003)(76176011)(186003)(50226002)(386003)(69596002)(2351001)(53416004)(106356001)(6486002)(11346002)(476003)(446003)(8676002)(16526019)(5660300001)(2616005)(956004)(6506007)(81166006)(68736007)(6116002)(1076002)(6666003)(486006)(105586002)(97736004)(4326008)(7736002)(3846002)(47776003)(6512007)(66066001)(6916009)(53936002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM0PR08MB3586; H:rkaganb.sw.ru; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR08MB3586; 23:53RcXXyAvSvxT6olVos7G7AlzxP/MF1K6YvchxOs8?= jMWgv3TErAwxxpIEQIQnzCQ23ffaWdk0x1FuMlAe4pjWbCGRtZhFNcQKP8fEiXFDVx9J9LQTB4pB0CuVcdIcNSYp/QrxPOI1ywKaxwEwPIG2Vn7dHXXAOSaa470Z3lJ3bhn0yEQZSCirbU/bVE5ZsVridzLqaByA2MbxLnyia1BpMI0Brh+f67+PkA8Yu+IJSO3BLJSfqMnlQf5fxu58wZD6D0ehCjD13iVB6TxXf/7a+W5U+MhFPu+laiIBYxaAWUpblRaZPYwfYCnXXxHvoSJ2sg0C/OY+Stf2LVwv2wF1lADBxh0bOQpBTnaVue6PVmJYCRcvNzU1jm78o/M3DXJAYwL37a+p4Pg4vVtQbsRPT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ltzBZbfNHxFmiapNDnPxZV2n5bYU3cndnbJCUsWWjYbI96TClIZOk+WquugnqDg6vkf SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3586; 20:WHPQWsxzjr1d/Xn9rDx9ywuDpkWfaEleoP3o/iWAh54KDlUCWEmrS8Ef0IwuWBH3nXl7F5m4NypXTmCD8/B6Ng8IySL0+iqDC1+DDzDvPwPRS1HMmweLyUA3fUUGIuiJEN/vY1bQXlq48SsZPnjwr+Q9ciFbKXcuEv1sNbRX6qc= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2018 08:18:46.3294 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 92aa4807-820f-4d02-e8cb-08d61f9adab9 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3586 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.6.92 Subject: [Qemu-devel] [PATCH v2 1/8] hyperv_testdev: refactor for better maintainability 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: Vijayabhaskar Balakrishna , Eduardo Habkost , Konrad Rzeszutek Wilk , "Michael S. Tsirkin" , Venu Busireddy , Liran Alon , Paolo Bonzini , Si-Wei Liu , Igor Mammedov , Boris Ostrovsky , Karl Heubaum 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. Besides, this way HvSintRoute can be treated as an opaque structure, allowing for easier refactoring of the core Hyper-V SynIC code in followup pathches. Signed-off-by: Roman Kagan --- hw/misc/hyperv_testdev.c | 116 +++++++++++++++++++-------------------- 1 file changed, 55 insertions(+), 61 deletions(-) diff --git a/hw/misc/hyperv_testdev.c b/hw/misc/hyperv_testdev.c index bf6bbfa8cf..de07d7e8c3 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 vp_index; + 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,76 @@ 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 vp_index, 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->vp_index = vp_index; + sint_route->sint = sint; + + sint_route->sint_route = kvm_hv_sint_route_create(vp_index, 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 vp_index, - uint32_t sint) +static TestSintRoute *sint_route_find(HypervTestDev *dev, + uint8_t vp_index, 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->vp_index == vp_index && - sint_route->sint == sint) { - return i; + QLIST_FOREACH(sint_route, &dev->sint_routes, le) { + if (sint_route->vp_index == vp_index && 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 vp_index, uint32_t sint) +static void sint_route_destroy(HypervTestDev *dev, + uint8_t vp_index, 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(vp_index, 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, vp_index, 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, vp_index, 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, vp_index, 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 vp_index, uint8_t sint) +{ + TestSintRoute *sint_route; + + sint_route = sint_route_find(dev, vp_index, 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 vp_index = (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, vp_index, sint); + break; case HV_TEST_DEV_SINT_ROUTE_DESTROY: - case HV_TEST_DEV_SINT_ROUTE_SET_SINT: { - uint8_t sint = data & 0xFF; - uint8_t vp_index = (data >> 8ULL) & 0xFF; - hv_synic_test_dev_control(dev, ctl, vp_index, sint); + sint_route_destroy(dev, vp_index, sint); + break; + case HV_TEST_DEV_SINT_ROUTE_SET_SINT: + sint_route_set_sint(dev, vp_index, sint); break; - } default: break; } @@ -139,7 +133,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); From patchwork Fri Sep 21 08:18:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 10609259 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D7F7314DA for ; Fri, 21 Sep 2018 08:20:32 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C8F622DABD for ; Fri, 21 Sep 2018 08:20:32 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BCB312DAC7; Fri, 21 Sep 2018 08:20:32 +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=-7.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,MAILING_LIST_MULTI,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 9F33D2DABD for ; Fri, 21 Sep 2018 08:20:30 +0000 (UTC) Received: from localhost ([::1]:54360 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3Gft-0004t1-Fa for patchwork-qemu-devel@patchwork.kernel.org; Fri, 21 Sep 2018 04:20:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47203) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3GeL-0003Y4-SW for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:18:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g3GeJ-0000uv-Ug for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:18:53 -0400 Received: from mail-eopbgr60092.outbound.protection.outlook.com ([40.107.6.92]:32788 helo=EUR04-DB3-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 1g3GeJ-0000gL-Cx for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:18:51 -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:X-MS-Exchange-SenderADCheck; bh=r7IeLeOiiH/PHGno1eDKI96TsC2EHkB9QSGwRryLKW0=; b=fU2mt0z4qq7Ok5nwg6rkI0moAtpsw0zmkSjfLEg38P+5wUYo701hhwIBmIP9sk2UN3Eg+paRm06o0oUMPQOeGqI5AenOLWisEcqbZ3lf5tIm/eMjKHTsJXVBBmaAziYfd9jB3V5aVMgTGu9UbUlOpE3mhlrqYUtghkYqJOZvIgc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; Received: from rkaganb.sw.ru (185.231.240.5) by AM0PR08MB3586.eurprd08.prod.outlook.com (2603:10a6:208:e1::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Fri, 21 Sep 2018 08:18:47 +0000 From: Roman Kagan To: qemu-devel@nongnu.org Date: Fri, 21 Sep 2018 11:18:30 +0300 Message-Id: <20180921081836.29230-3-rkagan@virtuozzo.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180921081836.29230-1-rkagan@virtuozzo.com> References: <20180921081836.29230-1-rkagan@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: VI1P193CA0009.EURP193.PROD.OUTLOOK.COM (2603:10a6:800:bd::19) To AM0PR08MB3586.eurprd08.prod.outlook.com (2603:10a6:208:e1::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 71f62644-e5a0-4395-5615-08d61f9adba8 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:AM0PR08MB3586; X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3586; 3:DxgAVJ39eM+ndHa8Pytw/+QuEAuJzi+2roYfN4t8lv93P/Lj6iw2Z7NxOXUS/yqL5VbCWCnJng/zWcKSPtWeHEs8UX11tSQaT70Ag37FUJCobPYV0bq5tHJo/+2BNlBHUtkclg4XyPXZpVE/qZvnrE0dSsY2rb9Gz/shhb0WRxLFd/lUaqpMej/mRsYXhslCRCRuEq1EIQPZudvEilUw/9AqHa3rsO6levXJmjoMAOUMjg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bpXePVA7FuldDKTyOa7L8GmjwsoMypOUEalotjGBDsYWyv+qIuBJihEnTlVgcviR/zc+Oem/fb5HoHUmvXVJdlzWYxoZko0ryreBdG/mhZ71gUDf; 4:Jujv/M0xY+DfxeOurkEBJ74mcmYJb/E9GYXz4J6LFFwI+KrE7i8znxFksFo1CeAtIwDu6uAxLLKK4NvT1W2l1SuKbcIcKc9nINskh26Oz52BpNZno/I8knAhTdSQGCgxVdhP4PqYTBDT6a+OhN9KfHiDfO9LcOJwaVFBUoWH/wY//F4rHPZl0KTC/RriL5sDjZzoH62yjtBRZfJrIHS+2TqcwGhMPuspaKEtMLNbJJg+sp2t14xXHxJSjPlnYgp1GZ1YZzJg6OE0dhfgN3gG3g== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231355)(944501410)(52105095)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR08MB3586; BCL:0; PCL:0; RULEID:; SRVR:AM0PR08MB3586; X-Forefront-PRVS: 0802ADD973 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(396003)(136003)(39840400004)(376002)(366004)(346002)(189003)(199004)(2906002)(81156014)(50466002)(51416003)(305945005)(25786009)(2361001)(478600001)(316002)(7416002)(54906003)(86362001)(16586007)(26005)(52116002)(48376002)(8936002)(36756003)(76176011)(186003)(50226002)(386003)(69596002)(2351001)(53416004)(106356001)(6486002)(11346002)(476003)(446003)(8676002)(16526019)(5660300001)(2616005)(956004)(6506007)(81166006)(68736007)(6116002)(1076002)(6666003)(486006)(105586002)(97736004)(4326008)(7736002)(3846002)(47776003)(6512007)(66066001)(6916009)(53936002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM0PR08MB3586; H:rkaganb.sw.ru; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR08MB3586; 23:RCTLrmtjMmFj97fzPg1ZpZMUDaj2hYH814oTcokSA?= /RzSLNUC54YhkYIxvKifofUMC0lVUSRFHqnmjyU8m1EB/sfloWR+RM+gC/EjJ3fUEFQRMxWXBXKpE5RVX4Cxv63p6Gvv5uyFjMVTY7rZq5+8DknbhzLEeO/1YxM0Zunhot2Qyqg/FdTCkKj60NzChwY2R163HfOybbvq8fwlXNDx7m3icaENnCO+1V9fb053+V1Ql9YmJ7MMZnc35oZ0dTfY6BD04iSJ8NSSeI3Ks5TNcGGKEdEXA2lIwOORJD2r235lJ0DXKR+YssFFd8pFoi+1GNBABCHD5o/5luX60KPMXGp4NDTsTJLN3RQ/2GIwFrohyF0gp7MNi8cKJOKIUkz/SvUj2UDNQwdyibyGGdJsh1M+7zR41vK6XJP3dckk9Fpo7d9GZ4y3yIgWF6fWS1BzZB9V6UQ1GC2rEMi/wUVu0l1/0tC8EW9h43tjG9x3WCWk3K97418T05lAROdNmKMhLtRx75l3PNXt6POX2fxTUueu+v8FRQGnPOpIR8aZNr5CuUkqXtqLOeYnnaQsundX8Yj7/pYZkwRjAxnFdnVruArD/JOBOr5jb9Rc9uLjkTMqic66UBQ6B7KjIZI6NVsrXtjtd3OcUQvDrksO/GWuJRm1YcRR8f05m+fSKO74rnO2A0BHFinIm/8X1y8D4WFlN/EuuB5Z9cZOO81mhkYcKdtiMHPhpHoMhcI2aKfVyIv3b7/8Bjob8W+Ov513byFy7VikpULJlOHpQwXa/EAr80KcbKk3A+9FCDobSOuAWu7xgRWl2xrkTjwLMIVrbSqfkY2Rzws/y8GmPYrsRL2slrh15NFCuPaa342udxXxDLB02dDdNzPMBUo1zOwDPzyuSYp9rneQs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i8bRY8r9y2E5E30q9RRnXU0ibSrO+GgNY0lG0jnEa5wufadRh2ujhXCiuYNeEMyQMSmH6xUxl3odbAg/a8hwFhs2umJvhpjMElwdZ1bXvMQYQd+nXLNJ5PXHWraHqG5A2dazz8cZk3KlcBjS+6g5S+gVtLzQiE9g2XvTwAFRAM1NCXYwHpZ3aKK5o2bD/FAdn1Kk1K+24SZ2mHx3T1YasXtvbu6hV42Q==; 5:yST1PislLbae+8fnwLX7UCo3lYJjV1y8zCjHN8sTV8D9dyEarQtiCYiCUUPG9FEvkzajP7tfDvGf4Sn/2ysNnvHl/982uPX63hmIaZt5zgTxSSJ4EV7Ls54YA8f6ZNbsyTEYxz+v4Y+XgE1zF+uf2Yb8zJTFeBFAHJpWYcaUwOo=; 7:MMisj21v1Kg7J0WcFU1WqAiDhwQvaI3LqJ6CcEjqmvZgk3KGjauxMvTbv6RW1xmjPVjS5NELj20Lb/t2e5gzKF9J0wJLLfc7sUtPah6puRnKHrIWElOblBXNEdCfGt7laGASs89HrsiBvUgZojKiGBt2zZpC5jMDCrPV9dPntXEZvT0zgURMU3/7OE8/W/EcM6txVrW4uXiHkkHbPq5X3GjZjAhMNsOACwJJfpLPtrClTl/Oo40q+v8xbLhJVSJ3 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3586; 20:zqpbb+OE9EUn3hD0lrmHbZFnxBTrnJPCyGGcb55iKTNuVc3y9Y9Ad02QtmOOPvySL+eweLipg+s+nAFv7xLQx+UtA+9P5si+yRYEBlojsOuZbaBvN9847DYrWHK++8JqALxYG0b3x2nizmTCJSzEIXjGsJfMS18PNEhxai6+d6w= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2018 08:18:47.8139 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 71f62644-e5a0-4395-5615-08d61f9adba8 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3586 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.6.92 Subject: [Qemu-devel] [PATCH v2 2/8] hyperv_testdev: drop unnecessary includes 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: Vijayabhaskar Balakrishna , Eduardo Habkost , Konrad Rzeszutek Wilk , "Michael S. Tsirkin" , Venu Busireddy , Liran Alon , Paolo Bonzini , Si-Wei Liu , Igor Mammedov , Boris Ostrovsky , Karl Heubaum Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Roman Kagan --- hw/misc/hyperv_testdev.c | 4 ---- 1 file changed, 4 deletions(-) diff --git a/hw/misc/hyperv_testdev.c b/hw/misc/hyperv_testdev.c index de07d7e8c3..e1e9ad7dda 100644 --- a/hw/misc/hyperv_testdev.c +++ b/hw/misc/hyperv_testdev.c @@ -13,13 +13,9 @@ #include "qemu/osdep.h" #include "qemu/queue.h" -#include -#include "hw/hw.h" #include "hw/qdev.h" #include "hw/isa/isa.h" -#include "sysemu/kvm.h" #include "target/i386/hyperv.h" -#include "kvm_i386.h" typedef struct TestSintRoute { QLIST_ENTRY(TestSintRoute) le; From patchwork Fri Sep 21 08:18:31 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 10609263 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2DE16112B for ; Fri, 21 Sep 2018 08:21:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1E85D2D75D for ; Fri, 21 Sep 2018 08:21:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 105362DAC7; Fri, 21 Sep 2018 08:21:41 +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=-7.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,MAILING_LIST_MULTI,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 7A5632D75D for ; Fri, 21 Sep 2018 08:21:40 +0000 (UTC) Received: from localhost ([::1]:54364 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3Gh1-0005rb-Kx for patchwork-qemu-devel@patchwork.kernel.org; Fri, 21 Sep 2018 04:21:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47288) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3GeS-0003bP-D9 for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:19:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g3GeO-0001Di-QW for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:18:59 -0400 Received: from mail-eopbgr60095.outbound.protection.outlook.com ([40.107.6.95]:38256 helo=EUR04-DB3-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 1g3GeO-00012c-Bo for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:18:56 -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:X-MS-Exchange-SenderADCheck; bh=pax2d68xuYZyaTxOSJWnO9DiqXNwqJmRO5b2znuh7c4=; b=IBehR2OPViiU0UeJABn3fuFmJeCn+ugEMXkgUU0wXJydG+8VD771877z85WDhN2ITyXAEa/rdlmsDUpkpPps5tDPUtZOS53SImQAP8CcrXovfz2lybTJHn/WeMha1H8czubXqC+UXEO8VOSwI4/CHm5FjvZc+wp52wY4kXUEV+4= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; Received: from rkaganb.sw.ru (185.231.240.5) by AM0PR08MB3586.eurprd08.prod.outlook.com (2603:10a6:208:e1::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Fri, 21 Sep 2018 08:18:49 +0000 From: Roman Kagan To: qemu-devel@nongnu.org Date: Fri, 21 Sep 2018 11:18:31 +0300 Message-Id: <20180921081836.29230-4-rkagan@virtuozzo.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180921081836.29230-1-rkagan@virtuozzo.com> References: <20180921081836.29230-1-rkagan@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: VI1P193CA0009.EURP193.PROD.OUTLOOK.COM (2603:10a6:800:bd::19) To AM0PR08MB3586.eurprd08.prod.outlook.com (2603:10a6:208:e1::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fcd01e7f-9cd7-4d2a-12bc-08d61f9adc86 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:AM0PR08MB3586; X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3586; 3:tULDxIgi9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EB++BP5E65wkEQltStp21H1XjUhADB4FttnWe2/oNa4ERR8NCZT8E5hmTsrFG6P1x7CMb4yybmspbJSRUdCkciKs55ze+fNEb2vKiRiAKKWIdX/CbW4Mbr+NiwDH9Xqg0to7u1pmGz/m+HUgRj1oIP+lgYk7Yzh3FWedg6WWKb8BeYsRI2d9PURlE620d8wDUW/6VPrcp0ukRMkCcqaw6khBbDxJkVNU87nwU7qqxB9hqylWqzF6qhpbrvUfT16op6jtd5nJbpXYDyomj/KTgFvC2iVrdUf6Ez3GIojx05cAn7B3i2kKYsqp0ZphCOhI+IEiDLGT; 4:gkLwEOfpmr1Tt9cc3WtqSm7nvgSbMDuS09SyHsD4me4kfRpB/ChBcssWdPXJmvf/P3YF2tX6SGF+jD7Uqcm77U5EoHztfElGWUFmWdAaxDZ6OCTg19gdREJDWbF3UYN97pINLOS6leuNfvpzGq7boUF9QdOs6NNg1lCxn/oJJ6nDmG9pybsfuUBADnv9oWbELzJ+PGMoiSoAr9D1Rbo6nX+diJiQUGkwhcDgr5e97hF/uCL2/GyFLo1w8aprx9rk34iH2p/0nR5i1YNnKdo94Q== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231355)(944501410)(52105095)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR08MB3586; BCL:0; PCL:0; RULEID:; SRVR:AM0PR08MB3586; X-Forefront-PRVS: 0802ADD973 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(979002)(396003)(136003)(39840400004)(376002)(366004)(346002)(189003)(199004)(2906002)(81156014)(50466002)(51416003)(305945005)(25786009)(2361001)(478600001)(316002)(7416002)(54906003)(86362001)(16586007)(26005)(52116002)(14444005)(48376002)(8936002)(36756003)(76176011)(186003)(50226002)(386003)(69596002)(2351001)(53416004)(106356001)(6486002)(11346002)(476003)(446003)(8676002)(16526019)(5660300001)(2616005)(956004)(6506007)(81166006)(68736007)(6116002)(1076002)(6666003)(486006)(105586002)(97736004)(4326008)(7736002)(3846002)(47776003)(6512007)(66066001)(6916009)(53936002)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1102; SCL:1; SRVR:AM0PR08MB3586; H:rkaganb.sw.ru; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR08MB3586; 23:/bySwZR6q70VXIYLNCb9RHmvFMxnxBJTi7U62GmZ6?= QTKOcxv/u35UED900FOLFylohPzogqkDHiW95piqMSakAfdByo5puWZujmFEH925XCvSd3PnUaTJg2zq7tmCQugFVMJMuxLBLkMAGOBW+p9jUSyeTgHI/AOfHcndM4hP8u8+Brb0euGWoPa1CkMfnYO5Wgaa67kdFl7323BHfE6Y1tWqyoG3XyWrKFu1x17hw1VSDGf239ifXliTZ+z4jyMDgQbf9xAZCoV5HXqlUQXCn/sb2ZovZVzyu0N7S6PiiwVEJ5/9P8ExRLujeuXy4AZpm85kfaF5eOi5SaydhMEha4Lx+MyEoAtS2YcKFw1gLpJ31ZJ/ZEw82Q/fuiKoABbKOFXn6qfou2vZEnInckOXfJ76nSvISgdxbw0cB0IkVSZMDSX+iozBnhVA7Prjd3MB46UAU2DxXzkCHf2FJ+d/b64MwGv37ud4fiRaClS1Vdd20DmTHxoHDsSa2DHPICd6EAH29QxcKke5uMj4m9laKgc3kkDANRRgtlYVrkC5PPWUj0oWWOvJGJlMkZho0mWtSZyUQLzBx1ZIGfBEGglPSyMRMpeAGo1C7BJfaVMBUXSuewlzW2FqXL3oXDawTEi101o54NoIh0ytkZhNUIjCONNVybU06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pPw3/K7WtC/tcD7pA5SFwbxKtsa5XfaiVBIU5/gZNPvLOAEMag= X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3586; 6:YvJvI7VBzkYwtOw8T3hDIAqLNtWHsrRc73qnVA0jb5zeSXd2v7Lbq4VXCg/NH/+NFSv32VR0npnd5tbUIOLTexNhXdWZOh1NlQPnkIgb8LpuMMEpnZUNbhMbiuWDyvNLELUqimCSKqmGMw5YnekrEu0gi7RznvWrF7trPFja6L/1Itsin9RDosj1LPQtjGTiGczYqDYCE5HipGhL/ZO4ek3qOv0B7EIfLHJW5+myw7z5XMehJpjguTexk76ReO47N93QjXoW6oljuGhOPsM7s6Fay3sbmJdO/2vkaWCF3zmT8onNi9PjDX5aed9dli5J1phAU/uut6iIPjY/BxO7HY2Qev5bchImn2BcpSfO7I1t2wgidyHxxF7e2GUVmkzkJrbjh/YUEsu47D7WRHxewyvB/LxTZ0ZCcpqVjxNTkYvRxIFSyMaCwJK+9FzD0JJgfzBo+l5dmrLJHkV6lgiQAA==; 5:BFb4S8oifOqtaxoVWNmgcVNJ7vSSbSQ7NdHzyaLuDE3FezNbNgeBjs3Yrr6ycC26XMd4PKHEyFPfBYyb8tZTLweMSlLiyja4pKz8VoMUb9a0pWOPjIkb7oVb5AVnVdiGjNNC6GKkdoiX1oWZwNUtHRfyJwoTA+SUuxNgZiOHJus=; 7:/6GMR/S1ejAPlI+UZEo5D0aXmNWfVQzsK8KVyspqvd63Ggl3HoQOAS/kar7xMAThlsP3SgciBApKqxclMeQILcWaTPD3AtU+FndNYqhVhVmyE5enG44G5K3zUIinHTsHxyAaKjKuVY6/EaO2WEHru8/8O/yRiDQohi1cQ2C+w4WxAz0gAYeb3UYp1j41xxtEymirXvYTKX7H5mlI63A0fbvSTyespqrdlzq+YoUJVKw+rI4Aw3p7/Aydse+v+V9S SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3586; 20:jeFmTHfA+vi4gJxALE0Em9CvWq9joe3bIs1hkmMctlkghOrTgLjypN/t++0XHwarJLpawwQIJJYeQ769FSdCp6VnIyrKRemt9qJULAiJDo9mAQ/fcWxLrFh/7Foj6ulmam+86vSo1QLnR1mBzSvpu2X1Gmms1vYb57Rzs766LrE= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2018 08:18:49.3608 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fcd01e7f-9cd7-4d2a-12bc-08d61f9adc86 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3586 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.6.95 Subject: [Qemu-devel] [PATCH v2 3/8] hyperv: cosmetic: g_malloc -> g_new 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: Vijayabhaskar Balakrishna , Eduardo Habkost , Konrad Rzeszutek Wilk , "Michael S. Tsirkin" , Venu Busireddy , Liran Alon , Paolo Bonzini , Si-Wei Liu , Igor Mammedov , Boris Ostrovsky , Karl Heubaum Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Roman Kagan --- target/i386/hyperv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index 3065d765ed..47368b77c0 100644 --- a/target/i386/hyperv.c +++ b/target/i386/hyperv.c @@ -88,7 +88,7 @@ HvSintRoute *kvm_hv_sint_route_create(uint32_t vp_index, uint32_t sint, HvSintRoute *sint_route; int r, gsi; - sint_route = g_malloc0(sizeof(*sint_route)); + sint_route = g_new0(HvSintRoute, 1); r = event_notifier_init(&sint_route->sint_set_notifier, false); if (r) { goto err; From patchwork Fri Sep 21 08:18:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 10609275 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id A084214DA for ; Fri, 21 Sep 2018 08:26:47 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8E5AF2DACF for ; Fri, 21 Sep 2018 08:26:47 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 820FD2DAD5; Fri, 21 Sep 2018 08:26:47 +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=-7.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,MAILING_LIST_MULTI,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 033B62DACF for ; Fri, 21 Sep 2018 08:26:47 +0000 (UTC) Received: from localhost ([::1]:54397 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3Gly-0002XF-8d for patchwork-qemu-devel@patchwork.kernel.org; Fri, 21 Sep 2018 04:26:46 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47294) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3GeT-0003cq-NY for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:19:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g3GeP-0001Fr-Bo for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:19:00 -0400 Received: from mail-eopbgr60095.outbound.protection.outlook.com ([40.107.6.95]:38256 helo=EUR04-DB3-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 1g3GeP-00012c-0m for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:18:57 -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:X-MS-Exchange-SenderADCheck; bh=5dhf6hfCBJS0hmk+iXlerSBCbX/RlcSkS0vmyMWZLIA=; b=L3tAHKVy6bRPLzmSpTHcARIftfnelMpSM7w1uXW88byRu3H2/faiOcTYeYOl1hOOXwwPFbzFYHsmpMPAzEtGMTgjSs+4K42H+89AoeMNZBAnTfetCgTcMxyE+P8Tq5MsjVNyASSLHw4yfiKP5z72O4I0cQcTNeQWjt5UOUCYICo= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; Received: from rkaganb.sw.ru (185.231.240.5) by AM0PR08MB3586.eurprd08.prod.outlook.com (2603:10a6:208:e1::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Fri, 21 Sep 2018 08:18:52 +0000 From: Roman Kagan To: qemu-devel@nongnu.org Date: Fri, 21 Sep 2018 11:18:32 +0300 Message-Id: <20180921081836.29230-5-rkagan@virtuozzo.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180921081836.29230-1-rkagan@virtuozzo.com> References: <20180921081836.29230-1-rkagan@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: VI1P193CA0009.EURP193.PROD.OUTLOOK.COM (2603:10a6:800:bd::19) To AM0PR08MB3586.eurprd08.prod.outlook.com (2603:10a6:208:e1::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 08f6e278-bd3d-44e1-618e-08d61f9ade97 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:AM0PR08MB3586; X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3586; 3:pK6MGg2Tl7pX9dbfuTXot1HiDdNupKDy/1rAEFpzj94q4A07Z6MiWrag6CDsx15/dVMGIsEHvdcgK7zNZ4R5xs5WOKaML8VZX0AM/3lGjhdeEsx7igjHQeup7JkBjtW0X4BzSe6JBQDVzqMPT6siqyO42GNr49hVsYr/+heSqqwQrsk96va1cdPBYESBb4XbUDeBs58fDZNofOkKtQrCbzkC/1AIyZdfvR1KoJls/4GUd2wBNhkHv2xMvsWJWboZ; 25:2KXKF7HgPDQwgZxeJjIuASqOVAUr74DBI52V6n7toHK5joZI4YGebqiGROxygieK9tWZm/wvhjggM9qivZpu5w3LL3Ilc0oGDanv6HpuXk29xjLIlWkVPtVVNrzfp963h56uhDISkCubffz0BVEwuHFXLVit1TTWne8LFDX7pGlkeguRz2Mm+dm9GhFgXzx4IymOLvluu5+pmisN9/MKeTJAsjK8SoYU+k/KxhRDAZHIH4LHfzsmVLodfG1qaYwzUH9hbkbflWZmq854h+U9RvuYGBK+Syu77MgVTpxRyjCYHYFff1NTzKUAQ1q4300rBb/NBvDnu8twC5OZwYU1lg==; 31:jy3j/a4dVPjslZOhHb3W8U/uq3cz1WpQcGkcJ/iLoBQfAxyG+8otkRjHNAsxqM+MFWXU4UgXF9t4M8XkonyI/2Sj/ytPLzmCclPdaTXH0qDNCCZN+iYCxSsDnIK8UOwB7eYXnglEpUZYMSprEaMGD5Ymu9YycsqWGDHMoU6klAq3N3PplKWd360XF/lEWK1xqMAH9OBA03V3q5C1aB0vpIDf1Qm0fJeFZHxthlRy9BE= X-MS-TrafficTypeDiagnostic: AM0PR08MB3586: X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3586; 20:q1PRQqSsMNzpxlBwNVN3dru6CP2iq44Sq6u8JEWgYmOd1mIHdHHwjqFZgB7BRNQC8CVwfgSdMAsCR+TNG8Go+3+HyMIR+qLqRrlL/cKkDmBxezjxX7r1uS7zPFDbLuGTJgBWsjrJb967mes2tTX9cM9kfZGgprEgjnmRHVoegs06qQMK9NivwqF7twIwZ0v1App6b0DpvgBcIxSDyInJNFOOO8BA96ABJMjpoh33f8x6WThOuGbFd+UF9zShO9/tZftCEO4+iH7wl0umK32KV+AAROpriG+BY8+CbNczmgtvLCloAoZTgnusCXxhzBfG2oZZEJ3yf+KRHEfrp6ETcBYMDHlIYm2KfoEuUbuogaOcj3mQ2BxkFUUOZSK/lMW/TohBrYvC8J06DoVIHh9gZfHlgaTtEJgeFUYMb/J67FH5xu0OCcgv4L3C+9sMw+py078kI2qYwlZZMVkOJS2viwyz46h2OL2o23XoN3sHo9zUpbPoczLSuGceRgTc2R6h; 4:Lc3VS1AsxCN2rEq5J7MqgozFhnNDAMbEe/6I3U9RgiWDbZ6h4Y1p7X/GaqCX03G4cBn/NCpVanvmYVMcDotBdg3my8Sg8jp5djEL6TUKHOFGqNNDc1kILmHaEUVh031I14DQBeD5jT+yKdU5MviESXb/adu+CGnI521vxLSeNvamYrYLQWkqTee/km62JL6/lkFssO++PZgUPHNZ7VApTBkhhJElnSkij7iIdiSZRg/7HbYr7nJFJpfTVEXainYQIUsQa6Yj7qaD1NrYh0DFwQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231355)(944501410)(52105095)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR08MB3586; BCL:0; PCL:0; RULEID:; SRVR:AM0PR08MB3586; X-Forefront-PRVS: 0802ADD973 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(396003)(136003)(39840400004)(376002)(366004)(346002)(189003)(199004)(2906002)(81156014)(50466002)(51416003)(305945005)(575784001)(25786009)(2361001)(478600001)(316002)(7416002)(54906003)(86362001)(16586007)(26005)(52116002)(48376002)(8936002)(36756003)(76176011)(186003)(50226002)(386003)(69596002)(2351001)(53416004)(106356001)(6486002)(11346002)(476003)(446003)(8676002)(16526019)(5660300001)(2616005)(956004)(6506007)(81166006)(68736007)(6116002)(1076002)(6666003)(486006)(105586002)(97736004)(4326008)(7736002)(3846002)(47776003)(6512007)(66066001)(6916009)(53936002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM0PR08MB3586; H:rkaganb.sw.ru; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR08MB3586; 23:iuD2rTLgvj7N1uwngqMX1oT7N1LoQs713FOzIVojM?= 19xz4RvuSxgKUrI5XPHQLcAgoR88ScEMYfArpXCSOnIVI/CSd+nJFE1kuoH9wTJtXaDWuuO2fKmpjIuu2GBa9wGlOUNLYlsqz6F96Y102T6XiG1hMeASTWNU7vBVk4xbA/bcgYfvuHUtzWgSVEErrepybufr5KTdxL7XRi/lsJbnEvSTCDZrh5XLIuJm/oZue2mCTO6xjkWAMUi+zK7VeVHBRlMY8/JFR9Jf6Pr5oDaEjiGXyseaU0W7R27jEFgMA+sGbVeHS8bn58kEMx18v9UtJa71LkxRmvrbFoVQ21cxfXoz+lDCLep0BlR99cSecXey1HfzOGb9XBja7wcWgLpijSzoSNu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xdUohm7cNbk0HH/9qfiezYlU2gS+6cI2G/3nj8lHAtMTYwc3kCp85aX4yXiBaC8oQTouAlTEiPV4FoaOC1AELS6DcnDW1PTTKpvJFO2K1DWc4VuZbMHMGApF58 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3586; 20:LoF65GP+CsoS0Gni8Fg0NX3aVGJhE8J9FDudzvI79oJpFh7e9213EEHmSbuYK4VXxavvFQJ36/IR62QvJ27p0bwcR+nqWB/gv0iCVI+yUbSB2I61XaxQOnoYuwpnH85ttGRUkCEZT2Aalx0GH+eb7J+K+4V+q/ioZsC7mh+/IkE= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2018 08:18:52.7515 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 08f6e278-bd3d-44e1-618e-08d61f9ade97 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3586 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.6.95 Subject: [Qemu-devel] [PATCH v2 4/8] hyperv: synic: only setup ack notifier if there's a 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: Vijayabhaskar Balakrishna , Eduardo Habkost , Konrad Rzeszutek Wilk , "Michael S. Tsirkin" , Venu Busireddy , Liran Alon , Paolo Bonzini , Si-Wei Liu , Igor Mammedov , Boris Ostrovsky , Karl Heubaum Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP There's no point setting up an sint ack notifier if no callback is specified. Signed-off-by: Roman Kagan --- target/i386/hyperv.c | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index 47368b77c0..acdb0ca9df 100644 --- a/target/i386/hyperv.c +++ b/target/i386/hyperv.c @@ -77,15 +77,14 @@ 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); - if (sint_route->sint_ack_clb) { - sint_route->sint_ack_clb(sint_route); - } + sint_route->sint_ack_clb(sint_route); } HvSintRoute *kvm_hv_sint_route_create(uint32_t vp_index, uint32_t sint, HvSintAckClb sint_ack_clb) { HvSintRoute *sint_route; + EventNotifier *ack_notifier; int r, gsi; sint_route = g_new0(HvSintRoute, 1); @@ -94,13 +93,15 @@ HvSintRoute *kvm_hv_sint_route_create(uint32_t vp_index, uint32_t sint, goto err; } - r = event_notifier_init(&sint_route->sint_ack_notifier, false); - if (r) { - goto err_sint_set_notifier; - } + ack_notifier = sint_ack_clb ? &sint_route->sint_ack_notifier : NULL; + if (ack_notifier) { + r = event_notifier_init(ack_notifier, false); + if (r) { + goto err_sint_set_notifier; + } - event_notifier_set_handler(&sint_route->sint_ack_notifier, - kvm_hv_sint_ack_handler); + event_notifier_set_handler(ack_notifier, kvm_hv_sint_ack_handler); + } gsi = kvm_irqchip_add_hv_sint_route(kvm_state, vp_index, sint); if (gsi < 0) { @@ -109,7 +110,7 @@ HvSintRoute *kvm_hv_sint_route_create(uint32_t vp_index, uint32_t sint, r = kvm_irqchip_add_irqfd_notifier_gsi(kvm_state, &sint_route->sint_set_notifier, - &sint_route->sint_ack_notifier, gsi); + ack_notifier, gsi); if (r) { goto err_irqfd; } @@ -123,8 +124,10 @@ HvSintRoute *kvm_hv_sint_route_create(uint32_t vp_index, uint32_t sint, err_irqfd: kvm_irqchip_release_virq(kvm_state, gsi); err_gsi: - event_notifier_set_handler(&sint_route->sint_ack_notifier, NULL); - event_notifier_cleanup(&sint_route->sint_ack_notifier); + if (ack_notifier) { + event_notifier_set_handler(ack_notifier, NULL); + event_notifier_cleanup(ack_notifier); + } err_sint_set_notifier: event_notifier_cleanup(&sint_route->sint_set_notifier); err: @@ -139,8 +142,10 @@ void kvm_hv_sint_route_destroy(HvSintRoute *sint_route) &sint_route->sint_set_notifier, sint_route->gsi); kvm_irqchip_release_virq(kvm_state, sint_route->gsi); - event_notifier_set_handler(&sint_route->sint_ack_notifier, NULL); - event_notifier_cleanup(&sint_route->sint_ack_notifier); + if (sint_route->sint_ack_clb) { + event_notifier_set_handler(&sint_route->sint_ack_notifier, NULL); + event_notifier_cleanup(&sint_route->sint_ack_notifier); + } event_notifier_cleanup(&sint_route->sint_set_notifier); g_free(sint_route); } From patchwork Fri Sep 21 08:18:33 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 10609271 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 57350112B for ; Fri, 21 Sep 2018 08:24:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 469022DAC8 for ; Fri, 21 Sep 2018 08:24:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3AEBC2DACA; Fri, 21 Sep 2018 08:24:39 +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=-7.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,MAILING_LIST_MULTI,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 E70A82DAC8 for ; Fri, 21 Sep 2018 08:24:37 +0000 (UTC) Received: from localhost ([::1]:54379 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3Gjt-0000K1-5h for patchwork-qemu-devel@patchwork.kernel.org; Fri, 21 Sep 2018 04:24:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47295) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3GeT-0003cr-Nb for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:19:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g3GeP-0001I8-TT for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:19:00 -0400 Received: from mail-eopbgr60095.outbound.protection.outlook.com ([40.107.6.95]:38256 helo=EUR04-DB3-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 1g3GeP-00012c-Ip for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:18:57 -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:X-MS-Exchange-SenderADCheck; bh=knKmy0Nd+HZdvg5w/Bl6VB0hAm025ycs7XHsvbHmCIM=; b=LlcKyfgImYZCR6VkO4kvZIIKpl9bL19BkwO7/zPANgydmS1kZxiKQIP+1PAxsYpWLeGIWiOjT/R2kcbO4Bj1VU2jla5bxJ4Rb+KIQN7iI/mEiGkMJ1t83zf8M9KrxerKHBOtqQJhltbZbzw9HGFXaiTDqWq1sWyH7Mz4r3wsy7o= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; Received: from rkaganb.sw.ru (185.231.240.5) by AM0PR08MB3586.eurprd08.prod.outlook.com (2603:10a6:208:e1::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Fri, 21 Sep 2018 08:18:54 +0000 From: Roman Kagan To: qemu-devel@nongnu.org Date: Fri, 21 Sep 2018 11:18:33 +0300 Message-Id: <20180921081836.29230-6-rkagan@virtuozzo.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180921081836.29230-1-rkagan@virtuozzo.com> References: <20180921081836.29230-1-rkagan@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: VI1P193CA0009.EURP193.PROD.OUTLOOK.COM (2603:10a6:800:bd::19) To AM0PR08MB3586.eurprd08.prod.outlook.com (2603:10a6:208:e1::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7b23f8c3-6337-4a4f-8091-08d61f9adf77 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:AM0PR08MB3586; X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3586; 3:FnjOQK4MgwU0QRhu4o2I/D1Pk++zxqyMHhkwTWOoPY0Wmi7B8cyT2cna1hrg7P7Nooix2K4d92v4IHzOT69Mqo5QqXlyJru7mApFVMyTlIUBVnwIkuEpuZjF69gU/5UI4VqbEwedQtIKm8ADrB78FegaY3tQZFaDrD96LHCgzwP9olD28nLoe+r+MllnRkk6RP2n6dgh85CVbi4/yZwJw0Go8J1OXf5U/GD0a+kNUXYWxGedI4eLZr2u53+0bLKf; 25:ClSB76O4izAUghjLjzhUaX1FtlDYju4Lhax10p7mKQXM4JSRfRrwGBGohmzdWQxNUhQlLERv2ZU8g/HHzShWfZGXfWr8rGoRMjwQ05zwv5QZfLYf1Pyq6JMikK0Wti+h/1TtcNPPb5zCfl0zkV2XEaf7I2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2N7MkdKdF93R9nZr8zd8XmIJjJ4nGQcu4U4ZUXXflJR1t2igULwQZtussPwho5TtDUtzjeNdLNq6a5h3IHHrdVDd8SMFfjL+cORTPCPcKMgNlCOzrfUHGUYIybFB2bBRSqUPWbMNj2YEIauGO8BaRmDAQbOLAMy6OYMeNSSynkxD1B3AkI2Fumql6G/pySxkbQeIZN8ApQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231355)(944501410)(52105095)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR08MB3586; BCL:0; PCL:0; RULEID:; SRVR:AM0PR08MB3586; X-Forefront-PRVS: 0802ADD973 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(396003)(136003)(39840400004)(376002)(366004)(346002)(189003)(199004)(2906002)(81156014)(50466002)(51416003)(305945005)(575784001)(25786009)(2361001)(478600001)(316002)(7416002)(54906003)(86362001)(16586007)(26005)(52116002)(48376002)(8936002)(36756003)(76176011)(186003)(50226002)(386003)(69596002)(2351001)(53416004)(106356001)(6486002)(11346002)(476003)(446003)(8676002)(16526019)(5660300001)(2616005)(956004)(6506007)(81166006)(68736007)(6116002)(1076002)(6666003)(486006)(105586002)(97736004)(4326008)(7736002)(3846002)(47776003)(6512007)(66066001)(6916009)(53936002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM0PR08MB3586; H:rkaganb.sw.ru; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR08MB3586; 23:llQ/1GKzHn9D8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mk1naxDa6j5z0JPqU+/zU07/lMoZiZuz14S3TY18mQse1XjO37H5gy9eOVMJ0YaIhqbKg==; 5:vX2oIvle1h/d/Pnb7ttMex5V58YSCuVR8merv8C9ovhd02JU67lB563fLooClVcTTx2ZvZ+myBMbi4CdBtncM5lnoK/2cGwRp3M7T5/jfqXP2F6QGK+ahBJ6MbDOYUF3KLIm7adVj0Afx5h4bm1pxd2CmVvcLwvZhcwy4j5LEcA=; 7:myd/gT0rxBI32aREwtoh3qHQnMsc3St2tFbjKhDxTzetq34m87dXvxzSAVgZt815L9dUxIV8+3SAesRrzZKi2VPzO2np+D5b25j0FAioQj2ECUrRgcg9/cqJTiU/wdITxplQeTxyqZtcvUTNzntcAWgbbfQKBzs13InLCu+g8PYbjHNqX1T02c9m5EAsWt2saD/sVTqFzdHI7H6fJ43qsk2vZqUoHoSs9Fj5AQ9jTvxYUCcLCZZ1WqU23dVfU2zj SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3586; 20:qjh+mtoP4ETRymNATD6mK9wDhQRXVmN0eJG8lhEhOsq2qUW17UetYuI/hZeqlaRr37qFf9YT/+cgJnYrOxmKD0J+o8QCTbzcdGCoQDJGSql06usZQ7SxoQfLNIbV3HJT645gYuojSYHI0wAqZ5bZMDjnEGk3ItWYCmNk/ew+XCg= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2018 08:18:54.2985 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7b23f8c3-6337-4a4f-8091-08d61f9adf77 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3586 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.6.95 Subject: [Qemu-devel] [PATCH v2 5/8] 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: Vijayabhaskar Balakrishna , Eduardo Habkost , Konrad Rzeszutek Wilk , "Michael S. Tsirkin" , Venu Busireddy , Liran Alon , Paolo Bonzini , Si-Wei Liu , Igor Mammedov , Boris Ostrovsky , Karl Heubaum 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 | 15 +++------------ hw/misc/hyperv_testdev.c | 2 +- target/i386/hyperv.c | 16 ++++++++++++++-- 3 files changed, 18 insertions(+), 15 deletions(-) diff --git a/target/i386/hyperv.h b/target/i386/hyperv.h index 00c9b454bb..ab99047bf8 100644 --- a/target/i386/hyperv.h +++ b/target/i386/hyperv.h @@ -16,24 +16,15 @@ #include "cpu.h" #include "sysemu/kvm.h" -#include "qemu/event_notifier.h" typedef struct HvSintRoute HvSintRoute; -typedef void (*HvSintAckClb)(HvSintRoute *sint_route); - -struct HvSintRoute { - uint32_t sint; - uint32_t vp_index; - 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 vp_index, 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 e1e9ad7dda..6f4fa2ab91 100644 --- a/hw/misc/hyperv_testdev.c +++ b/hw/misc/hyperv_testdev.c @@ -52,7 +52,7 @@ static void sint_route_create(HypervTestDev *dev, sint_route->vp_index = vp_index; sint_route->sint = sint; - sint_route->sint_route = kvm_hv_sint_route_create(vp_index, sint, NULL); + sint_route->sint_route = kvm_hv_sint_route_create(vp_index, 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 acdb0ca9df..11fd1add2c 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 vp_index; + 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 vp_index, 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 vp_index, 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->vp_index = vp_index; sint_route->sint = sint; From patchwork Fri Sep 21 08:18:34 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 10609267 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2B1AB112B for ; Fri, 21 Sep 2018 08:23:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1B1A62DAC8 for ; Fri, 21 Sep 2018 08:23:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0F8372DACA; Fri, 21 Sep 2018 08:23:49 +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=-7.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,MAILING_LIST_MULTI,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 96AEF2DAC8 for ; Fri, 21 Sep 2018 08:23:48 +0000 (UTC) Received: from localhost ([::1]:54377 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3Gj5-0007z7-Tt for patchwork-qemu-devel@patchwork.kernel.org; Fri, 21 Sep 2018 04:23:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47296) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3GeT-0003cs-Nf for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:19:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g3GeQ-0001Ka-IG for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:19:00 -0400 Received: from mail-eopbgr60095.outbound.protection.outlook.com ([40.107.6.95]:38256 helo=EUR04-DB3-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 1g3GeQ-00012c-4E for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:18:58 -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:X-MS-Exchange-SenderADCheck; bh=YaMqlj5x28q9zvO9ESgZHi5WvK0p3pWJbDefBw+EBOA=; b=T/wJ3nlm8KakYh3w+0EkN03EZaWGvhaokSJ/1A3Ol1SeP8NCR1qTkcAfEkkafYsDXf2QyHKvC4do1OeiRDQ9ONEn0lZr8OnKRvS5QmYkmpGLCHYESEDVXf4oy6GN3WpuoApXMF5N3trpN3pMVYCp0FzwWCndOPTUUohpTe8/1bU= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; Received: from rkaganb.sw.ru (185.231.240.5) by AM0PR08MB3586.eurprd08.prod.outlook.com (2603:10a6:208:e1::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Fri, 21 Sep 2018 08:18:55 +0000 From: Roman Kagan To: qemu-devel@nongnu.org Date: Fri, 21 Sep 2018 11:18:34 +0300 Message-Id: <20180921081836.29230-7-rkagan@virtuozzo.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180921081836.29230-1-rkagan@virtuozzo.com> References: <20180921081836.29230-1-rkagan@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: VI1P193CA0009.EURP193.PROD.OUTLOOK.COM (2603:10a6:800:bd::19) To AM0PR08MB3586.eurprd08.prod.outlook.com (2603:10a6:208:e1::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 4f7859a1-1554-490e-3d38-08d61f9ae055 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:AM0PR08MB3586; X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3586; 3:Sx2KZ6GsPysOKsRmGqdg0H0snNfYt8fQ6/2XtFg9qQfbg4TDwF+2sqo472NXUG77CIljwrhGDXVf9UQx4IXX1VDts3gbUhxU4/zDjyq3sZ+wSjFNaw8ndon+OWT/A6Ob/l+euipcTbbf+y82lqXjFF5v5ZihJa/YUZw8NcowWsYCiF7s0u/GesiFUhsNZ+7tQKdwdDeO08orn5KHBNeiJEfEJMF4lKZNWYr/w6Rl25craOlRX8LT7h1W4xBKftsj; 25:SfWOjqFBkhL0QKZtwaJ5On2wrgVR0TBkaVNymahX3TfdRnx0SHlw/0jRTzDlhiusrJo9wKk+Pm54XlYK3+zD9yDYlvidlplOWNENpCJDAXe42AsE0JUtYlXT0YTMKNnwYr551zIGDenS+tTq3omHsOCHW5XWS/TM5YBz1Gl+NZWVJV1zkqTWoRmqI7tCz8y4ktV4PbwftLppFWLgFG1RDWNFGUSevOy/MlPZHhLHe0QlOY9uIZhUg1omCLHTNJ4mqPZmjoUsBqxVpdHoadIqPPaaN4mQ98r2E+wKZr914pwiJRJnyKvLGd5SZuFyfS/TnCc/TQRJBlGXR1JyzxW/yw==; 31:zKbC1fNXZ0GG/yl4KY1oeL/2ssn8whxmC75KKfdw4iV4nm+wVi8WWBfKDmdHOJ9Jk2IGnydBt0VwBvFH7PAdTjje4FEnLCl4dAStoYhmYKUVg5tr2vsspGTpSTtXE4W06O3+yhtlc8anfNo3aFJC+UVNQhhRMphvTNdstGC4b4/zhfIdunAgMLYpUbFwkF+cjCDyFBsxA1YKxMkYEGJtfN4dtwqfz7S29oFRHQievUw= X-MS-TrafficTypeDiagnostic: AM0PR08MB3586: X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3586; 20:PQl0icBjUzFUH4an525KH7ZpVFgR7pssc2P17kB9/j5xqsjcMhIWh83kwFDZbEzoBJ7W9g/CwlKQIFyzMBhT5JnyYq38C9uThtrziScALtAubwMkWaqwutBBGQJraRrx62T/Lo7jREdslJ3eBz9eW0Aug7DI7iShYGe27iT+V5JM+gsH3iXqVdlZjXAfv4uKA3ygmC9hapD10PwmxCFjKr99t3NYANe/Q9bLltHyDMqw7ZbW6fLPggup0NzDWfEMeMSZTSiq8k7SjB2VHKaiv2hFVprtIhAV1kvOCLz77p+tfDN9YGPwWqyaLkC/Js/IwWfE1glysLZeouBjFL/19aQgn8qW/QfJkmRcSf/tXAWPx5OGiAFVw2NhLLu4+WobMmW1+sy3/6r6bWiPQEYLxkdXP/KuCYplc2DTzT4QmFifl4kRLrm1S8/hGrai7T/C5aq2jAnHdCxmndYz0pB0ILs7Me9ydfxC9LQUXuAzwMBjDFe/ShphTG1VLbX9rUFP; 4:75gvYx5OyAwyp9GEM7UYc4f5XfrNSzzu/WtsOL6+NXpac3c+tlFDXl5vwBX6c7Zh3UrZfWrqEWJyPmcAMMUOIh7extpZkaCzUbCxMSafzC4w5hqjFCMuBA2RhxXRv23aAap3mWwZzoHbhxu8Gi2eWqVKDwG+0A3S2fCT64n/3XHhgVSrYRlSOAOoFabG2rvEYQyHTFz/vZgzRTdFUMojPHao0rGUtS7Oj93AiaUx+Wi46iGTtU06iKdcKXZHXRq6e1bX/lAjnPDP5dy6msqO+g== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231355)(944501410)(52105095)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR08MB3586; BCL:0; PCL:0; RULEID:; SRVR:AM0PR08MB3586; X-Forefront-PRVS: 0802ADD973 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6029001)(396003)(136003)(376002)(366004)(39850400004)(346002)(189003)(199004)(2906002)(81156014)(50466002)(51416003)(305945005)(25786009)(2361001)(478600001)(316002)(7416002)(54906003)(86362001)(16586007)(26005)(52116002)(48376002)(8936002)(36756003)(76176011)(186003)(50226002)(386003)(69596002)(2351001)(53416004)(106356001)(6486002)(11346002)(476003)(446003)(8676002)(16526019)(5660300001)(2616005)(956004)(6506007)(81166006)(68736007)(6116002)(1076002)(6666003)(486006)(105586002)(97736004)(4326008)(7736002)(3846002)(47776003)(6512007)(66066001)(6916009)(53936002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM0PR08MB3586; H:rkaganb.sw.ru; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR08MB3586; 23:8K4cROZEk5D2TonnGfZtRclfdugTpQUFniRApEko5?= xLJLhjNArJCqWosIdF/JtaEVdaZUMjMIHmh5Dh7CKOMQ5wqg2nE/ljbX2+bxw9cx35kHLNzZKJkzoO2TEmamsea7LMn/cDFX5LVVhlnHI0gzoABco5a3c8kKK4vL8gOfq6cxiRc3RcRfqebjeF9FeD61OjlrwKo0GaNJX8xSmylBvMvgi0yahW4FSRX8IuBIPOlSsatS+D4V35p8RWPOSqGbG3YL5ph4octvTIPkLp8wemhvUkKG2uoTXSfsIIRkfxDExxf7p8jgki/cT7p39wSPaJv1a6oKsR1hoRdHzujKPebMwryUT3deFtvnkU+6OUeCA+nldWXi6Jyp3HDBZ7uUGj14Ud20XUJf0h4XGvZxtL5TGCJv1xJYm64R2FQ8oJeyIL5wgQD+1uNg6RTsf4hpGDeIZlD/7J4pF2cBdDy6RVZQ1MnG3bbr7YuchmAvGwY2dtEkCgq87dfyx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kyBtgWVfesY3EaRPAuduk3ZNVHLzvrCj SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3586; 20:F/7AzNOhIYKX816uc4LTk5FFbA5NuqKNEMUeH4h+ZVAkXbwyPVgArSY+BfU8EoMJOMILCxNYScHe0AA6zOQ8WzqFDc0oLhpgsOLwvips+G8Gt0fJqVTP6qcLZowpgYWt0zJKYRsR8MKWmX1eK1OfJ1FT3v7paxEKQ82ZqbVwE1E= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2018 08:18:55.7516 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4f7859a1-1554-490e-3d38-08d61f9ae055 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3586 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.6.95 Subject: [Qemu-devel] [PATCH v2 6/8] hyperv: address HvSintRoute by X86CPU pointer 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: Vijayabhaskar Balakrishna , Eduardo Habkost , Konrad Rzeszutek Wilk , "Michael S. Tsirkin" , Venu Busireddy , Liran Alon , Paolo Bonzini , Si-Wei Liu , Igor Mammedov , Boris Ostrovsky , Karl Heubaum Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Use X86CPU pointer to refer to the respective HvSintRoute instead of vp_index. This is more convenient and also paves the way for future enhancements. Signed-off-by: Roman Kagan --- target/i386/hyperv.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index 11fd1add2c..0ce8a7aa2f 100644 --- a/target/i386/hyperv.c +++ b/target/i386/hyperv.c @@ -18,7 +18,7 @@ struct HvSintRoute { uint32_t sint; - uint32_t vp_index; + X86CPU *cpu; int gsi; EventNotifier sint_set_notifier; EventNotifier sint_ack_notifier; @@ -97,6 +97,12 @@ HvSintRoute *kvm_hv_sint_route_create(uint32_t vp_index, uint32_t sint, HvSintRoute *sint_route; EventNotifier *ack_notifier; int r, gsi; + X86CPU *cpu; + + cpu = hyperv_find_vcpu(vp_index); + if (!cpu) { + return NULL; + } sint_route = g_new0(HvSintRoute, 1); r = event_notifier_init(&sint_route->sint_set_notifier, false); @@ -128,7 +134,7 @@ HvSintRoute *kvm_hv_sint_route_create(uint32_t vp_index, 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->vp_index = vp_index; + sint_route->cpu = cpu; sint_route->sint = sint; return sint_route; From patchwork Fri Sep 21 08:18:35 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 10609297 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5CD481390 for ; Fri, 21 Sep 2018 08:33:52 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4C9A12DC39 for ; Fri, 21 Sep 2018 08:33:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4097B2DC74; Fri, 21 Sep 2018 08:33:52 +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=-7.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,MAILING_LIST_MULTI,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 B54F42DC39 for ; Fri, 21 Sep 2018 08:33:51 +0000 (UTC) Received: from localhost ([::1]:54440 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3Gsp-0001Vk-12 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 21 Sep 2018 04:33:51 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47353) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3Gee-0003nq-6F for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:19:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g3GeY-0001tC-8S for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:19:10 -0400 Received: from mail-eopbgr60096.outbound.protection.outlook.com ([40.107.6.96]:37218 helo=EUR04-DB3-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 1g3GeT-0001PN-9c for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:19:02 -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:X-MS-Exchange-SenderADCheck; bh=AcsYx8foBgvx/V5k28nBAbaWlzot46cEWIv+9d0O0rQ=; b=JgFiB9w+95YVZtr06VIvxYMJ4d/ro3oSEi7uTZQdn8X+hTNfbry/4VufFLNoKctueAh6Ai1QEyXRnn9S+gVeXYVng9b7/ciqsXljBbQ1TE7nOMkHuI+W3vqFXYg2CcqGr6lGDYn4AMwSUSPaAurpxjVaVMcSRBq/C4/F7/LPNzM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; Received: from rkaganb.sw.ru (185.231.240.5) by AM0PR08MB3586.eurprd08.prod.outlook.com (2603:10a6:208:e1::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Fri, 21 Sep 2018 08:18:57 +0000 From: Roman Kagan To: qemu-devel@nongnu.org Date: Fri, 21 Sep 2018 11:18:35 +0300 Message-Id: <20180921081836.29230-8-rkagan@virtuozzo.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180921081836.29230-1-rkagan@virtuozzo.com> References: <20180921081836.29230-1-rkagan@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: VI1P193CA0009.EURP193.PROD.OUTLOOK.COM (2603:10a6:800:bd::19) To AM0PR08MB3586.eurprd08.prod.outlook.com (2603:10a6:208:e1::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: df65d1fa-a8b6-46a7-5c44-08d61f9ae135 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:AM0PR08MB3586; X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3586; 3:oRYJAenL0qVLpKHNiVyVjONUa66LE8Lba/tAAOn34BXBdNQX/SFdMGodYIj8uMc+BFPA6Ro1/cC8zCB2ecgWcSmxR/G5xoOKe16RvVD7sfftzMvSWQ8L9gviAnlN5vE2IVTxNggl3iOMHkE7rWsR36OmUrOwQLSH1fJ9/vWdUBF5PYucU0/jMLqgNPqnuavEG5gcxAfkwt5knnH/VO0a2guPzaWko7gfaYCN0cy1uWfitok0oGMgO8hm22DIUg1H; 25:Vcz78wjwuOQZnLyBOqV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gy1is32VHWISQzfL4ellta6+8iHtkW5soluje1Yt1eWKQ9leIa17y0pX5Bd4//DzPjeLhyREtKOR4; 4:QfyZaV3X8gItlJdnGgtVeAwdzdlbg2fSST6Mjmgi+kp/eFGBkYsiUWCtuUmcaj1Rlr/1C/d/Q5R/ZYB9kZNtO6s1DfuyoQCMDVH89/o6vGxVTr0qoxlV1pXDwcF1efM7ygWWnwSU+Y2LAx8TKD4zvM2kVWoRwsXAnnA6rkllKmetEGEWUks4wx50NCqrFrWwXNDNVGSkIg7fvjIr4ejIfiBfrGbg19/n4jen6KsSVZw06SIwpbKg9O+zrENRzQ5iejmdi32hJPHMXCbzskGbAjkK/zw318H1vOqc9PkWkMkaTNNYTmLu/1EQ3XWiCGfT X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(60795455431006); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231355)(944501410)(52105095)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR08MB3586; BCL:0; PCL:0; RULEID:; SRVR:AM0PR08MB3586; X-Forefront-PRVS: 0802ADD973 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6029001)(396003)(136003)(376002)(366004)(39850400004)(346002)(189003)(199004)(2906002)(81156014)(50466002)(51416003)(305945005)(25786009)(2361001)(478600001)(316002)(7416002)(54906003)(86362001)(16586007)(26005)(52116002)(48376002)(8936002)(36756003)(76176011)(186003)(50226002)(386003)(69596002)(2351001)(53416004)(106356001)(6486002)(11346002)(476003)(446003)(8676002)(16526019)(5660300001)(2616005)(956004)(6506007)(81166006)(68736007)(6116002)(1076002)(6666003)(486006)(105586002)(97736004)(4326008)(7736002)(3846002)(47776003)(6512007)(66066001)(6916009)(53936002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM0PR08MB3586; H:rkaganb.sw.ru; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR08MB3586; 23:ukeK24LFoWFELVKEa3Dray43YCiONHOfBitpnXOOP?= C1JkrYmsBrS3lEL2DjSyrfsNKGQMii+L2kMeGQSJvTUtJWg5AyXA2JJLiSPH/bIQC5865w61HpCe51eUSZNpynfadoLE91gWsHEPfGocIUKihP4Yvc9I+Z3yK/qnMX8Q8d3FCUos2wKsJDstL4W9yocseBuZc/P/ZvFmCowjo0YEGEXqqJXWAxWCHz3VCnyCBxLLsiD0naREDBVQC6lfX9Yeb8R2fmS1/0/gVZFBvvNtsBd3kmDkMIabSQ6XG6sJb9Dex8Z79VM43ASd1qnxRE/9VfYjsNeo9+pujX3r8ml2FMdXNXbXZmMhWSGGiJ4brLg1NkS8GLdblL5XV50WGf4wvWuXgYUYINeNN0Sdq6HklwnANFpeERzOtcV8tbgH1q6w/jDXC4qycvVfEq2EsVfRbrq1kVV5Ww/4ZFCcjt6xoLSo9q05L9M00n3zxiR2dUiFaz7fwJjawYX+S7U2M3DM+/qD1mIG4J7O7Mm4ThjWvxvulvgceUeyFAbfh64MXJBL/kIVKw/Ma9N5icSWauXkaPFgugy6qDNC4DZ2htm4wsk+n6rOi3ZaPscg5uSLFveHpR/j8umhcjSG+cSxGB90tCjko48F7SWP4NOxf2U9qExlUuUHZ/JMFaLTZTxhTAedmlPp3PZCe4isIBTTKoFoA4fM0K02a2nkhfStJ/EGiVmosqzlLI60brR3qKtv0CVVHTeye3sOEBLoDS1bV32TnXBia4jLgFvANrLyJhY2dbA1UBjeflABZOaA795ifyPr/3BO7XtQHpAO8f4kkmwe11/3bxHufhmUsxDRMHfpZeF1R6/f2W6tV9QS+J+m+l3rcDVLMmXfga0tWdw9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ng88fRNyEQXXST+S3H2Mtc5torErzkAYz7nda3S+3zXYT67ZARxWd9wNwp+++Sal61qTBDG/QhoKjyNrlTOADrUZfHaqLTphtfjrQbwClsetULAKwmHw7Gs4bbPCstp1k0g3Bkh+UCbEK+63frf/GKulT7j3z4QAIrF2C+AuDpzK72Pzr+Fobg91KxcIvoOeAITteSt9sgPFeLvC9dF5FmLIZop1AHRj/7yWYSmJC06zThz+gNG/DXDbAzhS8g==; 5:fcQK8REi3X+1BlWv1s+SEAG+S+EaXTlLJmPm0cTaoDPia8udX5wgo1A29yq0s2yHPjjp5FS+ow/EVTJSwLGCjoZCig+VHSi06Sz4IrIIYziePe7oPSgVwU6Bi7W/hLVxMGnicBr9wJvapQZqKxYr2wSWcTiLEseoATB6IARdSVE=; 7:XVISgYeuF7GAoO5DOumVUHnz3Jrkud54HjivNqq3tYHHYMop3dWvRphR0IOa46RvD5slpltW8yECopwHC6FunLp2rDKAFUylossa8LoBsI8c0Ag/RBXWoAmj1FP1HE2bmk1ETBJlGZDRbv1fNiBK5vLspEqWkmwl4UZzGyRHuxhfBoOMjqhmyJSm0+L0FADrJ3x8upday5bJERYJLosU9ydz5M631Bs/Rt3WIZbtWG7fDhhxZXRSVsq8PXZ3op+N SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3586; 20:MiBgCIBifJXmw4JVSBDmF/zVPPl6J77PJiCIo25VxHJujlDLvSC5B7dDToLfYlzZSwlY6nJ1JtRyrGSgz6Gmu11dUQKRA7JU3YnmIZHZz2s+W9TW9MNmQ/bHyMuPZyi7QiMjhULQCCFIw2+5jz+9IvC1/+h6zV611+CF+rv7gt0= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2018 08:18:57.2048 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: df65d1fa-a8b6-46a7-5c44-08d61f9ae135 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3586 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.6.96 Subject: [Qemu-devel] [PATCH v2 7/8] 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: Vijayabhaskar Balakrishna , Eduardo Habkost , Konrad Rzeszutek Wilk , "Michael S. Tsirkin" , Venu Busireddy , Liran Alon , Paolo Bonzini , Si-Wei Liu , Igor Mammedov , Boris Ostrovsky , Karl Heubaum 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 ab99047bf8..cdf44a7757 100644 --- a/target/i386/hyperv.h +++ b/target/i386/hyperv.h @@ -22,11 +22,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 6f4fa2ab91..0d0776eb3c 100644 --- a/hw/misc/hyperv_testdev.c +++ b/hw/misc/hyperv_testdev.c @@ -52,7 +52,7 @@ static void sint_route_create(HypervTestDev *dev, sint_route->vp_index = vp_index; sint_route->sint = sint; - sint_route->sint_route = kvm_hv_sint_route_create(vp_index, sint, NULL, NULL); + sint_route->sint_route = hyperv_sint_route_new(vp_index, sint, NULL, NULL); assert(sint_route->sint_route); QLIST_INSERT_HEAD(&dev->sint_routes, sint_route, le); @@ -79,7 +79,7 @@ static void sint_route_destroy(HypervTestDev *dev, sint_route = sint_route_find(dev, vp_index, 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 0ce8a7aa2f..4d8ef6f2da 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); From patchwork Fri Sep 21 08:18:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 10609269 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 043F4112B for ; Fri, 21 Sep 2018 08:24:01 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id E8ABF2DAC8 for ; Fri, 21 Sep 2018 08:24:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id DCF622DACA; Fri, 21 Sep 2018 08:24: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=-7.8 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED,MAILING_LIST_MULTI,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 717582DAC8 for ; Fri, 21 Sep 2018 08:24:00 +0000 (UTC) Received: from localhost ([::1]:54378 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3GjH-00085c-L0 for patchwork-qemu-devel@patchwork.kernel.org; Fri, 21 Sep 2018 04:23:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47355) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3Gee-0003nt-76 for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:19:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g3Gea-00025Z-Ck for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:19:10 -0400 Received: from mail-eopbgr60096.outbound.protection.outlook.com ([40.107.6.96]:37218 helo=EUR04-DB3-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 1g3GeY-0001PN-Fi for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:19:07 -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:X-MS-Exchange-SenderADCheck; bh=c5zc/TWKy1p1jsWrvGH3NHtFK3Xcu2YN71ea5G8qtPw=; b=PxwruBvsuVi9Aj9VZ1FKb7BCpA4ellDJGu6oWe3y9mqxO6DYWnKttmWgg+JOrFPodoEFa7s9ShHhH5uo/Nk2wlxx1x/ym+oUO4H1iDBQRBTFkg4j/4fCp89CKbgopRayWhN7+nMR69HURTyR71TYMe+3IOqPu1Vd8LqFMkLdNd8= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; Received: from rkaganb.sw.ru (185.231.240.5) by AM0PR08MB3586.eurprd08.prod.outlook.com (2603:10a6:208:e1::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1143.18; Fri, 21 Sep 2018 08:18:58 +0000 From: Roman Kagan To: qemu-devel@nongnu.org Date: Fri, 21 Sep 2018 11:18:36 +0300 Message-Id: <20180921081836.29230-9-rkagan@virtuozzo.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180921081836.29230-1-rkagan@virtuozzo.com> References: <20180921081836.29230-1-rkagan@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: VI1P193CA0009.EURP193.PROD.OUTLOOK.COM (2603:10a6:800:bd::19) To AM0PR08MB3586.eurprd08.prod.outlook.com (2603:10a6:208:e1::27) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b6302257-8500-4202-03ad-08d61f9ae23e X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:AM0PR08MB3586; X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3586; 3:lS4kBhLOSVJtSrhFICtY7/xW9FVaTOlFcZIV+tauUOHOghIZ8vCDq+ScTVmfRPKT7P0PwYQRYQ9fXiYXbXNQBavFPIWbqDTl+y6pQ7zqykvJuuZDNGleKm8nf7jtQKlP9r4RuzOcVdpuJqhxgJWd++Ffpm5+zJAbLExwmnzchPETENuAAP/5r1Fgr1KTNdMxLnQXMEDoGFPQrN5DkQ23/PDqdA0aSWm6LT85byIIilOr9Djw5k78Xv2l0XNEcN79; 25:F2Hw2ZmfvRo0PQo9Qt9/gVZ+4//aZMF+Uanh35tsobAHM50ZN3MYw+NWnw65wTGEnqTybAcambJ87J18ZUt24DazHkW/bWo9WgT1oi7FO1h/yFy53dzN25Koz36gbpeyRBP8y8JYXrBf/Wzy52xPvvHQPvd7ra16vFb89UQ44HvvPmtBwjKveu9nGBVkuo67b9Ws5/mo1E3zrllmjp6fDjLwPRu0StxqzVima0rfZfR3IYkvVcDe1KL/vRGVleGPwkooAcxkFtQJOxTZ8IoeaE6FcuG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HIGq6yfIvh7h47sQ5N86U34wpNzViyCwHoQpqGiyRUw+R0802IF6V48YFV3heHR9+Q1w7JqId4DdUcKbecV80FFkLSSOwRdGA0MQg3xGNjXSnP1OAD+j4MK/L6f5SpF2tMoU2unLGVchv0J X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(788757137089); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040522)(2401047)(5005006)(8121501046)(3002001)(10201501046)(93006095)(93001095)(3231355)(944501410)(52105095)(149027)(150027)(6041310)(20161123564045)(20161123558120)(20161123562045)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051); SRVR:AM0PR08MB3586; BCL:0; PCL:0; RULEID:; SRVR:AM0PR08MB3586; X-Forefront-PRVS: 0802ADD973 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(396003)(136003)(376002)(366004)(39850400004)(346002)(189003)(199004)(2906002)(81156014)(50466002)(51416003)(305945005)(25786009)(2361001)(478600001)(316002)(7416002)(54906003)(86362001)(16586007)(26005)(52116002)(48376002)(8936002)(36756003)(76176011)(186003)(50226002)(386003)(69596002)(2351001)(53416004)(106356001)(6486002)(11346002)(476003)(446003)(8676002)(16526019)(5660300001)(2616005)(956004)(6506007)(81166006)(68736007)(6116002)(1076002)(6666003)(486006)(105586002)(97736004)(4326008)(7736002)(3846002)(47776003)(6512007)(66066001)(6916009)(53936002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM0PR08MB3586; H:rkaganb.sw.ru; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM0PR08MB3586; 23:7LFG3tmbZL/sj7eFlat+OBPKFVRw0klShPl71ThN6?= RIzjVEXHCZmZy/OiDGB0ryks04gCXppPapeksa6/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Bd7jnky2eJ1UEJyPfsyWpjqc7zqk7geMkvSSDBazbWz4ex3E7ncpmY5xnzr8ulO0TtcIDiaVnBeXhR74OuDwDaIq0gi5YAHTq81mJmDfnLVujGUNaonFXmoIsdosAxStrqZPBv8msBtOPHpmAC1WZSP6F7MWs=; 7:pmqRRKmsEor+83C7h3jMLbrAYbAfeXYDTfbbugUdbANMp/g/i8+5sp9zS7KUcBZF3dieZCWsTQa7teVPx4FjL5anuiIQDt4LI+aKJUWNJW+xGT3LnKk7wnHLan+sXl3+9BTnMJmLhG8luUQcx6ZlBzaQaD7jyafDncFKtWhT24rPN0EMxsHWUKHBbErYs/hwHiczR33SsnUNuLwsPVLVCu5a6HdqtOxfymiIZfxsyGomRnzNTwywuZs4aCO4Mw3+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3586; 20:8ezcf9YhmSwB92XY8f1guMJk1S8yAyyFHHF7utf9CpPG1oolgKWq9Nkmc6y0gxOMfDWjLN/+f9W/F7VqNOrmEq0VS0JdxVOTaXSKSCjXGa/uMwho6MKkcA2UZwqJ7drXkgoYtk6L0IwJb1hNI5h34QUw13yJXOHmU1XCGhmAN3U= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2018 08:18:58.6580 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b6302257-8500-4202-03ad-08d61f9ae23e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3586 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.6.96 Subject: [Qemu-devel] [PATCH v2 8/8] hyperv: rename kvm_hv_sint_route_set_sint 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: Vijayabhaskar Balakrishna , Eduardo Habkost , Konrad Rzeszutek Wilk , "Michael S. Tsirkin" , Venu Busireddy , Liran Alon , Paolo Bonzini , Si-Wei Liu , Igor Mammedov , Boris Ostrovsky , Karl Heubaum Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP There's nothing kvm-specific in it so follow the suite and replace "kvm_hv" prefix with "hyperv". Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 2 +- hw/misc/hyperv_testdev.c | 2 +- target/i386/hyperv.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/target/i386/hyperv.h b/target/i386/hyperv.h index cdf44a7757..59e9f9a1e1 100644 --- a/target/i386/hyperv.h +++ b/target/i386/hyperv.h @@ -28,7 +28,7 @@ HvSintRoute *hyperv_sint_route_new(uint32_t vp_index, uint32_t sint, 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); +int hyperv_sint_route_set_sint(HvSintRoute *sint_route); uint32_t hyperv_vp_index(X86CPU *cpu); X86CPU *hyperv_find_vcpu(uint32_t vp_index); diff --git a/hw/misc/hyperv_testdev.c b/hw/misc/hyperv_testdev.c index 0d0776eb3c..8654b13d76 100644 --- a/hw/misc/hyperv_testdev.c +++ b/hw/misc/hyperv_testdev.c @@ -90,7 +90,7 @@ static void sint_route_set_sint(HypervTestDev *dev, sint_route = sint_route_find(dev, vp_index, sint); - kvm_hv_sint_route_set_sint(sint_route->sint_route); + hyperv_sint_route_set_sint(sint_route->sint_route); } static void hv_test_dev_control(void *opaque, hwaddr addr, uint64_t data, diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index 4d8ef6f2da..fc537e7ca0 100644 --- a/target/i386/hyperv.c +++ b/target/i386/hyperv.c @@ -185,7 +185,7 @@ void hyperv_sint_route_unref(HvSintRoute *sint_route) g_free(sint_route); } -int kvm_hv_sint_route_set_sint(HvSintRoute *sint_route) +int hyperv_sint_route_set_sint(HvSintRoute *sint_route) { return event_notifier_set(&sint_route->sint_set_notifier); }