From patchwork Thu Jul 13 20:15:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Roman Kagan X-Patchwork-Id: 9839439 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 BBE69602BD for ; Thu, 13 Jul 2017 18:02:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2A3B9288C6 for ; Thu, 13 Jul 2017 21:04:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 09FED288BB; Thu, 13 Jul 2017 21:04:50 +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 35DDA288A0 for ; Thu, 13 Jul 2017 21:04:19 +0000 (UTC) Received: from localhost ([::1]:33899 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVkbM-0004Ql-K7 for patchwork-qemu-devel@patchwork.kernel.org; Thu, 13 Jul 2017 16:20:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:53505) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dVkWO-0000jo-3A for qemu-devel@nongnu.org; Thu, 13 Jul 2017 16:15:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dVkWL-0000xM-9i for qemu-devel@nongnu.org; Thu, 13 Jul 2017 16:15:36 -0400 Received: from mail-ve1eur01on0097.outbound.protection.outlook.com ([104.47.1.97]:58779 helo=EUR01-VE1-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 1dVkWK-0000vd-SA for qemu-devel@nongnu.org; Thu, 13 Jul 2017 16:15:33 -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; bh=g4PJ5137jkKpM81ELcfHKIStit72yaqhYLdl2TtuH6k=; b=EWxntjIOBmWMXsKXBM91m9UrkZ6eEwSdUWjU0QMxRKV3dDJcOE+JarPfZ42NCZo97bNoGWF13t6GtFeTcPH1/suLrXXSgcLHqn55LfuLrAWhwzK1/SLdqbv7rcG9VzXI7z7CDKLFc2zx5A2CKQf9SU0CLGWDMAWOCdCjKEJA0KM= Authentication-Results: nongnu.org; dkim=none (message not signed) header.d=none; nongnu.org; dmarc=none action=none header.from=virtuozzo.com; Received: from rkaganb.sw.ru (195.214.232.6) by HE1PR08MB0841.eurprd08.prod.outlook.com (2a01:111:e400:59b2::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1240.13; Thu, 13 Jul 2017 20:15:27 +0000 From: Roman Kagan To: qemu-devel@nongnu.org, Paolo Bonzini , Eduardo Habkost Date: Thu, 13 Jul 2017 23:15:21 +0300 Message-Id: <20170713201522.13765-2-rkagan@virtuozzo.com> X-Mailer: git-send-email 2.13.0 In-Reply-To: <20170713201522.13765-1-rkagan@virtuozzo.com> References: <20170713201522.13765-1-rkagan@virtuozzo.com> MIME-Version: 1.0 X-Originating-IP: [195.214.232.6] X-ClientProxiedBy: AM5PR0701CA0003.eurprd07.prod.outlook.com (2603:10a6:203:51::13) To HE1PR08MB0841.eurprd08.prod.outlook.com (2a01:111:e400:59b2::15) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: fb97092d-5d65-4300-2b72-08d4ca2be748 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(300000500095)(300135000095)(300000501095)(300135300095)(22001)(300000502095)(300135100095)(300000503095)(300135400095)(201703131423075)(201703031133081)(300000504095)(300135200095)(300000505095)(300135600095)(300000506095)(300135500095); SRVR:HE1PR08MB0841; X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0841; 3:lLfGW2pFygXwlJ8lYTHG8DcUSVz0vxKdAc/U5jQd5JrZekq9WubZTa9WLoXAK1OQxRakvoBmz6WFEMiae9sQbsTEXeN2alGGsp+0njWwjNWYFa9OvMKm8ulemIIeb1bLzOAYtKUARhlL117CDxkVtpT+L/rK/VXGzBcYAklZhDlH9aO30YtzqK/sW4hd4C1raX7yiGkaKkihY7s4HXzynVPmC695LLcJP2Hc+l23T8ach6Vsmfvr2caafNWIYLLovZBH0wgIHbvEQqttQW2mRF/pHZIXl+emStYcklUhIfycfI3liUDwJ9OIUTsThf9v9d4NwJte4YciiJ87LqrHoUkG1dHk5ea3++4NIkzaGlR/sQghMVR3WjH2SHAeZcRBsZFgZsI5AFipPImkerg0AYyiSdOmldPjFzZ6jWOIQSAlMfm+5dKlqtpIg8d3LsP6+KG3r/iweXVcVw9yohkhZJgz3h5h7hh1C7/2IMjI+0U4hVC4AyqsKOinPvuoDZ1TFI2xHnQ8fM/OqXkx5kVATBFQTqZ6ofv1/l61HIoShkXOqLOWKonjauOTEpaggyTBsgzibW5RXQb8D9MK3KZx8g4W2TvlfEtt5eLahGIXT3+3yIsERDOZLFcVMdIzuphWLO/5KhCoZJ5H2KzxHEun29ZbF5jpNqHe3Uq3DC0WtlFtMOB9XV8xOTN3S75xwO7Dr/Zfdpt1TImGn4FGSCkFtul86PpEJvr3IIjTeS4TNgI= X-MS-TrafficTypeDiagnostic: HE1PR08MB0841: X-Microsoft-Exchange-Diagnostics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Scan:(26388249023172)(236129657087228)(148574349560750)(247924648384137); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(601004)(2401047)(2017060910075)(5005006)(8121501046)(100000703101)(100105400095)(3002001)(10201501046)(93006095)(93001095)(6041248)(20161123564025)(20161123560025)(20161123562025)(20161123558100)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123555025)(6072148)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:HE1PR08MB0841; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:HE1PR08MB0841; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR08MB0841; 4:EEkprMXdeRF90f1EpvgpkPGpsWejAnnmdFOPDUD3Ku?= =?us-ascii?Q?4zM6as052+GvPikECLL6jyXppuMK88meqvHGuRPkd6G52r16QGdG5eWURjDr?= =?us-ascii?Q?5wnbzwxLOyGSo/Jr7GjdS+A26+zNbjFRQfYrmdYhDn1RwYuepSu3GE172RUe?= =?us-ascii?Q?Zn2wcjRKC6uTwER13JJWfLQUja+H3g3b0n29gdjs9ixKyi43YnWbGDDEspKc?= =?us-ascii?Q?8RTwrW81MfgnDQ9a6bdIW7RnVNkCAKxn5NuDNdc6u0n8ZjrABaQgVTCdLu+G?= =?us-ascii?Q?h7Di4tHBePWEKUxQpPJVJqaKdI5Hn4VeyA9xgTCWBhbIKAfej/p0HuyKw1P2?= =?us-ascii?Q?OiKyo1BIFL9Ix5Y2M9Ig3OOR2BdHcmeUxIN8dYg6s0WlKIYO8QCV3ACUk/KQ?= =?us-ascii?Q?RRbDubahlId2br/NysIfbHErztkUEafH/GAVAuU31tvl3DDSpIBmQiOakdgO?= =?us-ascii?Q?ykPNcaBb2iTRucnsFiB0/oEuxoDb19G5gAARqjKZc3C5lXx4TN0xitEaTBoj?= =?us-ascii?Q?nHINQtFY7kb8EGWj7Hf1eN4FDt64cESCO1ZCgcVWPTqzz8hNm1cdWA3DClVJ?= =?us-ascii?Q?YgXIeG2tyeZIhR0R0XqCizyB6biF/UOQwKg/FupqqIDzoMyBk5mhjhLggbHt?= =?us-ascii?Q?3d67P9Sg/SGeLP3oh5UNSpNkfNKVaZCBEUJWkXYaoSjr/xPZOdvcwlAckrg+?= =?us-ascii?Q?o3tdN1xrw53wVyi++pcQGuExl4WG0x/ReGL+Zpke7rYNgc+dXwRkLPtXSAJr?= =?us-ascii?Q?SVg2zJkIqJGLD0mSHOzIz+gP1j6oPzUBS/fji4fkWpd170Z2gcPdcjtbCASR?= =?us-ascii?Q?S2Ct00JWPwnaSaF0vY1H5H45XfM/dR43H4+znzhpwRWgUqS0yk3iWqtXS0XF?= =?us-ascii?Q?dHiN76dZEdzyqyvgFhId4UC+x0mBu8njP1z9/v//5MXvsA69k5NtooScY9LL?= =?us-ascii?Q?5d59M5CQ0/Luk/m6x5HXUQqfHfWzpxoqTdqGhYcCeNLw/3f9hq5hMHr2T5MW?= =?us-ascii?Q?htsxaKcpuqHJGBaOqRdj0KmemwtTEHTICBk5lU39i4t6cryYV3XVQFfq31s7?= =?us-ascii?Q?WA7O14kwQPeOiKTP/fNWIoVmy8AQbjTj9lMwNx1I3YgY5I/qvOWojkBXjtnR?= =?us-ascii?Q?8lwUD95V3/8QJmgJK9yjbCBKFQFFENfr9AvsCqI7XQsLHlIxxFxggUdArU38?= =?us-ascii?Q?f+07CGFAKK32S/KHYP4heI1zVfpIDbqznvyMffkF3vf9dC/0sXM0PtAMRDOg?= =?us-ascii?Q?SbWxHlxDf5KZg5MYBNh/oW33ONYAx0ms3RJwYP/a/0U6d/gdfxZbYP9Nhjth?= =?us-ascii?Q?keJ1vWpx92w47pW5IXqJGz82r1cgvb6QOFYr9KGBz0?= X-Forefront-PRVS: 0367A50BB1 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(7370300001)(4630300001)(6009001)(39400400002)(39410400002)(39450400003)(39840400002)(86362001)(54906002)(3846002)(45080400002)(6506006)(305945005)(36756003)(48376002)(6666003)(2950100002)(6486002)(1076002)(7350300001)(2906002)(4326008)(33646002)(5003940100001)(6512007)(38730400002)(42186005)(189998001)(53416004)(7736002)(66066001)(76176999)(5660300001)(50466002)(25786009)(53936002)(6116002)(478600001)(50986999)(575784001)(8676002)(50226002)(81166006)(47776003); DIR:OUT; SFP:1102; SCL:1; SRVR:HE1PR08MB0841; H:rkaganb.sw.ru; FPR:; SPF:None; MLV:sfv; LANG:en; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR08MB0841; 23:5eVqa9v2iV81osFvYmUNl7Atnh2qRXO1GFvB2w+e8?= =?us-ascii?Q?RG/BuxK8R5iJLcJ4VSjB67qmJjCkNHlIaNsA7w5MVZj7/tDA55m3N5wQxMty?= =?us-ascii?Q?RFtkcs6SPn4aUDueNT6T3trwJE2IYeluxcV/MnIEVx9pZPVQfBrWuP74tzRP?= =?us-ascii?Q?XftOkSk9jIowYQVstVDvJ715NKTtK+Q/CrTHWJV+eKpGlAxiLGbeCK6cSSZH?= =?us-ascii?Q?rnnQVUHkjZX8HMFZRsYKfZFlUQFBdwuvV5iZFyv+5Tzkd/643esW5rWsgac+?= =?us-ascii?Q?iGcvOXJt/hzeIbPNiGD3yGNvOl8FWJf3oXJkmBsjJV3iQxtxj90wXwXw4OCb?= =?us-ascii?Q?YWdC6ULNGG6nNoqeOu2LnXB6usVKRX/KTfvyuuAIgNcxF4ozh0Y/kCSao66I?= =?us-ascii?Q?+iYtSW0gbumf075M90rki3pEyvQaBRpSRBPJ3hdKSXJH8tfLSkiFrM3nN1Jo?= =?us-ascii?Q?oWnqCI2oiHAWb93e7HrcfFJOXExtTmTpmfKl/iHxox+bNNXV00uL6sr3rSXS?= =?us-ascii?Q?f58cSaW7xVHvkKfLjCMiDkkfZjX/9V8sFN0zZQXvFLaB88A9EZNzP6gmqCm5?= =?us-ascii?Q?1QymPo77HmindTc6HyJ6CnRfq8Jzzq50CSAvRtY7DCWGiOlJUG5h1zUy2vEl?= =?us-ascii?Q?+hR+d3sCRc7/KPrGDIQn4RMkoL753DT3MsREETW4TykPlzapEMb9MbIvU7F8?= =?us-ascii?Q?6R/GfwXDrLmIv2ok4nSY7zEKp9mH1SK3hQNmq1kWngLKAVsTuzMpOP7n/wo/?= =?us-ascii?Q?rKIboAEfoVYjXXyo1fWmZpQz+/IX3amV7hesmXmZDTNHUI4Lm3XXNPNC0uN6?= =?us-ascii?Q?5NjQQR56zl+1ULoZhgv/uh+JZ/KRdrBznJtzJZ3o3CacKhBgOKLotvYnjb5b?= =?us-ascii?Q?aDXhiJ4it9VXiEr0mEmOXstVt5gkd7V/l7HipkVCUtf1zBVEnYeID89SvxcB?= =?us-ascii?Q?Mj60dcuNw5AQPa/b73QNgy629AUIXLPnjHiuZBYoO/DkfRiua2+7K0A0Mll/?= =?us-ascii?Q?PTacsf//gH5a5du/d2bVi/N5zJeFa9Gh0C2gkqQRpusYZNiXsjG7/kNy1bUD?= =?us-ascii?Q?bwqCEtIfq2IcIvzpxWOE1Ict4E5PndvATG4cGkSbB8G27G0qmkzqx9gSf5H3?= =?us-ascii?Q?Oxh3owlWRQ=3D?= X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; HE1PR08MB0841; 6:ihtLBUEFCITm5Pie3a7u98JbmZ7Tv+alIybRA53ugf?= =?us-ascii?Q?V4WHMj7tLzNCg27FzTk/b2RRl3iGRxJiZwzSX9QzaOnOjArTar1ThtYwfA+e?= =?us-ascii?Q?ISj7MPWrE4Jx1Si19rVYm+5NgXYSQctNdg22VWsHD2+BXUkyrpgElYEUrPkz?= =?us-ascii?Q?k8s+TvDaxtBj1jKtco64zHCse6nbqvPYkFul/kr3jUxqMJwq8f7lO9PW47Io?= =?us-ascii?Q?oRNY7eGFf9tmjLnKkJr0AwnSn2AfzUQH0G55OBoO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U9Dfc0AgWxWxbwD+bl0Y0C5oqqaN+4wqie+JpJNFSwXcrWy/nfwwWFNDu92G+LejaH8lm6fW/Ox4ap8O5HS08xlQ9S1p/+5ODbGOKmAyCKI9OPsRva+HrTIyiEcGOSStA+Ok3C/JSzt46es/3vpsNTi33a+hQHz/iH+xZDJydAE+cbJN8aXx6Iw+Q6UmXk6ZoSedH4xKD358SzPts3ZyProc12ebx30DU7Oh3NXvjNRsC7fBI5KQJiubB6xDJ6TGxgwuLuwSbQGt07x5sW9qGJHLvZ6YO1WgO282goVZ7tiXrNCdZNDzaOSj24= X-Microsoft-Exchange-Diagnostics: 1; HE1PR08MB0841; 20:D8Wko8FmPt6IXg48BwzbNO4X0wVhOgX93Y9eYdk3g1xMq65ka/oaPGJfeB7TzOtLX6CNd5pj8cPoh/dCjOlG32FNRaCWMPRa17Yp2CWxQ9uHPx5OhugH5WiW4GgdHfkd1Ny9G47sQQ7l7dtsWBY3AhlqJGKcNqs2rabi2pIiOfE= X-OriginatorOrg: virtuozzo.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 13 Jul 2017 20:15:27.2659 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: HE1PR08MB0841 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.1.97 Subject: [Qemu-devel] [PATCH 1/2] hyperv: add header with protocol definitions 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: "Denis V . Lunev" , Evgeny Yakovlev , Igor Mammedov Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP The definitions for Hyper-V emulation are currently taken from a header imported from the Linux kernel. However, as these describe a third-party protocol rather than a kernel API, it probably wasn't a good idea to publish it in the kernel uapi. This patch introduces a header that provides all the necessary definitions, superseding the one coming from the kernel. The new header supports (temporary) coexistence with the kernel one. The constants explicitly named in the Hyper-V specification (e.g. msr numbers) are defined in a non-conflicting way. Other constants and types have got new names. While at this, the protocol data structures are defined in a more conventional way, without bitfields, enums, and excessive unions. The code using this stuff is adjusted, too; it can now be built both with and without the kernel header in the tree. Signed-off-by: Roman Kagan --- target/i386/cpu.h | 10 +- target/i386/hyperv-proto.h | 257 +++++++++++++++++++++++++++++++++++++++++++++ target/i386/cpu.c | 4 +- target/i386/hyperv.c | 6 +- target/i386/kvm.c | 57 +++++----- target/i386/machine.c | 15 ++- 6 files changed, 301 insertions(+), 48 deletions(-) create mode 100644 target/i386/hyperv-proto.h diff --git a/target/i386/cpu.h b/target/i386/cpu.h index 7a228afd04..b65d6a5d70 100644 --- a/target/i386/cpu.h +++ b/target/i386/cpu.h @@ -22,7 +22,7 @@ #include "qemu-common.h" #include "cpu-qom.h" -#include "standard-headers/asm-x86/hyperv.h" +#include "hyperv-proto.h" #ifdef TARGET_X86_64 #define TARGET_LONG_BITS 64 @@ -1095,15 +1095,15 @@ typedef struct CPUX86State { uint64_t msr_hv_guest_os_id; uint64_t msr_hv_vapic; uint64_t msr_hv_tsc; - uint64_t msr_hv_crash_params[HV_X64_MSR_CRASH_PARAMS]; + uint64_t msr_hv_crash_params[HV_CRASH_PARAMS]; uint64_t msr_hv_runtime; uint64_t msr_hv_synic_control; uint64_t msr_hv_synic_version; uint64_t msr_hv_synic_evt_page; uint64_t msr_hv_synic_msg_page; - uint64_t msr_hv_synic_sint[HV_SYNIC_SINT_COUNT]; - uint64_t msr_hv_stimer_config[HV_SYNIC_STIMER_COUNT]; - uint64_t msr_hv_stimer_count[HV_SYNIC_STIMER_COUNT]; + uint64_t msr_hv_synic_sint[HV_SINT_COUNT]; + uint64_t msr_hv_stimer_config[HV_STIMER_COUNT]; + uint64_t msr_hv_stimer_count[HV_STIMER_COUNT]; /* exception/interrupt handling */ int error_code; diff --git a/target/i386/hyperv-proto.h b/target/i386/hyperv-proto.h new file mode 100644 index 0000000000..1b3fa6ef5e --- /dev/null +++ b/target/i386/hyperv-proto.h @@ -0,0 +1,257 @@ +/* + * Definitions for Hyper-V guest/hypervisor interaction + * + * Copyright (C) 2017 Parallels 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_PROTO_H +#define TARGET_I386_HYPERV_PROTO_H + +#include "qemu/bitmap.h" + +#define HV_CPUID_VENDOR_AND_MAX_FUNCTIONS 0x40000000 +#define HV_CPUID_INTERFACE 0x40000001 +#define HV_CPUID_VERSION 0x40000002 +#define HV_CPUID_FEATURES 0x40000003 +#define HV_CPUID_ENLIGHTMENT_INFO 0x40000004 +#define HV_CPUID_IMPLEMENT_LIMITS 0x40000005 +#define HV_CPUID_MIN 0x40000005 +#define HV_CPUID_MAX 0x4000ffff +#define HV_HYPERVISOR_PRESENT_BIT 0x80000000 + +/* + * HV_CPUID_FEATURES.EAX bits + */ +#define HV_VP_RUNTIME_AVAILABLE (1u << 0) +#define HV_TIME_REF_COUNT_AVAILABLE (1u << 1) +#define HV_SYNIC_AVAILABLE (1u << 2) +#define HV_SYNTIMERS_AVAILABLE (1u << 3) +#define HV_APIC_ACCESS_AVAILABLE (1u << 4) +#define HV_HYPERCALL_AVAILABLE (1u << 5) +#define HV_VP_INDEX_AVAILABLE (1u << 6) +#define HV_RESET_AVAILABLE (1u << 7) +#define HV_REFERENCE_TSC_AVAILABLE (1u << 9) + +/* + * HV_CPUID_FEATURES.EDX bits + */ +#define HV_MWAIT_AVAILABLE (1u << 0) +#define HV_GUEST_DEBUGGING_AVAILABLE (1u << 1) +#define HV_PERF_MONITOR_AVAILABLE (1u << 2) +#define HV_CPU_DYNAMIC_PARTITIONING_AVAILABLE (1u << 3) +#define HV_HYPERCALL_PARAMS_XMM_AVAILABLE (1u << 4) +#define HV_GUEST_IDLE_STATE_AVAILABLE (1u << 5) +#define HV_GUEST_CRASH_MSR_AVAILABLE (1u << 10) + +/* + * HV_CPUID_ENLIGHTMENT_INFO.EAX bits + */ +#define HV_AS_SWITCH_RECOMMENDED (1u << 0) +#define HV_LOCAL_TLB_FLUSH_RECOMMENDED (1u << 1) +#define HV_REMOTE_TLB_FLUSH_RECOMMENDED (1u << 2) +#define HV_APIC_ACCESS_RECOMMENDED (1u << 3) +#define HV_SYSTEM_RESET_RECOMMENDED (1u << 4) +#define HV_RELAXED_TIMING_RECOMMENDED (1u << 5) + +/* + * Basic virtualized MSRs + */ +#define HV_X64_MSR_GUEST_OS_ID 0x40000000 +#define HV_X64_MSR_HYPERCALL 0x40000001 +#define HV_X64_MSR_VP_INDEX 0x40000002 +#define HV_X64_MSR_RESET 0x40000003 +#define HV_X64_MSR_VP_RUNTIME 0x40000010 +#define HV_X64_MSR_TIME_REF_COUNT 0x40000020 +#define HV_X64_MSR_REFERENCE_TSC 0x40000021 +#define HV_X64_MSR_TSC_FREQUENCY 0x40000022 +#define HV_X64_MSR_APIC_FREQUENCY 0x40000023 + +/* + * Virtual APIC MSRs + */ +#define HV_X64_MSR_EOI 0x40000070 +#define HV_X64_MSR_ICR 0x40000071 +#define HV_X64_MSR_TPR 0x40000072 +#define HV_X64_MSR_APIC_ASSIST_PAGE 0x40000073 + +/* + * Synthetic interrupt controller MSRs + */ +#define HV_X64_MSR_SCONTROL 0x40000080 +#define HV_X64_MSR_SVERSION 0x40000081 +#define HV_X64_MSR_SIEFP 0x40000082 +#define HV_X64_MSR_SIMP 0x40000083 +#define HV_X64_MSR_EOM 0x40000084 +#define HV_X64_MSR_SINT0 0x40000090 +#define HV_X64_MSR_SINT1 0x40000091 +#define HV_X64_MSR_SINT2 0x40000092 +#define HV_X64_MSR_SINT3 0x40000093 +#define HV_X64_MSR_SINT4 0x40000094 +#define HV_X64_MSR_SINT5 0x40000095 +#define HV_X64_MSR_SINT6 0x40000096 +#define HV_X64_MSR_SINT7 0x40000097 +#define HV_X64_MSR_SINT8 0x40000098 +#define HV_X64_MSR_SINT9 0x40000099 +#define HV_X64_MSR_SINT10 0x4000009A +#define HV_X64_MSR_SINT11 0x4000009B +#define HV_X64_MSR_SINT12 0x4000009C +#define HV_X64_MSR_SINT13 0x4000009D +#define HV_X64_MSR_SINT14 0x4000009E +#define HV_X64_MSR_SINT15 0x4000009F + +/* + * Synthetic timer MSRs + */ +#define HV_X64_MSR_STIMER0_CONFIG 0x400000B0 +#define HV_X64_MSR_STIMER0_COUNT 0x400000B1 +#define HV_X64_MSR_STIMER1_CONFIG 0x400000B2 +#define HV_X64_MSR_STIMER1_COUNT 0x400000B3 +#define HV_X64_MSR_STIMER2_CONFIG 0x400000B4 +#define HV_X64_MSR_STIMER2_COUNT 0x400000B5 +#define HV_X64_MSR_STIMER3_CONFIG 0x400000B6 +#define HV_X64_MSR_STIMER3_COUNT 0x400000B7 + +/* + * Guest crash notification MSRs + */ +#define HV_X64_MSR_CRASH_P0 0x40000100 +#define HV_X64_MSR_CRASH_P1 0x40000101 +#define HV_X64_MSR_CRASH_P2 0x40000102 +#define HV_X64_MSR_CRASH_P3 0x40000103 +#define HV_X64_MSR_CRASH_P4 0x40000104 +#define HV_CRASH_PARAMS (HV_X64_MSR_CRASH_P4 - HV_X64_MSR_CRASH_P0 + 1) +#define HV_X64_MSR_CRASH_CTL 0x40000105 +#define HV_CRASH_CTL_NOTIFY (1ull << 63) + +/* + * 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 + */ +#define HV_HYPERCALL_ENABLE (1u << 0) + +/* + * 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) +#define HV_SINT_MASKED (1u << 16) +#define HV_SINT_AUTO_EOI (1u << 17) +#define HV_SINT_VECTOR_MASK 0xff + +#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 diff --git a/target/i386/cpu.c b/target/i386/cpu.c index c57177278b..d35a894825 100644 --- a/target/i386/cpu.c +++ b/target/i386/cpu.c @@ -3808,12 +3808,12 @@ static GuestPanicInformation *x86_cpu_get_crash_info(CPUState *cs) CPUX86State *env = &cpu->env; GuestPanicInformation *panic_info = NULL; - if (env->features[FEAT_HYPERV_EDX] & HV_X64_GUEST_CRASH_MSR_AVAILABLE) { + if (env->features[FEAT_HYPERV_EDX] & HV_GUEST_CRASH_MSR_AVAILABLE) { panic_info = g_malloc0(sizeof(GuestPanicInformation)); panic_info->type = GUEST_PANIC_INFORMATION_TYPE_HYPER_V; - assert(HV_X64_MSR_CRASH_PARAMS >= 5); + assert(HV_CRASH_PARAMS >= 5); panic_info->u.hyper_v.arg1 = env->msr_hv_crash_params[0]; panic_info->u.hyper_v.arg2 = env->msr_hv_crash_params[1]; panic_info->u.hyper_v.arg3 = env->msr_hv_crash_params[2]; diff --git a/target/i386/hyperv.c b/target/i386/hyperv.c index 8545574568..a050c9d2d1 100644 --- a/target/i386/hyperv.c +++ b/target/i386/hyperv.c @@ -14,7 +14,7 @@ #include "qemu/osdep.h" #include "qemu/main-loop.h" #include "hyperv.h" -#include "standard-headers/asm-x86/hyperv.h" +#include "hyperv-proto.h" int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit) { @@ -50,8 +50,8 @@ int kvm_hv_handle_exit(X86CPU *cpu, struct kvm_hyperv_exit *exit) code = exit->u.hcall.input & 0xffff; switch (code) { - case HVCALL_POST_MESSAGE: - case HVCALL_SIGNAL_EVENT: + case HV_POST_MESSAGE: + case HV_SIGNAL_EVENT: default: exit->u.hcall.result = HV_STATUS_INVALID_HYPERCALL_CODE; return 0; diff --git a/target/i386/kvm.c b/target/i386/kvm.c index f84a49d366..7d62abc0e7 100644 --- a/target/i386/kvm.c +++ b/target/i386/kvm.c @@ -27,6 +27,7 @@ #include "sysemu/kvm_int.h" #include "kvm_i386.h" #include "hyperv.h" +#include "hyperv-proto.h" #include "exec/gdbstub.h" #include "qemu/host-utils.h" @@ -40,7 +41,6 @@ #include "hw/i386/x86-iommu.h" #include "exec/ioport.h" -#include "standard-headers/asm-x86/hyperv.h" #include "hw/pci/pci.h" #include "hw/pci/msi.h" #include "hw/pci/msix.h" @@ -622,29 +622,29 @@ static int hyperv_handle_properties(CPUState *cs) } if (cpu->hyperv_relaxed_timing) { - env->features[FEAT_HYPERV_EAX] |= HV_X64_MSR_HYPERCALL_AVAILABLE; + env->features[FEAT_HYPERV_EAX] |= HV_HYPERCALL_AVAILABLE; } if (cpu->hyperv_vapic) { - env->features[FEAT_HYPERV_EAX] |= HV_X64_MSR_HYPERCALL_AVAILABLE; - env->features[FEAT_HYPERV_EAX] |= HV_X64_MSR_APIC_ACCESS_AVAILABLE; + env->features[FEAT_HYPERV_EAX] |= HV_HYPERCALL_AVAILABLE; + env->features[FEAT_HYPERV_EAX] |= HV_APIC_ACCESS_AVAILABLE; } if (cpu->hyperv_time) { - env->features[FEAT_HYPERV_EAX] |= HV_X64_MSR_HYPERCALL_AVAILABLE; - env->features[FEAT_HYPERV_EAX] |= HV_X64_MSR_TIME_REF_COUNT_AVAILABLE; - env->features[FEAT_HYPERV_EAX] |= 0x200; + env->features[FEAT_HYPERV_EAX] |= HV_HYPERCALL_AVAILABLE; + env->features[FEAT_HYPERV_EAX] |= HV_TIME_REF_COUNT_AVAILABLE; + env->features[FEAT_HYPERV_EAX] |= HV_REFERENCE_TSC_AVAILABLE; } if (cpu->hyperv_crash && has_msr_hv_crash) { - env->features[FEAT_HYPERV_EDX] |= HV_X64_GUEST_CRASH_MSR_AVAILABLE; + env->features[FEAT_HYPERV_EDX] |= HV_GUEST_CRASH_MSR_AVAILABLE; } - env->features[FEAT_HYPERV_EDX] |= HV_X64_CPU_DYNAMIC_PARTITIONING_AVAILABLE; + env->features[FEAT_HYPERV_EDX] |= HV_CPU_DYNAMIC_PARTITIONING_AVAILABLE; if (cpu->hyperv_reset && has_msr_hv_reset) { - env->features[FEAT_HYPERV_EAX] |= HV_X64_MSR_RESET_AVAILABLE; + env->features[FEAT_HYPERV_EAX] |= HV_RESET_AVAILABLE; } if (cpu->hyperv_vpindex && has_msr_hv_vpindex) { - env->features[FEAT_HYPERV_EAX] |= HV_X64_MSR_VP_INDEX_AVAILABLE; + env->features[FEAT_HYPERV_EAX] |= HV_VP_INDEX_AVAILABLE; } if (cpu->hyperv_runtime && has_msr_hv_runtime) { - env->features[FEAT_HYPERV_EAX] |= HV_X64_MSR_VP_RUNTIME_AVAILABLE; + env->features[FEAT_HYPERV_EAX] |= HV_VP_RUNTIME_AVAILABLE; } if (cpu->hyperv_synic) { int sint; @@ -655,10 +655,10 @@ static int hyperv_handle_properties(CPUState *cs) return -ENOSYS; } - env->features[FEAT_HYPERV_EAX] |= HV_X64_MSR_SYNIC_AVAILABLE; - env->msr_hv_synic_version = HV_SYNIC_VERSION_1; + env->features[FEAT_HYPERV_EAX] |= HV_SYNIC_AVAILABLE; + env->msr_hv_synic_version = HV_SYNIC_VERSION; for (sint = 0; sint < ARRAY_SIZE(env->msr_hv_synic_sint); sint++) { - env->msr_hv_synic_sint[sint] = HV_SYNIC_SINT_MASKED; + env->msr_hv_synic_sint[sint] = HV_SINT_MASKED; } } if (cpu->hyperv_stimer) { @@ -666,7 +666,7 @@ static int hyperv_handle_properties(CPUState *cs) fprintf(stderr, "Hyper-V timers aren't supported by kernel\n"); return -ENOSYS; } - env->features[FEAT_HYPERV_EAX] |= HV_X64_MSR_SYNTIMER_AVAILABLE; + env->features[FEAT_HYPERV_EAX] |= HV_SYNTIMERS_AVAILABLE; } return 0; } @@ -698,7 +698,7 @@ int kvm_arch_init_vcpu(CPUState *cs) /* Paravirtualization CPUIDs */ if (hyperv_enabled(cpu)) { c = &cpuid_data.entries[cpuid_i++]; - c->function = HYPERV_CPUID_VENDOR_AND_MAX_FUNCTIONS; + c->function = HV_CPUID_VENDOR_AND_MAX_FUNCTIONS; if (!cpu->hyperv_vendor_id) { memcpy(signature, "Microsoft Hv", 12); } else { @@ -711,13 +711,13 @@ int kvm_arch_init_vcpu(CPUState *cs) memset(signature, 0, 12); memcpy(signature, cpu->hyperv_vendor_id, len); } - c->eax = HYPERV_CPUID_MIN; + c->eax = HV_CPUID_MIN; c->ebx = signature[0]; c->ecx = signature[1]; c->edx = signature[2]; c = &cpuid_data.entries[cpuid_i++]; - c->function = HYPERV_CPUID_INTERFACE; + c->function = HV_CPUID_INTERFACE; memcpy(signature, "Hv#1\0\0\0\0\0\0\0\0", 12); c->eax = signature[0]; c->ebx = 0; @@ -725,12 +725,12 @@ int kvm_arch_init_vcpu(CPUState *cs) c->edx = 0; c = &cpuid_data.entries[cpuid_i++]; - c->function = HYPERV_CPUID_VERSION; + c->function = HV_CPUID_VERSION; c->eax = 0x00001bbc; c->ebx = 0x00060001; c = &cpuid_data.entries[cpuid_i++]; - c->function = HYPERV_CPUID_FEATURES; + c->function = HV_CPUID_FEATURES; r = hyperv_handle_properties(cs); if (r) { return r; @@ -740,17 +740,17 @@ int kvm_arch_init_vcpu(CPUState *cs) c->edx = env->features[FEAT_HYPERV_EDX]; c = &cpuid_data.entries[cpuid_i++]; - c->function = HYPERV_CPUID_ENLIGHTMENT_INFO; + c->function = HV_CPUID_ENLIGHTMENT_INFO; if (cpu->hyperv_relaxed_timing) { - c->eax |= HV_X64_RELAXED_TIMING_RECOMMENDED; + c->eax |= HV_RELAXED_TIMING_RECOMMENDED; } if (cpu->hyperv_vapic) { - c->eax |= HV_X64_APIC_ACCESS_RECOMMENDED; + c->eax |= HV_APIC_ACCESS_RECOMMENDED; } c->ebx = cpu->hyperv_spinlock_attempts; c = &cpuid_data.entries[cpuid_i++]; - c->function = HYPERV_CPUID_IMPLEMENT_LIMITS; + c->function = HV_CPUID_IMPLEMENT_LIMITS; c->eax = 0x40; c->ebx = 0x40; @@ -1690,12 +1690,11 @@ static int kvm_put_msrs(X86CPU *cpu, int level) if (has_msr_hv_crash) { int j; - for (j = 0; j < HV_X64_MSR_CRASH_PARAMS; j++) + for (j = 0; j < HV_CRASH_PARAMS; j++) kvm_msr_entry_add(cpu, HV_X64_MSR_CRASH_P0 + j, env->msr_hv_crash_params[j]); - kvm_msr_entry_add(cpu, HV_X64_MSR_CRASH_CTL, - HV_X64_MSR_CRASH_CTL_NOTIFY); + kvm_msr_entry_add(cpu, HV_X64_MSR_CRASH_CTL, HV_CRASH_CTL_NOTIFY); } if (has_msr_hv_runtime) { kvm_msr_entry_add(cpu, HV_X64_MSR_VP_RUNTIME, env->msr_hv_runtime); @@ -2059,7 +2058,7 @@ static int kvm_get_msrs(X86CPU *cpu) if (has_msr_hv_crash) { int j; - for (j = 0; j < HV_X64_MSR_CRASH_PARAMS; j++) { + for (j = 0; j < HV_CRASH_PARAMS; j++) { kvm_msr_entry_add(cpu, HV_X64_MSR_CRASH_P0 + j, 0); } } diff --git a/target/i386/machine.c b/target/i386/machine.c index eab33725a3..29cc58eda9 100644 --- a/target/i386/machine.c +++ b/target/i386/machine.c @@ -587,7 +587,7 @@ static bool hyperv_crash_enable_needed(void *opaque) CPUX86State *env = &cpu->env; int i; - for (i = 0; i < HV_X64_MSR_CRASH_PARAMS; i++) { + for (i = 0; i < HV_CRASH_PARAMS; i++) { if (env->msr_hv_crash_params[i]) { return true; } @@ -601,8 +601,7 @@ static const VMStateDescription vmstate_msr_hyperv_crash = { .minimum_version_id = 1, .needed = hyperv_crash_enable_needed, .fields = (VMStateField[]) { - VMSTATE_UINT64_ARRAY(env.msr_hv_crash_params, - X86CPU, HV_X64_MSR_CRASH_PARAMS), + VMSTATE_UINT64_ARRAY(env.msr_hv_crash_params, X86CPU, HV_CRASH_PARAMS), VMSTATE_END_OF_LIST() } }; @@ -660,8 +659,7 @@ static const VMStateDescription vmstate_msr_hyperv_synic = { VMSTATE_UINT64(env.msr_hv_synic_control, X86CPU), VMSTATE_UINT64(env.msr_hv_synic_evt_page, X86CPU), VMSTATE_UINT64(env.msr_hv_synic_msg_page, X86CPU), - VMSTATE_UINT64_ARRAY(env.msr_hv_synic_sint, X86CPU, - HV_SYNIC_SINT_COUNT), + VMSTATE_UINT64_ARRAY(env.msr_hv_synic_sint, X86CPU, HV_SINT_COUNT), VMSTATE_END_OF_LIST() } }; @@ -686,10 +684,9 @@ static const VMStateDescription vmstate_msr_hyperv_stimer = { .minimum_version_id = 1, .needed = hyperv_stimer_enable_needed, .fields = (VMStateField[]) { - VMSTATE_UINT64_ARRAY(env.msr_hv_stimer_config, - X86CPU, HV_SYNIC_STIMER_COUNT), - VMSTATE_UINT64_ARRAY(env.msr_hv_stimer_count, - X86CPU, HV_SYNIC_STIMER_COUNT), + VMSTATE_UINT64_ARRAY(env.msr_hv_stimer_config, X86CPU, + HV_STIMER_COUNT), + VMSTATE_UINT64_ARRAY(env.msr_hv_stimer_count, X86CPU, HV_STIMER_COUNT), VMSTATE_END_OF_LIST() } };