From patchwork Fri Sep 21 08:20:37 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 10609333 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 37CBD1390 for ; Fri, 21 Sep 2018 08:45:27 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 27CB02DDA3 for ; Fri, 21 Sep 2018 08:45:27 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1B35E2DDAA; Fri, 21 Sep 2018 08:45:27 +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 5E4FE2DDA3 for ; Fri, 21 Sep 2018 08:45:26 +0000 (UTC) Received: from localhost ([::1]:54524 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3H41-0004SG-5d for patchwork-qemu-devel@patchwork.kernel.org; Fri, 21 Sep 2018 04:45:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3GgM-0005Hz-VO for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:21:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g3GgK-0006Fw-KC 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-9J 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=VAcPmYlbIui+mP7lMdC0Xv9ICmBIO9uBWk3PosVSB3c=; b=HzJkSAKUPIEfIRVDBAaAWRT2M/B3xZ4J1NYgsGCdVFkYciQmbsUV+N8I7prGaRlW4kcPjmeYhGxZT62V0EerTTdRa8Wk5buBDxBlK6l6VM4JNGYDh9VcAVlhyvkMj0QL54JT0NclAySPZtOQTx3OFwbNCAlJm1z34L51jKEHuLI= 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:50 +0000 From: Roman Kagan To: qemu-devel@nongnu.org Date: Fri, 21 Sep 2018 11:20:37 +0300 Message-Id: <20180921082041.29380-2-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: c60dd376-7ea2-4173-6589-08d61f9b24b6 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:kBiKSQPO2eCLL0yTNJrxzsRUo4lhVcYvoSUllgH6/tJJwircSjKnBJCKQkzMqSuq6Zuv///zEFr9kFR0/vRj7UmdBMDFVjNF3TBWQhaEXFF8KtSc94EDNrNnCPvDFVQajLDJcuFOJ2BPT4N9mXfvZr+7+nKqyCY8ybhu7FuSgyMpPxB7Dox84G+QfbjIWVbpdnrmFPsBueSLymhoqOOq+tTGvOFnB2myMe+IMX9EhJ7hhqczGwG/sBTS/xcFQML0; 25:y7DO8fbTsU6MHt9wyFi3ozABtPFbXqR30i24uJDFo1wmtC5PXJtZoOzSLR194+FS0OPm2/n2Yd5nRBxcGf60FLhuSlgOc7cVH7CJ80RBQUnAfKLzf0MDeLcLfO2C3dV/r8JqdDP1dIztI18nopj4gwjuCgQect90EID3WvfpERkGcKoJFyz28E7MjtT0p7BLrlv4pBKYdzfm4NaGqXQuIUhLfpRcNHafLotGk6nLKUftEWcFzxLzKJTavT2U0vQ89wxkHtJBa5FDepjnYRElVJZ3+eiu66JyN2+dOa5shRqpfiZgVjVtSY3aWHMp55Rp4qAZfwWvleeJ1TbEB0OocQ==; 31:/MEvbkTS0akFDd/e06yGm+KzHyrB2yZ6U/MWkKMr8477A5auiCdUBgGe4lh2cV5yamPHLl4qx9LKgKDfVJz0k8yotpEYFIhmS/j3V94r+GUalJx0BFX8Zx8+10W4VyVElv9M1IIgi/UXc9pgmGZYfsH5N9xcIYwfZrDtkO3NkGdze64FPula89apd7KiePTufmD/IFVibrcaYDLPNHvmEOd2atHfoYlEQ7G1Xz7RfMU= X-MS-TrafficTypeDiagnostic: AM0PR08MB3585: X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3585; 20:lQ8Ro5z4ImEu7T3QaBPQvjW4uice6x9hdaSQeeCfcBnvoS9YpoE8KfyC8srwmueQ4hmvxwDCEoQTsrGUwcRT3HCXvQWMIzJ6d+RkR6ygNqp0Vch/ZmeA8m7eydcMihKtxN79QD7M607YGng/56EUaCjQPASbgrQ+3fwko1t7kUaeRbsFiOmaSzjoz2fjtwHOvnwuQbfj1RrDB3vCYQSwQhts0EfkFJhZqqwCBUtXVsmxGAJJZExEZRhjTE9sbfgMLsLX+D9QCjaTS+MPzkYXB9Aw7SDfc7nZKftTrOmLSQESICwLOdTPgn7zbMrIaubW1EOBp0isD17+B1+xBg/LhMhlM5B2tzxwWwXhww4UGHM0T1/o1Xfnzrb1AfDd86gE+0nglodg6PYII/jdiGghB49pX/HhpLIpExCdz+UNnLFYlmvLKdPKD9LnU4G+MO5Ks673fTYIlxzOozBTg7iGPsCDqrgrZ9RhpJW/tJ+RjxzRG0Q/2s0FGeZAu/WnKkB/; 4:9HTm0mnjpsS+RfecgVrjkUlYsB4sqbdXXLnCUtqewgCua1w1iRuhaq8i+saXrvJdiPqBF7s/JuzvZfA27ppvkfq/DlmIcODRRMmcWBWRtyP/R6L0yuJNgbZ/wDXi+cVBObIh68gpK+JTFfppL5ePh2bZHtqTWkU8ZF9OO9LoenZuP2wXoIVur95P3pwNeDWY9yKB3ras22Y6yhi0yXpDLwp8jRxzUUWlzHmpFxfC5HLspGoVBV4loRr7SmCfR94ZSnKTddI4ZgzjFkDtMiFXdA== 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)(14444005)(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:2ciHSmdJR0r4zvPHMdyRUzck0Epmy4IimM26oCxuq?= /fk9caOMIkTRk/62/mxyXP+WhkoICDHb8ZmMUuQYJg/YRKprOWH6gh/pVfYZYk88VOs15Z23RHpouwB4s7bmjI83PrYcfd49jLI84SNdUUldcMdgHOtqXlbYo7GlVikBj0V1eIJFjBWFBsspMU9LQPSAwA2HCPO1GCZt9+PuwXp16FJG5uesOmIGSAmhYSl2QaJdcq5cOhniHVOYMs9xbz7420PvyAeuXHLQJWO93M1ow+f0z2L5sH6k6hO6J8izUIFkos/3uaTwX5DMR5mdYDmS0EVkW2EMyIqbzGcInP9zUfpzrxk0GGvOK2hlFMU+xoODb3Mxl/il3sCpgSRbX5cUH9NHZCuMAZGg1v4imqHeei/jjP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K2FdRyg20LIq/FwISliPA9dhry2H40M2WY/H9BGDGwNQBOerjWrtLVDc7Fgrhq8LUxYmg3yPzVH9Ty+kmpT6ADYRwh9ElXSKgcNCTa5CMgcltug4 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3585; 20:CZpbxxDGxs9qlkspew5EfaIlSRDuuGJz00veIGh5RKMVKFm4kwFT8pzVdO3eS3e+dC80EMDcfwnPcTHexREidT8UNck2Av7JTzCHYxUoZJePpZnZGX8uwbmwG4jzZ43qqgS9RvQFJoeeaLw5JQ0342EbhxH1Uimy4dduLX5YagM= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2018 08:20:50.4951 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c60dd376-7ea2-4173-6589-08d61f9b24b6 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 1/5] hyperv: split hyperv-proto.h into x86 and arch-independent parts 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 Some parts of the Hyper-V hypervisor-guest interface appear to be target-independent, so move them into a proper header. Not that Hyper-V ARM64 emulation is around the corner but it seems more conveninent to have most of Hyper-V and VMBus target-independent, and allows to avoid conflicts with inclusion of arch-specific headers down the road in VMBus implementation. Signed-off-by: Roman Kagan --- include/hw/hyperv/hyperv-proto.h | 129 +++++++++++++++++++++++++++++++ target/i386/hyperv-proto.h | 115 +-------------------------- 2 files changed, 132 insertions(+), 112 deletions(-) create mode 100644 include/hw/hyperv/hyperv-proto.h diff --git a/include/hw/hyperv/hyperv-proto.h b/include/hw/hyperv/hyperv-proto.h new file mode 100644 index 0000000000..2dc78eeafb --- /dev/null +++ b/include/hw/hyperv/hyperv-proto.h @@ -0,0 +1,129 @@ +/* + * Definitions for Hyper-V guest/hypervisor interaction + * + * Copyright (c) 2017-2018 Virtuozzo International GmbH. + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#ifndef HW_HYPERV_HYPERV_PROTO_H +#define HW_HYPERV_HYPERV_PROTO_H + +#include "qemu/bitmap.h" + +/* + * Hypercall status code + */ +#define HV_STATUS_SUCCESS 0 +#define HV_STATUS_INVALID_HYPERCALL_CODE 2 +#define HV_STATUS_INVALID_HYPERCALL_INPUT 3 +#define HV_STATUS_INVALID_ALIGNMENT 4 +#define HV_STATUS_INVALID_PARAMETER 5 +#define HV_STATUS_INSUFFICIENT_MEMORY 11 +#define HV_STATUS_INVALID_CONNECTION_ID 18 +#define HV_STATUS_INSUFFICIENT_BUFFERS 19 + +/* + * Hypercall numbers + */ +#define HV_POST_MESSAGE 0x005c +#define HV_SIGNAL_EVENT 0x005d +#define HV_HYPERCALL_FAST (1u << 16) + +/* + * Message size + */ +#define HV_MESSAGE_PAYLOAD_SIZE 240 + +/* + * Message types + */ +#define HV_MESSAGE_NONE 0x00000000 +#define HV_MESSAGE_VMBUS 0x00000001 +#define HV_MESSAGE_UNMAPPED_GPA 0x80000000 +#define HV_MESSAGE_GPA_INTERCEPT 0x80000001 +#define HV_MESSAGE_TIMER_EXPIRED 0x80000010 +#define HV_MESSAGE_INVALID_VP_REGISTER_VALUE 0x80000020 +#define HV_MESSAGE_UNRECOVERABLE_EXCEPTION 0x80000021 +#define HV_MESSAGE_UNSUPPORTED_FEATURE 0x80000022 +#define HV_MESSAGE_EVENTLOG_BUFFERCOMPLETE 0x80000040 +#define HV_MESSAGE_X64_IOPORT_INTERCEPT 0x80010000 +#define HV_MESSAGE_X64_MSR_INTERCEPT 0x80010001 +#define HV_MESSAGE_X64_CPUID_INTERCEPT 0x80010002 +#define HV_MESSAGE_X64_EXCEPTION_INTERCEPT 0x80010003 +#define HV_MESSAGE_X64_APIC_EOI 0x80010004 +#define HV_MESSAGE_X64_LEGACY_FP_ERROR 0x80010005 + +/* + * Message flags + */ +#define HV_MESSAGE_FLAG_PENDING 0x1 + +/* + * Number of synthetic interrupts + */ +#define HV_SINT_COUNT 16 + +/* + * Event flags number per SINT + */ +#define HV_EVENT_FLAGS_COUNT (256 * 8) + +/* + * Connection id valid bits + */ +#define HV_CONNECTION_ID_MASK 0x00ffffff + +/* + * Input structure for POST_MESSAGE hypercall + */ +struct hyperv_post_message_input { + uint32_t connection_id; + uint32_t _reserved; + uint32_t message_type; + uint32_t payload_size; + uint8_t payload[HV_MESSAGE_PAYLOAD_SIZE]; +}; + +/* + * Input structure for SIGNAL_EVENT hypercall + */ +struct hyperv_signal_event_input { + uint32_t connection_id; + uint16_t flag_number; + uint16_t _reserved_zero; +}; + +/* + * SynIC message structures + */ +struct hyperv_message_header { + uint32_t message_type; + uint8_t payload_size; + uint8_t message_flags; /* HV_MESSAGE_FLAG_XX */ + uint8_t _reserved[2]; + uint64_t sender; +}; + +struct hyperv_message { + struct hyperv_message_header header; + uint8_t payload[HV_MESSAGE_PAYLOAD_SIZE]; +}; + +struct hyperv_message_page { + struct hyperv_message slot[HV_SINT_COUNT]; +}; + +/* + * SynIC event flags structures + */ +struct hyperv_event_flags { + DECLARE_BITMAP(flags, HV_EVENT_FLAGS_COUNT); +}; + +struct hyperv_event_flags_page { + struct hyperv_event_flags slot[HV_SINT_COUNT]; +}; + +#endif diff --git a/target/i386/hyperv-proto.h b/target/i386/hyperv-proto.h index d6d5a79293..e204ca93ee 100644 --- a/target/i386/hyperv-proto.h +++ b/target/i386/hyperv-proto.h @@ -1,7 +1,7 @@ /* - * Definitions for Hyper-V guest/hypervisor interaction + * Definitions for Hyper-V guest/hypervisor interaction - x86-specific part * - * Copyright (C) 2017 Parallels International GmbH + * Copyright (c) 2017-2018 Virtuozzo International GmbH. * * This work is licensed under the terms of the GNU GPL, version 2 or later. * See the COPYING file in the top-level directory. @@ -10,7 +10,7 @@ #ifndef TARGET_I386_HYPERV_PROTO_H #define TARGET_I386_HYPERV_PROTO_H -#include "qemu/bitmap.h" +#include "hw/hyperv/hyperv-proto.h" #define HV_CPUID_VENDOR_AND_MAX_FUNCTIONS 0x40000000 #define HV_CPUID_INTERFACE 0x40000001 @@ -137,25 +137,6 @@ #define HV_X64_MSR_TSC_EMULATION_CONTROL 0x40000107 #define HV_X64_MSR_TSC_EMULATION_STATUS 0x40000108 -/* - * Hypercall status code - */ -#define HV_STATUS_SUCCESS 0 -#define HV_STATUS_INVALID_HYPERCALL_CODE 2 -#define HV_STATUS_INVALID_HYPERCALL_INPUT 3 -#define HV_STATUS_INVALID_ALIGNMENT 4 -#define HV_STATUS_INVALID_PARAMETER 5 -#define HV_STATUS_INSUFFICIENT_MEMORY 11 -#define HV_STATUS_INVALID_CONNECTION_ID 18 -#define HV_STATUS_INSUFFICIENT_BUFFERS 19 - -/* - * Hypercall numbers - */ -#define HV_POST_MESSAGE 0x005c -#define HV_SIGNAL_EVENT 0x005d -#define HV_HYPERCALL_FAST (1u << 16) - /* * Hypercall MSR bits */ @@ -165,7 +146,6 @@ * Synthetic interrupt controller definitions */ #define HV_SYNIC_VERSION 1 -#define HV_SINT_COUNT 16 #define HV_SYNIC_ENABLE (1u << 0) #define HV_SIMP_ENABLE (1u << 0) #define HV_SIEFP_ENABLE (1u << 0) @@ -175,94 +155,5 @@ #define HV_STIMER_COUNT 4 -/* - * Message size - */ -#define HV_MESSAGE_PAYLOAD_SIZE 240 - -/* - * Message types - */ -#define HV_MESSAGE_NONE 0x00000000 -#define HV_MESSAGE_VMBUS 0x00000001 -#define HV_MESSAGE_UNMAPPED_GPA 0x80000000 -#define HV_MESSAGE_GPA_INTERCEPT 0x80000001 -#define HV_MESSAGE_TIMER_EXPIRED 0x80000010 -#define HV_MESSAGE_INVALID_VP_REGISTER_VALUE 0x80000020 -#define HV_MESSAGE_UNRECOVERABLE_EXCEPTION 0x80000021 -#define HV_MESSAGE_UNSUPPORTED_FEATURE 0x80000022 -#define HV_MESSAGE_EVENTLOG_BUFFERCOMPLETE 0x80000040 -#define HV_MESSAGE_X64_IOPORT_INTERCEPT 0x80010000 -#define HV_MESSAGE_X64_MSR_INTERCEPT 0x80010001 -#define HV_MESSAGE_X64_CPUID_INTERCEPT 0x80010002 -#define HV_MESSAGE_X64_EXCEPTION_INTERCEPT 0x80010003 -#define HV_MESSAGE_X64_APIC_EOI 0x80010004 -#define HV_MESSAGE_X64_LEGACY_FP_ERROR 0x80010005 - -/* - * Message flags - */ -#define HV_MESSAGE_FLAG_PENDING 0x1 - -/* - * Event flags number per SINT - */ -#define HV_EVENT_FLAGS_COUNT (256 * 8) - -/* - * Connection id valid bits - */ -#define HV_CONNECTION_ID_MASK 0x00ffffff - -/* - * Input structure for POST_MESSAGE hypercall - */ -struct hyperv_post_message_input { - uint32_t connection_id; - uint32_t _reserved; - uint32_t message_type; - uint32_t payload_size; - uint8_t payload[HV_MESSAGE_PAYLOAD_SIZE]; -}; - -/* - * Input structure for SIGNAL_EVENT hypercall - */ -struct hyperv_signal_event_input { - uint32_t connection_id; - uint16_t flag_number; - uint16_t _reserved_zero; -}; - -/* - * SynIC message structures - */ -struct hyperv_message_header { - uint32_t message_type; - uint8_t payload_size; - uint8_t message_flags; /* HV_MESSAGE_FLAG_XX */ - uint8_t _reserved[2]; - uint64_t sender; -}; - -struct hyperv_message { - struct hyperv_message_header header; - uint8_t payload[HV_MESSAGE_PAYLOAD_SIZE]; -}; - -struct hyperv_message_page { - struct hyperv_message slot[HV_SINT_COUNT]; -}; - -/* - * SynIC event flags structures - */ -struct hyperv_event_flags { - DECLARE_BITMAP(flags, HV_EVENT_FLAGS_COUNT); -}; - -struct hyperv_event_flags_page { - struct hyperv_event_flags slot[HV_SINT_COUNT]; -}; #endif 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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H3agT6CjxcExY6w== 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/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OU0+7XsXeqCjApluS07iqPDWIkbdE31e2WOnsLZg=; 7:o5de0EKvPScgOOq0nvu6KfsXO0AKEhMm6GEftKoVWBEtv34Q1MmC6x9WZxcohd4EfGgbROx1QS6IOP1JTb1EOoezy4LAV/bZlc70Iq79u7OF3Y8PYEVPVId/np+EhYuqnx0uukQeLHtGNA3auXicbURmkl6RcXTtp2f69SLCA27EFaVx8T7z2eUJuU8DTvjYcSx0/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) From patchwork Fri Sep 21 08:20:39 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 10609351 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 EF3B51390 for ; Fri, 21 Sep 2018 08:51:51 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DC5CF2DB2F for ; Fri, 21 Sep 2018 08:51:51 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CED4B2DB3F; Fri, 21 Sep 2018 08:51:51 +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 983512DB2F for ; Fri, 21 Sep 2018 08:51:50 +0000 (UTC) Received: from localhost ([::1]:54562 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3HAD-0001pg-Qu for patchwork-qemu-devel@patchwork.kernel.org; Fri, 21 Sep 2018 04:51:49 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48267) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3GgO-0005Je-Bf for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:21:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g3GgM-0006LB-C8 for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:21:00 -0400 Received: from mail-am5eur02on0701.outbound.protection.outlook.com ([2a01:111:f400:fe07::701]:6116 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 1g3GgM-0006Hi-15 for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:20: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=HlzwDhsh3G7QEWnbeCp1nzOadbCyF2DnMVqzazKEfXE=; b=YOABhFgxXubo+lScRKN50w9XEBHWVcpgY+zAV+RHa7++ARbBj/S0ShnDjWic7lEMIQl4t3U8asu165yg8pQK/Wr6BW7C9IOedIhj00+D3oSOyIFLVgYLkurYqDEJuJBCXQhlY/6n9+D1DPM292Bx7RxNsO1EJPu1C+LFLXU1wQw= 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:53 +0000 From: Roman Kagan To: qemu-devel@nongnu.org Date: Fri, 21 Sep 2018 11:20:39 +0300 Message-Id: <20180921082041.29380-4-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: f3c46c78-bd71-4ba9-5e32-08d61f9b2671 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:KDYoIOClPt8FDOh2yqNPrW4BSILCDbWLrKpf1xSgvesI5d+6jztOmZEEoNE7+Rhi9/TKG0F7l5vbOJYoZHwKor62yI1Y/T7FF75O/zMyKYiqAiG7gLlS/p/dkPHSvzcoF8QqWzwacC85wxgKWVOO54/5YxQMP+Kcxq05uI1x0O/R5cx9RN9LfYnNOv+gYk6DXXuSSHxXqjqZURRTbniGYEidmAtQkHiw3Qx7F1FxTVYGd256f0Tyy+QaBZaMrdEa; 25:T6z0iTQ2vmT+bdBccww65aZ1bNx3cMQYyvVtfMFdGvEmz4vJoJ0lX0s2Do+ipbulbkiapvqsBwjclIuQ6vSX6Q8sNGALT39XjzAFbtYx//HuHF7LgYH4Ai8nGKlNDA4IYj/MPptL7VWgQA7nqvj68zyE/zHNfHkxRBOzV6vOjNLdRvQwVSURVL42xLNfosbtZagpgSXLVCGrj3CU5srhU4aixUobJub4WJO/cbto9DNpdC0j26v4pcXr60J5GN4BTyDBCE/R8DgvWaOdX8lICVbxDTUYcA6LdPluR8VfLQWTo7pZFZughWbbVnNWEQ+egXD1Ah5XBseaMhtKSldEUg==; 31:ThYByILqGSjtP0/9yYtoyFEgO1+SmolbN2mRhj/0SU9dlB1V5AN5aLekoD/CHe9EUAZVe0ee9ULqF7qaJvpHoDGf3kMYdty5xd1MfluQnyPY2S0f3bAlIfyWMcVHpJ4mvTAEDXIIhb4zgFKPTDORv6pl1+N2zl30YW8FxMe4XTS3Omc9UdyHBvbM5ldj3KuFaJuqictBE5RKXzALyjfatHhhClrAbh9YYXCa9y9AV3s= X-MS-TrafficTypeDiagnostic: AM0PR08MB3585: X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3585; 20:wTOhIOYIJsvSCkC0uH74JvCBhVZcpgKEgM5DtsKuh8DePvjmABw1o/qv9eOHaWlLDaoyxR/kCrKXt4l5lA13ZUE+H+ULhn/kW6Xxp6iOj7RpicDq6gFcqm3SCjZF57ajVoFvQtTRDALDtnEldh3T/R3IZvqiQs9Xb7iqifQqoe6g4r9DfJu2JSkcHDx7o6nnF9g8owGgkjpEfIPD6NPV3yzYW/7PbszPT7Z7eDzLA+lZyDCZ/KExv+EUFJEvBatEHufe3NC9+f2CA7/IBEUUwnTuaTLg2LuygpIm5ZFyR4dC/IrD4fe0YoDrilapmeatBIw+jgFCzgOJ7EH41kGhm4vdja0g/63RMg4znY9ncMVEPE3dxmBUzsr4m+/QCvbw80jXvX1VZQE3OhIp5COH1yP/kD4xEHiR3/lXolY8LuwZ0GEo0WRkD7oYc9Q3HmuSc+vASiOHmff/Mg4eE91Gdka6ifG8JxUz5T8TUJlJoq5LKIDFfmxFNTdLkEn4I7P3; 4:FQ1JDI7ld/nb+pXJtsymhz/bnYmxq/dqv+y7rbBvzK1EmddYjtLelEaYpH//6Ha65my8cp+LysZ+4ZQM1DzcG5C2vK1UAEN33ok4Y8tS1ZxQcezKpPXy3hNpIIM51x3UAxxf9Xy1ixe9jok+zQxY51hWrNAcMx+EZ+d5GcDg/No/t7+C3WYa8XppwoHzZMTkdLhk4o8cn8qFb1o68s10YyMwJcnl/LiNX2mJ03dmT3bgrOi+DG3VsO6mazpc2U1OIeKfii5lNFxfuUvGwXetfw== 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:ECj/xcsRaDlxZTGd8sb2LjoXYJuMUaQBLOeYoN42b?= iEIk/d9eiws2+cWWtCoEGy/9W4YcK7ihodTuCbUDka/dgXtF/0LN5Cg5+Zt5Q0sfJFIfu9DzNa0NYRr11tsj7XjXoKMj2T0ybueyGzBx4E/SO/bGX7by1pH7yq/5aha/v2O02M3GssPwi2LMEBkQBxnqMDywEK1xVdNEELKN9Z8WdgZcNz86XqPGrhy7h6kfHXrphD4SRqwgbqur49lvrRqzDO7dYAB+elLR2vcO7LqerDmSRbWAqjqumJiO/lVf96e5ZndmBrM4OaILqQevzZxt8SG8FhR45PS6bsHF+8nbHUwsdcSnsEqaGCyq1fBu1IIGJU9lENzkp/02nXP8L5q5b/fYBVAaerVKFdu8ENNW2qTmh4yrbFwdKUPIZSQd73HVEXUqixvuBjcpRMYCVH/FfmVyvnRGSSJP1tPemuJXtVIwESDNbSpjcyazxLpVRBe9GKMlZp/VBcUtzaxJrwEifrUaaTzVPEQ157vPX7LWRLwW5E4XWzftxBhdywL36EXSZTIZ2DJNTBAx0O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585; 20:/489zVFyv0sYlCeQAhHyVLgKhAq4lBbbohKouWkkM/xlpSW23LEzeeSRyXbhvZBxPQhgSPnZ+N8xTD6HM/lG0M4ayZAdJTX04E1Zu1i3up6hgY7zou927EGNKh2S/ZFVzXdlQOi2EoZ77ztmNkdYOOnuago+Z2U4dGBSgy24Kww= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2018 08:20:53.4001 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f3c46c78-bd71-4ba9-5e32-08d61f9b2671 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::701 Subject: [Qemu-devel] [PATCH 3/5] hyperv: factor out arch-independent API into hw/hyperv 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 A significant part of hyperv.c is not actually tied to x86, and can be moved to hw/. This will allow to maintain most of Hyper-V and VMBus target-independent, and to avoid conflicts with inclusion of arch-specific headers down the road in VMBus implementation. Also this stuff can now be opt-out with CONFIG_HYPERV. Signed-off-by: Roman Kagan --- {target/i386 => include/hw/hyperv}/hyperv.h | 21 ++-- target/i386/hyperv.h | 17 +-- {target/i386 => hw/hyperv}/hyperv.c | 76 ++---------- hw/misc/hyperv_testdev.c | 2 +- target/i386/hyperv.c | 127 +------------------- target/i386/kvm.c | 5 +- hw/Makefile.objs | 1 + hw/hyperv/Makefile.objs | 1 + 8 files changed, 28 insertions(+), 222 deletions(-) copy {target/i386 => include/hw/hyperv}/hyperv.h (59%) copy {target/i386 => hw/hyperv}/hyperv.c (65%) create mode 100644 hw/hyperv/Makefile.objs diff --git a/target/i386/hyperv.h b/include/hw/hyperv/hyperv.h similarity index 59% copy from target/i386/hyperv.h copy to include/hw/hyperv/hyperv.h index 8d4619c078..d6c8d78353 100644 --- a/target/i386/hyperv.h +++ b/include/hw/hyperv/hyperv.h @@ -1,27 +1,20 @@ /* - * QEMU KVM Hyper-V support + * Hyper-V guest/hypervisor interaction * - * Copyright (C) 2015 Andrey Smetanin - * - * Authors: - * Andrey Smetanin + * Copyright (c) 2015-2018 Virtuozzo International GmbH. * * This work is licensed under the terms of the GNU GPL, version 2 or later. * See the COPYING file in the top-level directory. - * */ -#ifndef TARGET_I386_HYPERV_H -#define TARGET_I386_HYPERV_H +#ifndef HW_HYPERV_HYPERV_H +#define HW_HYPERV_HYPERV_H -#include "cpu.h" -#include "sysemu/kvm.h" +#include "cpu-qom.h" typedef struct HvSintRoute HvSintRoute; typedef void (*HvSintAckClb)(void *data); -int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit); - HvSintRoute *hyperv_sint_route_new(uint32_t vp_index, uint32_t sint, HvSintAckClb sint_ack_clb, void *sint_ack_clb_data); @@ -30,9 +23,9 @@ void hyperv_sint_route_unref(HvSintRoute *sint_route); int hyperv_sint_route_set_sint(HvSintRoute *sint_route); -static inline uint32_t hyperv_vp_index(X86CPU *cpu) +static inline uint32_t hyperv_vp_index(CPUState *cs) { - return CPU(cpu)->cpu_index; + return cs->cpu_index; } #endif diff --git a/target/i386/hyperv.h b/target/i386/hyperv.h index 8d4619c078..5c49251ecb 100644 --- a/target/i386/hyperv.h +++ b/target/i386/hyperv.h @@ -16,23 +16,8 @@ #include "cpu.h" #include "sysemu/kvm.h" - -typedef struct HvSintRoute HvSintRoute; -typedef void (*HvSintAckClb)(void *data); +#include "hw/hyperv/hyperv.h" int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit); -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 hyperv_sint_route_set_sint(HvSintRoute *sint_route); - -static inline uint32_t hyperv_vp_index(X86CPU *cpu) -{ - return CPU(cpu)->cpu_index; -} - #endif diff --git a/target/i386/hyperv.c b/hw/hyperv/hyperv.c similarity index 65% copy from target/i386/hyperv.c copy to hw/hyperv/hyperv.c index 68816642c9..97db87561e 100644 --- a/target/i386/hyperv.c +++ b/hw/hyperv/hyperv.c @@ -1,24 +1,20 @@ /* - * QEMU KVM Hyper-V support + * Hyper-V guest/hypervisor interaction * - * Copyright (C) 2015 Andrey Smetanin - * - * Authors: - * Andrey Smetanin + * Copyright (c) 2015-2018 Virtuozzo International GmbH. * * This work is licensed under the terms of the GNU GPL, version 2 or later. * See the COPYING file in the top-level directory. - * */ #include "qemu/osdep.h" #include "qemu/main-loop.h" -#include "hyperv.h" -#include "hyperv-proto.h" +#include "sysemu/kvm.h" +#include "hw/hyperv/hyperv.h" struct HvSintRoute { uint32_t sint; - X86CPU *cpu; + CPUState *cs; int gsi; EventNotifier sint_set_notifier; EventNotifier sint_ack_notifier; @@ -27,57 +23,11 @@ struct HvSintRoute { unsigned refcount; }; -static X86CPU *hyperv_find_vcpu(uint32_t 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) +static CPUState *hyperv_find_vcpu(uint32_t vp_index) { - CPUX86State *env = &cpu->env; - - switch (exit->type) { - case KVM_EXIT_HYPERV_SYNIC: - if (!cpu->hyperv_synic) { - return -1; - } - - /* - * For now just track changes in SynIC control and msg/evt pages msr's. - * When SynIC messaging/events processing will be added in future - * here we will do messages queues flushing and pages remapping. - */ - switch (exit->u.synic.msr) { - case HV_X64_MSR_SCONTROL: - env->msr_hv_synic_control = exit->u.synic.control; - break; - case HV_X64_MSR_SIMP: - env->msr_hv_synic_msg_page = exit->u.synic.msg_page; - break; - case HV_X64_MSR_SIEFP: - env->msr_hv_synic_evt_page = exit->u.synic.evt_page; - break; - default: - return -1; - } - return 0; - case KVM_EXIT_HYPERV_HCALL: { - uint16_t code; - - code = exit->u.hcall.input & 0xffff; - switch (code) { - case HV_POST_MESSAGE: - case HV_SIGNAL_EVENT: - default: - exit->u.hcall.result = HV_STATUS_INVALID_HYPERCALL_CODE; - return 0; - } - } - default: - return -1; - } + CPUState *cs = qemu_get_cpu(vp_index); + assert(hyperv_vp_index(cs) == vp_index); + return cs; } static void kvm_hv_sint_ack_handler(EventNotifier *notifier) @@ -95,10 +45,10 @@ HvSintRoute *hyperv_sint_route_new(uint32_t vp_index, uint32_t sint, HvSintRoute *sint_route; EventNotifier *ack_notifier; int r, gsi; - X86CPU *cpu; + CPUState *cs; - cpu = hyperv_find_vcpu(vp_index); - if (!cpu) { + cs = hyperv_find_vcpu(vp_index); + if (!cs) { return NULL; } @@ -132,7 +82,7 @@ HvSintRoute *hyperv_sint_route_new(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->cpu = cpu; + sint_route->cs = cs; sint_route->sint = sint; sint_route->refcount = 1; diff --git a/hw/misc/hyperv_testdev.c b/hw/misc/hyperv_testdev.c index 8654b13d76..02ef606469 100644 --- a/hw/misc/hyperv_testdev.c +++ b/hw/misc/hyperv_testdev.c @@ -15,7 +15,7 @@ #include "qemu/queue.h" #include "hw/qdev.h" #include "hw/isa/isa.h" -#include "target/i386/hyperv.h" +#include "hw/hyperv/hyperv.h" typedef struct TestSintRoute { QLIST_ENTRY(TestSintRoute) le; diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index 68816642c9..1eac727774 100644 --- a/target/i386/hyperv.c +++ b/target/i386/hyperv.c @@ -12,28 +12,10 @@ */ #include "qemu/osdep.h" -#include "qemu/main-loop.h" #include "hyperv.h" +#include "hw/hyperv/hyperv.h" #include "hyperv-proto.h" -struct HvSintRoute { - uint32_t sint; - X86CPU *cpu; - int gsi; - EventNotifier sint_set_notifier; - EventNotifier sint_ack_notifier; - HvSintAckClb sint_ack_clb; - void *sint_ack_clb_data; - unsigned refcount; -}; - -static X86CPU *hyperv_find_vcpu(uint32_t 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) { CPUX86State *env = &cpu->env; @@ -79,110 +61,3 @@ int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit) return -1; } } - -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_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; - 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); - if (r) { - goto err; - } - - 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(ack_notifier, kvm_hv_sint_ack_handler); - } - - gsi = kvm_irqchip_add_hv_sint_route(kvm_state, vp_index, sint); - if (gsi < 0) { - goto err_gsi; - } - - r = kvm_irqchip_add_irqfd_notifier_gsi(kvm_state, - &sint_route->sint_set_notifier, - ack_notifier, gsi); - if (r) { - goto err_irqfd; - } - sint_route->gsi = gsi; - sint_route->sint_ack_clb = sint_ack_clb; - 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; - -err_irqfd: - kvm_irqchip_release_virq(kvm_state, gsi); -err_gsi: - 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: - g_free(sint_route); - - return NULL; -} - -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); - kvm_irqchip_release_virq(kvm_state, sint_route->gsi); - 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); -} - -int hyperv_sint_route_set_sint(HvSintRoute *sint_route) -{ - return event_notifier_set(&sint_route->sint_set_notifier); -} diff --git a/target/i386/kvm.c b/target/i386/kvm.c index 0b2a07d3a4..892d4f46c1 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -773,7 +773,7 @@ static int hyperv_init_vcpu(X86CPU *cpu) } assert(ret == 1); - if (msr_data.entries[0].data != hyperv_vp_index(cpu)) { + if (msr_data.entries[0].data != hyperv_vp_index(CPU(cpu))) { error_report("kernel's vp_index != QEMU's vp_index"); return -ENXIO; } @@ -1937,7 +1937,8 @@ static int kvm_put_msrs(X86CPU *cpu, int level) kvm_msr_entry_add(cpu, HV_X64_MSR_VP_RUNTIME, env->msr_hv_runtime); } if (cpu->hyperv_vpindex && hv_vpindex_settable) { - kvm_msr_entry_add(cpu, HV_X64_MSR_VP_INDEX, hyperv_vp_index(cpu)); + kvm_msr_entry_add(cpu, HV_X64_MSR_VP_INDEX, + hyperv_vp_index(CPU(cpu))); } if (cpu->hyperv_synic) { int j; diff --git a/hw/Makefile.objs b/hw/Makefile.objs index a19c1417ed..b8f4675219 100644 --- a/hw/Makefile.objs +++ b/hw/Makefile.objs @@ -9,6 +9,7 @@ devices-dirs-$(CONFIG_SOFTMMU) += cpu/ devices-dirs-$(CONFIG_SOFTMMU) += display/ devices-dirs-$(CONFIG_SOFTMMU) += dma/ devices-dirs-$(CONFIG_SOFTMMU) += gpio/ +devices-dirs-$(CONFIG_SOFTMMU) += hyperv/ devices-dirs-$(CONFIG_SOFTMMU) += i2c/ devices-dirs-$(CONFIG_SOFTMMU) += ide/ devices-dirs-$(CONFIG_SOFTMMU) += input/ diff --git a/hw/hyperv/Makefile.objs b/hw/hyperv/Makefile.objs new file mode 100644 index 0000000000..19928b726e --- /dev/null +++ b/hw/hyperv/Makefile.objs @@ -0,0 +1 @@ +obj-$(CONFIG_HYPERV) += hyperv.o From patchwork Fri Sep 21 08:20:40 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 10609345 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 8475314DA for ; Fri, 21 Sep 2018 08:48:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74F822DA62 for ; Fri, 21 Sep 2018 08:48:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 694512DA90; Fri, 21 Sep 2018 08:48: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 00AFA2DA62 for ; Fri, 21 Sep 2018 08:48:40 +0000 (UTC) Received: from localhost ([::1]:54541 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3H7A-0007ro-8I for patchwork-qemu-devel@patchwork.kernel.org; Fri, 21 Sep 2018 04:48:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48243) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3GgN-0005J1-UK for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:21:00 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g3GgM-0006MM-Us for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:20:59 -0400 Received: from mail-am5eur02on0701.outbound.protection.outlook.com ([2a01:111:f400:fe07::701]:6116 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 1g3GgM-0006Hi-JO for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:20: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=NsTV3AeMutI37+fofRpy/wfcEhFq24Owo7JmhwHKCoc=; b=CvkyRMFoif8O1Dtl7IuO0e0M+gqQuQiJU/VDr3hlRYS3pfCBawOrouRY0PRT7G33IRIGn5GnXYkUO/NnTHex4gaI7x+fBPP9g6k3iVWOmUk7igy2HBKFTqgd2BhF6BVrmflxw+o18RXHV6uxHpAGYqjRwWcnNezmXSyp9zINOso= 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:54 +0000 From: Roman Kagan To: qemu-devel@nongnu.org Date: Fri, 21 Sep 2018 11:20:40 +0300 Message-Id: <20180921082041.29380-5-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: 1c9a86da-a5c6-4a30-e263-08d61f9b2754 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:OS3QKOP8s3SqrRrewCYD5OkJfutERuq6toLFIr8tx+d7rO9GOfkLgU+XBB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PT0DXCJx5C4T8sfAqqpnD491j3688jF1b1gXIjRV02UBLCzypipHrVBa6hnqM6p0wsadybt1e58LPiYOww56zpGyjj5PZG8ihAxlzGlr7sfOxytoN36HBvhh04uWCQVO/41PWfz2Za6A4gWNmSmvOT10QpfV+1/s8JkDIt+XOPG53eVtKBmeqeGeI9ILo/Yh5FOgGO3ZDGjiqJOqAvsHd4C56khn56ud838lFR1bfB1O5Nk2bQMB0/v2ThHm4HdOwwlPGpX/cW/BBMsHE; 4:jlmAEO6fS57idVYToaJPFuQ/vJbhkXWjVmFkWdpZDYl37dLqzyJId0UXdZ8Qb3XNzdpaLkudy0hormDoGyOKwbrQxF7RCR/ypvI6e8BMFHlU6+QVxI9INouQld2lW4KbV/ZDGSF7wl0ogAh6+ZVD7D78B7HsaCIAhY0aprGtyEryAfbdT45LwGdApC5EvkG8K5dK6IFBo+gEwzIO+BJkaJoLW6B06JaAouWI6s9UVuxOEvvIgv7Ory+ymUJvJhsgKgFSRxWxio1pBqDxg7XqLg== 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)(14444005)(53936002)(5660300001)(36756003)(7416002)(105586002)(11346002)(66066001)(446003)(486006)(1076002)(575784001)(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:nggKUHEAFWOJknlDL5jN3/ofYGRaB15PG25WZuWq5?= 0WyPyx9w37ddwvOh25tU8nlHv3xq6r9aJIC8niRTcxT468Ycb17nmHZ8KLz/OCH7RyakuEhW2UoJOpiNFf8x6gsAwhCheBrgvYcGYG551quHHKZiUg9O+gAsrLUdH11iJeX5koS73Jlw5F2gqBIBNHk8UqjknWfMy56P+4vCMtOQuyMtL992Ka1afPO/UZWqcnVkUJEzq/ge1hkmUEPhG+wbWq1kQG9vc6XbRKT3OXCiTmwXSwcOYqCE2eK/m52d9HXGAgJB/zqDGyislC1i54OFcjvbCM+Qhhh1Mw2i8DwBj7eUJXAwQu/Ck9kgXehFFulYOY59a6CibvNN86jc3uj9+W9jqYwBU4//tNBeYtjX5a8EJ/EplBetuVxpZnUCQ4+wbyM+c7toH/h0ke7FsrlbIU7vGjLbFOoC4/C4Rh1bjh/xE4TZhULDWzrHVqxvZFdi6sPCrWwwtPOgmUcMNdf8DULtunjzNnCYIj95jhO3qPMgLYTrbVB3OxIBdvoxwbRjerY2mhvsAasK0IrnERtgh+rFIow4ujRD56K8lMHWIrD78ofdii+ifDtxDX9G8vRzUbTk/UAV0wATivWotkGWwWoxbT1ZLpP308HOTcYG3E03yp7MLG+ML1ic5dYH21yJ454gbcUuzAV0f2kBy5Usv34eWw0wsFcgnZQbDpJE1v0NOPlVr4SUsHbkSFbC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qDvtyOuCVPRoOH2qePkp2Xg0QlIZ949MhmmiZLelkiXMSEOlErrhht2wehAJpQ= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2018 08:20:54.8872 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 1c9a86da-a5c6-4a30-e263-08d61f9b2754 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::701 Subject: [Qemu-devel] [PATCH 4/5] default-configs: collect CONFIG_HYPERV* in hyperv.mak 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 Accumulate HYPERV config options in a dedicated file. There are only two so far; more will be added later. Signed-off-by: Roman Kagan --- default-configs/hyperv.mak | 2 ++ default-configs/i386-softmmu.mak | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 default-configs/hyperv.mak diff --git a/default-configs/hyperv.mak b/default-configs/hyperv.mak new file mode 100644 index 0000000000..3d45e28403 --- /dev/null +++ b/default-configs/hyperv.mak @@ -0,0 +1,2 @@ +CONFIG_HYPERV=$(CONFIG_KVM) +CONFIG_HYPERV_TESTDEV=$(CONFIG_HYPERV) diff --git a/default-configs/i386-softmmu.mak b/default-configs/i386-softmmu.mak index 8c7d4a0fa0..210cff2781 100644 --- a/default-configs/i386-softmmu.mak +++ b/default-configs/i386-softmmu.mak @@ -3,6 +3,7 @@ include pci.mak include sound.mak include usb.mak +include hyperv.mak CONFIG_QXL=$(CONFIG_SPICE) CONFIG_VGA_ISA=y CONFIG_VGA_CIRRUS=y @@ -58,7 +59,6 @@ CONFIG_XIO3130=y CONFIG_IOH3420=y CONFIG_I82801B11=y CONFIG_SMBIOS=y -CONFIG_HYPERV_TESTDEV=$(CONFIG_KVM) CONFIG_PXB=y CONFIG_ACPI_VMGENID=y CONFIG_FW_CFG_DMA=y From patchwork Fri Sep 21 08:20:41 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 10609339 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 B7B8214DA for ; Fri, 21 Sep 2018 08:46:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A834E2DDA6 for ; Fri, 21 Sep 2018 08:46:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9AC5E2DDAB; Fri, 21 Sep 2018 08:46:15 +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 1D9EC2DDA6 for ; Fri, 21 Sep 2018 08:46:15 +0000 (UTC) Received: from localhost ([::1]:54526 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3H4o-00057Z-9P for patchwork-qemu-devel@patchwork.kernel.org; Fri, 21 Sep 2018 04:46:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48272) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1g3GgO-0005Jp-FO for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:21:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1g3GgN-0006OS-Fm for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:21:00 -0400 Received: from mail-am5eur02on0701.outbound.protection.outlook.com ([2a01:111:f400:fe07::701]:6116 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 1g3GgN-0006Hi-45 for qemu-devel@nongnu.org; Fri, 21 Sep 2018 04:20:59 -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=wsaBS7wWhWtse3v9YbFQ30ojySqO9vfaJeClT/4ncJk=; b=eIR+M5nSqzpkjyshdd0X3tIJCKiLkZoJ7MgYSjKvaDN++EuCWkBzPObxJnm01E2VUmNYBymhbHQn+zWn4sC/ucEBZz5HYTliYvhSLNt30TyAx8VTlqezXqi1w6e8uDODnHbgCKdOWUpjfEd7BMSCzOx9WGsbL6iCfGZo0qYecOI= 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:56 +0000 From: Roman Kagan To: qemu-devel@nongnu.org Date: Fri, 21 Sep 2018 11:20:41 +0300 Message-Id: <20180921082041.29380-6-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: cac2b7d1-2849-453d-6cea-08d61f9b283f 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:TqdQVgDnjBacjwrDk1PGyWyE2jd/wN0AnQ5pTKPfr9BY49p+rpLXjYs0MOa0UO6OpC/jAWmwaUcjnHZeLStwrVkrh9Bms21wf5cWcHmnA+JlKIaL2nvI3MlS0AcDncD5Blvbv+WaAxmTQHtZ/im84OGzet5XOmvaDIRSoTOk1y0+8Hr8kXOsI9dx75EPK9Pe1epLg+0yyFtpathHs3KyXqi+c7go5jUINK87c/IWHrzns+d1sTHe67u0gYBGidvl; 25:5kTNet0FQkbYTOgxrC7kPkYpkztnZ4M92bJEnqnSGX2IifsbL64OUYzmpKRTTAt0OcunqcZHmvnS/fOaCrC2gSnyDCwZWdfMqwH4mbx0YvVc/p77X3VfTtjzcGBybEOExnaXlhxAlgdvVV+OBuqk6R0ZRKrkpt0BN7dF2gAnM9SMTkZIxlCKqc9Qq43MOI0XOZVaDbd/OJnenUCKpxApwHXYooZ5CBjkVpnEnngJg3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BP+m3+hVpLlzABGPfyTFpkO4vXzCdQh3xI3Enwe/ja/nDeBHxZFrmjO51VB/5x7j7/xBSldY2F8SXdJa+C5M+qEsIiobPDPioJgPnxSCUVO5CebISZzP4OqUKgcvxsHzmoXneHJNYNEsg== 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)(14444005)(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:S+zoBKXIESlEAnUXWa8V3m6ZaYLUrhfDUQVAGlT21?= uQVn5ZeGqJ2ja53oAFegk+BjEJk/Ct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B0Kf46kHLPkTUMmKZcGYZVjAsNg==; 5:xwgGB4deppWnyawKDovvg8GNfruhCrGJsTYsz8Qru8vwDhyvFf/muZKML/EgbNHIa9ZUCmWDUoBwcsNgJwczdiy+WWJoNmBBeHra7rq/ll2M0spyQM3EvzXxRVho5DfX4cOzqaOollT2ldLqYjrH7TrsZfwMVLWruB/UXl0Da3c=; 7:6mIInCfnYRgFJk365AexJvHXHLPDXgnVzoq1lHY4rS7Q4WXBOY0YkbrmpuSne2nlJPAj7sjpuQscR5EYNxuHmSHrwJZNiMpLRDff2ULRyWJHRgl4MgimsMlEj7w8G9U1VM4IAqqHvDs9fR/r0hwOgFt3K1yyrurgp1Wix1aezGiVldK+1w/nLTUcnFxLVZDwD5xSgqX2EadApXYxZktvyfC1MM1eLUoz3Dzj56DkaAmsCm7g38k/Zc5+VtBJL99S SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; AM0PR08MB3585; 20:OPsIszxuQuna/UQcayVxxqmf2gO624gBGMmCIB9YDpAwRqM0Z5T4BcUCp3E61Oqfaw2tJXEepbAPjfyFNiwCiGPCAOHpFYymbt6we87KA7S+gDixSKM6XB0xpGgyM4gHq0TItYFqyDzprsb56ayOurOZg26fQdmANSBWLXkLZZk= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Sep 2018 08:20:56.4253 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: cac2b7d1-2849-453d-6cea-08d61f9b283f 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::701 Subject: [Qemu-devel] [PATCH 5/5] i386: add hyperv-stub for CONFIG_HYPERV=n 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 This will allow to build slightly leaner QEMU that supports some HyperV features of KVM (e.g. SynIC timers, PV spinlocks, APIC assists, etc.) but nothing else on the QEMU side. Signed-off-by: Roman Kagan --- target/i386/hyperv-stub.c | 33 +++++++++++++++++++++++++++++++++ target/i386/Makefile.objs | 4 +++- 2 files changed, 36 insertions(+), 1 deletion(-) create mode 100644 target/i386/hyperv-stub.c diff --git a/target/i386/hyperv-stub.c b/target/i386/hyperv-stub.c new file mode 100644 index 0000000000..cba4ce774e --- /dev/null +++ b/target/i386/hyperv-stub.c @@ -0,0 +1,33 @@ +/* + * Stubs for CONFIG_HYPERV=n + * + * Copyright (c) 2015-2018 Virtuozzo International GmbH. + * + * This work is licensed under the terms of the GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ + +#include "qemu/osdep.h" +#include "hyperv.h" + +int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit) +{ + switch (exit->type) { + case KVM_EXIT_HYPERV_SYNIC: + if (!cpu->hyperv_synic) { + return -1; + } + + /* + * Tracking the changes in the MSRs is unnecessary as there are no + * users for them beside save/load, which is handled nicely by the + * generic MSR save/load code + */ + return 0; + case KVM_EXIT_HYPERV_HCALL: + exit->u.hcall.result = HV_STATUS_INVALID_HYPERCALL_CODE; + return 0; + default: + return -1; + } +} diff --git a/target/i386/Makefile.objs b/target/i386/Makefile.objs index 04678f5503..ca85de79d3 100644 --- a/target/i386/Makefile.objs +++ b/target/i386/Makefile.objs @@ -4,7 +4,9 @@ obj-$(CONFIG_TCG) += bpt_helper.o cc_helper.o excp_helper.o fpu_helper.o obj-$(CONFIG_TCG) += int_helper.o mem_helper.o misc_helper.o mpx_helper.o obj-$(CONFIG_TCG) += seg_helper.o smm_helper.o svm_helper.o obj-$(CONFIG_SOFTMMU) += machine.o arch_memory_mapping.o arch_dump.o monitor.o -obj-$(CONFIG_KVM) += kvm.o hyperv.o +obj-$(CONFIG_KVM) += kvm.o +obj-$(CONFIG_HYPERV) += hyperv.o +obj-$(call lnot,$(CONFIG_HYPERV)) += hyperv-stub.o obj-$(CONFIG_SEV) += sev.o obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o obj-$(call lnot,$(CONFIG_SEV)) += sev-stub.o