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+nldWXi6Jyp3HDBZ7uUGj14Ud20XUJf0h4XGvZxtL5TGCJv1xJYm64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QXyFaHHaNKf+mGGEUwE1vwLlXkoOFcbr9wPwDps04GUK0FF2VJ+KWBzhaeDyb4dBCIqJgur+nFR862F4zKxqwdOaUBkyBtgWVfesY3EaRPAuduk3ZNVHLzvrCj 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;