From patchwork Tue Feb 6 20:30:20 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 10204117 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 1696560327 for ; Tue, 6 Feb 2018 21:09:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id F254926E3A for ; Tue, 6 Feb 2018 21:09:16 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E3540287F9; Tue, 6 Feb 2018 21:09:16 +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 BA40426E3A for ; Tue, 6 Feb 2018 21:09:15 +0000 (UTC) Received: from localhost ([::1]:34274 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ejAUM-0004uG-Gs for patchwork-qemu-devel@patchwork.kernel.org; Tue, 06 Feb 2018 16:09:14 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:44647) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ej9th-0000b1-HI for qemu-devel@nongnu.org; Tue, 06 Feb 2018 15:31:22 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ej9te-00033A-6Z for qemu-devel@nongnu.org; Tue, 06 Feb 2018 15:31:21 -0500 Received: from mail-eopbgr00136.outbound.protection.outlook.com ([40.107.0.136]:40807 helo=EUR02-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 1ej9td-00032o-T8 for qemu-devel@nongnu.org; Tue, 06 Feb 2018 15:31:18 -0500 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=NzhsG7MN3ePGLKcSpvCA4QMldWvUPM0+dydn/OC+3Zc=; b=TP2K8accYM3yeM4MCY09PpjeL6tfKixhQMe88WIomHBsm2XtcsktVEDtUS3yFXfdZbBbcdWMwrbq8bnZKcQ6OeCCgF+KkGYq2LnkCjDnZ3TEWl4aX3vDMAG6LP6UPWOZDss51UJXfQftWCHBUMuepYIUy64Y3r1mLkl/he/qC6M= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; Received: from rkaganb.sw.ru (195.214.232.6) by VI1PR0801MB1983.eurprd08.prod.outlook.com (2603:10a6:800:8a::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.464.11; Tue, 6 Feb 2018 20:31:14 +0000 From: Roman Kagan To: qemu-devel@nongnu.org Date: Tue, 6 Feb 2018 23:30:20 +0300 Message-Id: <20180206203048.11096-7-rkagan@virtuozzo.com> X-Mailer: git-send-email 2.14.3 In-Reply-To: <20180206203048.11096-1-rkagan@virtuozzo.com> References: <20180206203048.11096-1-rkagan@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: HE1PR0301CA0008.eurprd03.prod.outlook.com (2603:10a6:3:76::18) To VI1PR0801MB1983.eurprd08.prod.outlook.com (2603:10a6:800:8a::16) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b123aa83-82be-4d69-06bf-08d56da09216 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(4534165)(7168020)(4627221)(201703031133081)(201702281549075)(5600026)(4604075)(2017052603307)(7153060)(7193020); SRVR:VI1PR0801MB1983; X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1983; 3:4CfqeOKUyg6J10GscD2MYQxtXMMWeMb2hNiTZZRfZWh0BrDBVwU9f8s/dtkjMi0xWT+q6NDC7AmGQXE5AuVaWJ2Wy8TMQwK8APvl4+gIy0Lzel3P2HKB8JxJZBvV2K5iDNhIFQPl8ZjSm8/sd19vzaAHCmNYZ9ACu6QdLitzBApis+/1HyXAwCK2G7eyQSD7hrn56DBayd+e5nSp2IOBcBFu74CHAxmMC3P3HtEJrYs2G8g8XWe7pUwCnOFpJDSr; 25:dYACetXwDLUOjuZAUzF9Bdz2vVHXLO0p9FFkCBUMlTp/4+UZ/YKQwHrzL6nAqWGlu3k4DkyVjbL2/8AK+lJ77iEN3FEF2pi/5KeW7XPnKEOxEVqq3us6+Yeav0uz0xPNiq1enuPqJwyaAM2/yrTmHpV4MdZQVONS2ICfIbfuz+JzY8y5GhX1mA7MQU3XyAp1zeFliEtMU+7FSZ3i2UIfSXGIfNMAjheEcLImBooohbPnPILk6MOkXIQPFyoO1NELj8wOJ+nQ9r0Iz/c8uuxC2GvuWTGmbP4Ckcm6QXwOtldbEnLDAng1WTT7GzdqaxPrRM3SgYRognHDE67gOYanVg==; 31:rXg5/3cHI8ezZhBBYmAU1A2okNrjUzo+4Lhh7S3Tdt2wXVTyvVGcBqWcUwHM9uPvzsuNUmW5HJDo7dUWIxNCswFQ5RlYdR1jqw+zHiUfehzg6yjzQL7/XxTBS7nHjrRAJg9Bq+5UV3ND5XroUU+1wtUD+L+U5eLNNnMt6wfCyZrz70z1YYwqkek1DCdA6FWpAlLKSgLSyHM8zq5JUeNEQDv7OHBfEXXSjhDRKQ2EJdQ= X-MS-TrafficTypeDiagnostic: VI1PR0801MB1983: X-Microsoft-Exchange-Diagnostics: 1; VI1PR0801MB1983; 20:s0+pB0nwaTgTcksWPGGx6uybxK6JMSBu1Pe7OzoUTD1HWwUpR+NHaLfnYmwyBQdt3Okl1f6kBAQEMxS0J5txNXnx/gSupe8oe8zML2uhkwF1fwr25DiJhf6ywuUjpnJzSGNE7x4n2cgv6s7KkU2RgqkxS1kzKL2aotWZzwJkRq8p3LcCZPqMxuj82gfw9YPNI9eNlDRYq/g2hWAOWOLIEFq1LD3+uShwtj28NhlpHNW6F5Ld5X2HDm78JPY7loOaxL1M+MMgSFyc1RRxYULg/E0mdxyGZpU4PGvJYzsAUqpAnXF7T3C7+XJ4qUeHJIF2mThCF4D80Lm5DDKz1e7IjZFIqTNNC5WPpsAYru5pkHfmC2pOa8KrECC+ULgQ4UBZeDLZkk0qF4wiFGo2r/Jb/jcpMv5C0jtBRb3ZmzSdt54=; 4:luGhtjoGH3HPe6MLc3Dm55N4gndXHAV9/KIZpg7WzV3/FkmV4qH7ZSZ1jZAKmmyENGseaBu00uowxxk/1JVZxmOg3/hL+Ys0NTu8JaBg+pOdU4VSCICptZjeqLZnkX+q3hCrZUxuH2zgecHSUIDCFnE65RKGf/nwtiMBx8xlOjp5hFR51UpDr3LJMXKSCMKerfnUFY/HH/AxZ90tG+n0SbHzVcX+cYAMFJppzmh3WYjQ/u1WTgBVhy/wqx+WxBeWHFBErKW9Y4I5/ZwVwkjXzg== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040501)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(3231101)(2400082)(944501161)(10201501046)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123564045)(20161123562045)(20161123560045)(6072148)(201708071742011); SRVR:VI1PR0801MB1983; BCL:0; PCL:0; RULEID:; SRVR:VI1PR0801MB1983; X-Forefront-PRVS: 0575F81B58 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(6029001)(396003)(366004)(376002)(39380400002)(39850400004)(346002)(189003)(199004)(16586007)(53936002)(305945005)(54906003)(7736002)(3846002)(316002)(105586002)(2361001)(106356001)(2351001)(6116002)(1076002)(50226002)(8936002)(81156014)(5660300001)(8676002)(81166006)(7416002)(2950100002)(6666003)(6916009)(76176011)(86362001)(68736007)(66066001)(16526019)(47776003)(50466002)(4326008)(97736004)(26005)(6512007)(51416003)(2906002)(52116002)(386003)(6506007)(48376002)(55236004)(36756003)(53416004)(69596002)(6486002)(478600001)(186003)(25786009)(217873001); DIR:OUT; SFP:1102; SCL:1; SRVR:VI1PR0801MB1983; H:rkaganb.sw.ru; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: virtuozzo.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; VI1PR0801MB1983; 23:tyZB4UgL+LbY/YpO8Rg6wgsHrN8djQM32T7JQGZ?= =?us-ascii?Q?h3C92BFLU9E/fMr3ha0I2aZSfJ0/x7aAyIAOUBXvAQN52ZnY7X3eWhoR542E?= =?us-ascii?Q?CsEOJ1izE5VZg9FyV99vAwsr3NkOLWzDFga7N6uqLOqIdC72oItIsBTRBu0+?= =?us-ascii?Q?hVdhS2g+P2U8NyM+hweXLwao9xvQUs/AiH/S/XSbUtltP37QEmmKfrkR49D6?= =?us-ascii?Q?XG6ea3mG5lxt8YVZWd5gMXPvEdfgdcInbJvnRbAOSSgZwwN1JN28MYG73BwD?= =?us-ascii?Q?LNgUpm05WUeEfJ/03zhNpAxlcElbR2/Mi2Yg6PlMgiyORx0OigUhcozNQBFj?= =?us-ascii?Q?brzlVeNkMdY7S1vCG2tpsrBFBzxUYUWDGPSnJql3xPhMSueegeSBSYHtQlpw?= =?us-ascii?Q?P9pDHT8ZCy2LKV0pTalCpAZIyTV77afD2BMv8A60UhFXJeZkoQDokuB7xFXn?= =?us-ascii?Q?yegTWFpXeYvSjvXsNppkEwmqe/FbHu2HywCsTIzu34iy+giOuHFjZaAGqMJ/?= =?us-ascii?Q?lmHs+n11wSLQRH/ff5ySyeeZKasRpBjWerXH2vua7wVBP/f50DndEJR7bfbj?= =?us-ascii?Q?24ArmZZ56wHHiJgUwZyASayZo+JVq2bW6DeJ8PfzF1+PaMl37mYcIkj9oiDs?= =?us-ascii?Q?Z9B0B7sGWFAeBdC6rok77euJjfumUqEugODT3bwlpgcezCISLTKmw3N4mxur?= =?us-ascii?Q?AIg6xeN7j+eqDjampK5F+jC5AXSMiADJ7pKveWtFYeYfX/pka69KMU1sBGJT?= =?us-ascii?Q?DbY25kk8C12pdq+ggOic7MIPfisVwKeYWmG0zhmUo4rm87n9iZuDWkuycZhn?= =?us-ascii?Q?uaDLL4BIWn+EABb8FgYypcjS371N8fi/HU9kSQatjcgvTb+3A0FYY8sHpv9j?= =?us-ascii?Q?wKz7XwnNDrpswIrbYdPSU8qjYkCfbIRL+iL2Dx3t20M7AYrUkaSKTwFtmKX9?= =?us-ascii?Q?WMW3PP7uY7U3NwrCZWR+P/u7nfTCQIkjoxoaD3sG1gkSllQsFFuUtAtzauPw?= =?us-ascii?Q?gDWoPUOzqAika4yJtb4oqwPiUsb1IYYxiplWx8K1JYZpwnEDmxhecsFPGzH6?= =?us-ascii?Q?7+HrN4wYhG/Fwd1ItHelLfU2opnC6FVMeLhrXk7FuSQKQSwR4dOoZUTOiDZl?= =?us-ascii?Q?Pqa3VOVWM3ELdf377jkHFPbT219vNdsYDgAltRb6oc24iXqbBNe9ReMZC6B4?= =?us-ascii?Q?gelb84FWf+tjhqccEdx9C/e9mSwcBvTiVjgWlHtXGhjzlOeVGA6gpmyFg4Wu?= =?us-ascii?Q?wV2/Ytv6h87pGQY1f7mC2tUUieP6wHb9uo4cjn5NZBHjUbSjSG6DzI9HJfK8?= =?us-ascii?Q?g8w=3D=3D?= X-Microsoft-Exchange-Diagnostics: 1;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ITNFkYgLHIr6uTRN9iaIh3heSTFAtzH4s9svy0N7IqQAkTTrwEDbG+7i5SZ2DMN2XfdYqydzdKMp2bXVrRSr5SFsdq2I= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 06 Feb 2018 20:31:14.0905 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b123aa83-82be-4d69-06bf-08d56da09216 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0801MB1983 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 40.107.0.136 Subject: [Qemu-devel] [RFC PATCH 06/34] 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: Ben Warren , Konrad Rzeszutek Wilk , Krish Sadhukhan , "Marcos E. Matsunaga" , Jan Dakinevich , Vadim Rozenfeld , "Denis V. Lunev" , si-wei liu , Paolo Bonzini , Vitaly Kuznetsov , Cathy Avery 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 b2416f9a5b..0ce8a7aa2f 100644 --- a/target/i386/hyperv.c +++ b/target/i386/hyperv.c @@ -18,7 +18,7 @@ struct HvSintRoute { uint32_t sint; - uint32_t vcpu_id; + 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->vcpu_id = vp_index; + sint_route->cpu = cpu; sint_route->sint = sint; return sint_route;