From patchwork Fri Sep 21 08:20:38 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 10609331 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 6314A1390 for ; Fri, 21 Sep 2018 08:43:31 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 53C372DD9C for ; Fri, 21 Sep 2018 08:43:31 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 479352DDA6; Fri, 21 Sep 2018 08:43:31 +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 BA5222DD9C for ; Fri, 21 Sep 2018 08:43:30 +0000 (UTC) Received: from localhost ([::1]:54507 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3H29-0001kf-It for patchwork-qemu-devel@patchwork.kernel.org; Fri, 21 Sep 2018 04:43:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3GgM-0005I1-Vj for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:20:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g3GgL-0006HB-0U for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:20:58 -0400 Received: from mail-am5eur02on0705.outbound.protection.outlook.com ([2a01:111:f400:fe07::705]:42144 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 1g3GgK-0005vY-Pj for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:20: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=Mk2QrB9nIosnqA7WpPStTBcF0hPRkoL7CA/ncy1BWpQ=; b=IEocq76xo2Ik3Tqu+1SWQXsGKCANw5jWrPWiJvF/AVZS3x98xdtrgVLd5IXxlXNMnrypCwbtZm4rwgG/lWqP8fdOHWAyQ37KKZdq5H4x2/bnLZ4jdH2Q0NN/GiE+WN+zw74Uhe3WaLqlJx4nNgUXISCwmK5+wYRApkGNa1l+5gg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=rkagan@virtuozzo.com; Received: from rkaganb.sw.ru (185.231.240.5) by AM0PR08MB3585.eurprd08.prod.outlook.com (2603:10a6:208:e1::26) 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:20:51 +0000 From: Roman Kagan To: qemu-devel@nongnu.org Date: Fri, 21 Sep 2018 11:20:38 +0300 Message-Id: <20180921082041.29380-3-rkagan@virtuozzo.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180921082041.29380-1-rkagan@virtuozzo.com> References: <20180921082041.29380-1-rkagan@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [185.231.240.5] X-ClientProxiedBy: DB6P18901CA0005.EURP189.PROD.OUTLOOK.COM (2603:10a6:4:16::15) To AM0PR08MB3585.eurprd08.prod.outlook.com (2603:10a6:208:e1::26) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 39f05359-cfbc-4c1b-2661-08d61f9b2599 X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534165)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:AM0PR08MB3585; X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3585; 3:FJcii2GPIaj1jkY1L5KHLReQ7uOfzncL0XLKDUyDL267+Ugsiv5+i4eCV830rTZICK0ej4H6xWAoRNUtLeKDkK9NnhnGjtcSqTMFHTUfoLe60eYn+yArIjx+9VTIaTgddt5LW2ZRGxrMoRCIOhsF6/QO9Y5uAyxwyzSkuuqp/Q3WOraSjGZiw8Zj16auKcxaDVC7zwFLtIdQinBF+LFFl+zgi6R9jPCBii9Tn7I0N595D1sGJ4k5R4x3yjh8SspE; 25:6o7yPpRcRqLvztzj3GvQY+4P56VHPnJ5CNTZpONnl7GARFaRibWwt1UHH/VucmPK7TXR7PwSBPRWkaisJ/NnHwVBgzLnc+QdX631Rcdihf8FC4mrqrSzJBNVv6bnDZXaL5BZmSDYSdXV5xnclXjzRjLZfogwwkZkuavrZSvvGt6y12VG6F9nADEOF9Q24igrz8CuJw3IaMzdzZAZ8XHl2V9wrm8ArrLy6X6USjjxtXQKJSxNgwv0vemmKDYnrt/5UudvM5mHYP8OjZFPfjMgBZJD6F9O/0iptipCZ14RpD3vS6JiB1o7Dh6B/IcmWmHBn49AHrY1uRDyYk1NhqtH2w==; 31:xdO+dM0u9dGTcqtvzq+2PFMie/tK69tEYnNG9eZGy8ROZyfqN5FkFLda22bGOlfuuR98bYF0hBTRzsVvfdGhOpXO4EnrGTiG0Aor2q0fOCmhRjRkqVfpUND2OMt5xIRxit+pBqCgE4aFy5hv9pKbGbXYr8jHQHqdot1N8bq7Xu3G+oCumq2do1q/nIDxYoR9zKGV4mfare7LiGL90QiwFcOVU1f7y5SK+qer8hZ6Hjc= X-MS-TrafficTypeDiagnostic: AM0PR08MB3585: X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3585; 20:J29JsKaXBUuRU6hIAlgSeHJnMdxbvudUYpvudLPp2cUDozUDnA4ljWtENqxrnFU3cZ0Klgctsg5WygKAdCtpgwBqOPaeiV2jzOIpaFjz9vXaJwYPFOVyf66FJRorSOBdD5lHrd+WYA8owPpLiU3tLNG3I3WtNdd7TFMcrIcESHNVwbOjN/Vqb9wkajaN7xWgEffKxnYwVDeDb62B4ZVHFA//UWkFF3YMdgarfOfCRGdKXxdII8pPbFteEM9OtfMsjrTKuEknDOXa8iHulKKq3YxqX+hLswXnCNzUxV+Rgdam9zqN101HQQgIxle6r8BqpspsnbJ2VbyvwrpCoELYFy4iLgvIfubxET1gAdeVpXI4EB7IA6fX4nrXWcM4G9HWyYRRywJIya2juu30O6EQ2i2cMSd+x4BOWMF/fJsy8vDGWocGjsz2iTlMBgNBMHBCY1jgOhhTgmfvIkb3Ff+H/6xMhd7iBZKjCkB8LPfQa47CAsSrqhFiZgpfCi/7h+d9; 4:CtTkwo5Cof9vX5Yacc7jHQlLgeLJgau9I0Uf12yc6T9jT2XYVekx+17V7/CsWul//xEfJrbUVDmzwdtx984xYCZ5UyVHde8WJMCTW4BDloNLsa+ygA9e3GidGOjWzbyG5qDfXaFiYPVf6MNU9cP65I3AvqnIxCPSaq2muQkaKQUvZQttz2JjdxP69t8zIfAxlN/xyglk9vgRUUthBg8RmvbEwpv274BOoIZH05dPsAZyUI3DVGW4Ero2pu0UmGosvccPdzLH3agT6CjxcExY6w== 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)(3231355)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(149027)(150027)(6041310)(20161123558120)(20161123562045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(201708071742011)(7699051); SRVR:AM0PR08MB3585; BCL:0; PCL:0; RULEID:; SRVR:AM0PR08MB3585; X-Forefront-PRVS: 0802ADD973 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(376002)(346002)(366004)(396003)(136003)(39850400004)(189003)(199004)(86362001)(6666003)(4326008)(2906002)(16586007)(7736002)(305945005)(50466002)(50226002)(16526019)(52116002)(51416003)(478600001)(6506007)(956004)(2616005)(8676002)(186003)(476003)(6916009)(54906003)(3846002)(48376002)(25786009)(6116002)(26005)(2351001)(386003)(316002)(47776003)(53936002)(5660300001)(36756003)(7416002)(105586002)(11346002)(66066001)(446003)(486006)(1076002)(6512007)(6486002)(68736007)(53416004)(81166006)(2361001)(97736004)(76176011)(8936002)(106356001)(81156014)(69596002); DIR:OUT; SFP:1102; SCL:1; SRVR:AM0PR08MB3585; 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; AM0PR08MB3585; 23:Ml047ncKMi/i/aONRLUTud4yGqBGE+uUFuaHBeCqx?= VJizyULfYvn5+2PGJA3RKigT3owMClSU++QeG5QAZO0Q26r7oxIvQZ7Sy2ktZC2kOvasmCbBAIHJvGQLF8RXNUDJGmnCfV5bwg2GQd1GXITz2xPfyP5kPQviMk8RWHeIsVDXVbfZvwyFNbiGNea+Xy5vOOMa4kmPwsr/yjge3ijWHqHNT384Jk8nKbdUWUGSaPuK6f94fnG0Jre6vy1eFg39fjcXU3WNg6rRaFzmvTyv8VmvZaqBJezU9ZDcFR7/XLOEGJpuZ2cyka6hvOKByY2T5CjwmDOvYqsnJnVbZmiTk4lZhJ6ORMCZQjemPcnAsphz3gCL2GtMK08DfYa//qMbYnb8x+9RvVko/nZa2TVAQc/8QBbjajEZfs3+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z2eUJuU8DTvjYcSx0/bPz4hPz8wkbKpDf066NmbAt0PA47wUgoDFs+0+4trxZdAh3uEO3K39RAEym SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3585; 20:IrXd8/r5DFp3PXMqRG20UEyY6ZHgeNFpoGixNe7XIKwcfifxWzvNC1m6iCRTUugqBtQwstZhvKfoFAkdwZdsk/JetaN+3HecnQTjZaordHmHpO1Li0osrSYV7C6jn09rcoVvvpEKg9snDC7zLy3EFpETgrWpw10FfKu84imh2kY= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2018 08:20:51.9761 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 39f05359-cfbc-4c1b-2661-08d61f9b2599 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 0bc7f26d-0264-416e-a6fc-8352af79c58f X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR08MB3585 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 2a01:111:f400:fe07::705 Subject: [Qemu-devel] [PATCH 2/5] hyperv: make hyperv_vp_index inline 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 Also make the inverse function, hyperv_find_vcpu, static as it's not used outside hyperv.c This paves the way to making hyperv.c built optionally. Signed-off-by: Roman Kagan --- target/i386/hyperv.h | 6 ++++-- target/i386/hyperv.c | 11 ++++------- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/target/i386/hyperv.h b/target/i386/hyperv.h index 59e9f9a1e1..8d4619c078 100644 --- a/target/i386/hyperv.h +++ b/target/i386/hyperv.h @@ -30,7 +30,9 @@ void hyperv_sint_route_unref(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); +static inline uint32_t hyperv_vp_index(X86CPU *cpu) +{ + return CPU(cpu)->cpu_index; +} #endif diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index fc537e7ca0..68816642c9 100644 --- a/target/i386/hyperv.c +++ b/target/i386/hyperv.c @@ -27,14 +27,11 @@ struct HvSintRoute { unsigned refcount; }; -uint32_t hyperv_vp_index(X86CPU *cpu) +static X86CPU *hyperv_find_vcpu(uint32_t vp_index) { - return CPU(cpu)->cpu_index; -} - -X86CPU *hyperv_find_vcpu(uint32_t vp_index) -{ - return X86_CPU(qemu_get_cpu(vp_index)); + X86CPU *cpu = X86_CPU(qemu_get_cpu(vp_index)); + assert(hyperv_vp_index(cpu) == vp_index); + return cpu; } int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit)