From patchwork Mon Jan 22 21:07:47 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Denis V. Lunev\" via" X-Patchwork-Id: 10179339 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 835A260224 for ; Mon, 22 Jan 2018 21:12:10 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 739A02833E for ; Mon, 22 Jan 2018 21:12:10 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 66FAA2842E; Mon, 22 Jan 2018 21:12:10 +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 CEC0E2833E for ; Mon, 22 Jan 2018 21:12:09 +0000 (UTC) Received: from localhost ([::1]:38312 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edjNw-0007We-U9 for patchwork-qemu-devel@patchwork.kernel.org; Mon, 22 Jan 2018 16:12:08 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40788) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1edjK5-0004YE-0j for qemu-devel@nongnu.org; Mon, 22 Jan 2018 16:08:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1edjK1-00022T-LZ for qemu-devel@nongnu.org; Mon, 22 Jan 2018 16:08:08 -0500 Received: from mail-bn3nam01on0096.outbound.protection.outlook.com ([104.47.33.96]:36736 helo=NAM01-BN3-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 1edjK1-00022I-FX for qemu-devel@nongnu.org; Mon, 22 Jan 2018 16:08:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=AMEEztqBQ2QyFK1AXZbMP7gZqshdonZOfWjOdGaUh9U=; b=MUtVR+QA8/+LY8VPE7p1qZUnqJBvHW37YtQTjV7iXM/39w5FzZrjoy5Fe8ZTAzrLrFLbBr9jwWYKltBz1dTpWGCClYYFwesBZsyNtFrg8rCKrXMi8SIH88QrXAhOjkZz0ohahDIuhrB7Y8Wq0W6rrXz+fQ22W8Frb8O2U3jgQ4k= Received: from JUTERRY-DEV2.corp.microsoft.com (2001:4898:80e8:3::64) by SN4PR2101MB0878.namprd21.prod.outlook.com (2603:10b6:803:51::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.464.0; Mon, 22 Jan 2018 21:08:02 +0000 To: qemu-devel@nongnu.org Date: Mon, 22 Jan 2018 13:07:47 -0800 Message-Id: <1516655269-1785-3-git-send-email-juterry@microsoft.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1516655269-1785-1-git-send-email-juterry@microsoft.com> References: <1516655269-1785-1-git-send-email-juterry@microsoft.com> MIME-Version: 1.0 X-Originating-IP: [2001:4898:80e8:3::64] X-ClientProxiedBy: DM5PR21CA0002.namprd21.prod.outlook.com (2603:10b6:3:ac::12) To SN4PR2101MB0878.namprd21.prod.outlook.com (2603:10b6:803:51::31) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 48645dac-d05b-4288-79aa-08d561dc39de X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4604075)(48565401081)(4534125)(4602075)(4627221)(201703031133081)(201702281549075)(2017052603307)(7193020); SRVR:SN4PR2101MB0878; X-Microsoft-Exchange-Diagnostics: 1; SN4PR2101MB0878; 3:tNNlazsdPgV6OlvbHBSOMGWSJMvRW4pf5EginzkjYVqLiTIHnViYnDmoIaqvnxDQfh8Eq2X/mXMLZ0DAFuCJO1A/PPFH0LukWSjgtC0BoHOAvFfmepFZvJrMyBQr1gZX6jMRs17ieOoXkJtohmuxAR9UcpZKMm7HNCTmWwvCUJaRCPA7V3sT2LF1wUSoWKMbqGD8X0p/e6UbDKN1oIxu/0eZ9Ptknn12CbpdSJhHzJ1k+K+iExStWV90XLuV2pgp; 25:JN53AoZOBNqFXiKkhbO0TKxO/7hsawJNywuiZs/70IkPs4qNfQiz5xSmoJ6AirxWRws6N5jmWMaDAdGtW+UNH+aSxhOs161yGjCyfitB3RZ0+PU5JmVDm5GzZ/sbto1gz9ns77s8vZhH456Hz7y74S+7PRT/XQtP6KFmwakCv7sQSg7lnz+wLwR8heGdD973/z6qMdYAEjMI+T2yNeqnmczLqC1yZn8Ez4FfC8RudJC+bmrYL3p4APq4dh00KELWJ8F/M+Fg000qTTVh4u59XeEFEO4U/08zE7a5kddtVzMdPUWXf9QrRSBImVbkfmLFIMZ76W/zlr23iA57wkuhHA==; 31:P/IE8/S07+AmSGWpfrGjarDVoqsk8nP5iqX/Crs/cEM4INTIKQ65fozXvwjy7L3Qc6cY6l4bU7J/w57xdJhq3Pd5r+bvK+M6IENVnQ4k1MAyoHApKoEz4PLbKbDJ4Nc6vaP3efh2LY8aq6duN59YNQa6HTd113O+buL+n2FiIE6MpZS6Awx1i8fBOTdiB5Fc0hOPgQfdC2gITmpdI6XGo6jywfMz4e193HWHw+SojGs= X-MS-TrafficTypeDiagnostic: SN4PR2101MB0878: X-Microsoft-Exchange-Diagnostics: 1; SN4PR2101MB0878; 20:wksexolqyKpxht78X8GuoQDmnJfRpfr9Nx8rLORordVDQuaEe5te+uiHXtuxqqIna/eNXckDlTIWj0pC6ItzQN1SO61woGddUtOdvHHaEUP4qm/R+QY7ARsqAjIkUsgSg5jJ9hi0+vFtTvuCfVnnzUblSZAd8HOBwC4kv4pA9TK07W2d4xZlXSGzYqsBrMGW6LElJ0JQQUPSABz7hhbi0cY4POnFOuv+e4uULshdxMqt7Zmp+F+xgO1q8DBlSICqIQG5fYVRVt9a/iRH2ja8lsQ+ERtPHvnH19TxjX6Q6Wa4NP7obqns6zWFpTAhTG5DYmo8ALl/kMOyhukVyvg5cKY0+12cDwslR63qzEGEqx6lRjWFkwkvuUz6lNmUGwVbSepD0QXmCbUvwujDnckMO60O1/D/+wX7e+W7BCZ6F5Ij+2VuXWKPogFxBmjXR7+9Xne8dcXuTeMpfGfq9AKOXGpEPxggrKI/9jlZzyhOJ4qcX0BuZwMGoLnzMLAq8q0S; 4:hyFw8BPrfb+ZJHk6AzSK93F/oeo2SSUhhzk6csdxrJ+KiaEI0NbBZz7JjGTrcYCkI6ALfr0cI7DB1l6gwi8Pc0xvCqEhQHsOw3zVJ0vPSzPB9nvpszquNg+OQsz4PAmKoOk1LKeig1BQK3ZhHcsSMLB1+jNdYkzRWhcyW2Ig9rEkFGyPiwWPO6ysUzHmfG1f+g6Yng/8B8glud4LJFP62hJ8oR4AwXQExbOH8eyxNaGR8Ks77kM9Yt3I9cJc8EOot7/iud81SKdqqslAV1YKrGqRI7MpOuNIKUvPBOqK2xzAfqcT8VTz1ZhtYpfb6LtfKaMH+WauhOn9qB1o7ISx28cZ85MKJ/QZ0bxToXGd4Og= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(28532068793085)(89211679590171); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(61425038)(6040501)(2401047)(5005006)(8121501046)(10201501046)(93006095)(93001095)(3002001)(3231046)(2400081)(944501161)(6055026)(61426038)(61427038)(6041288)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123558120)(20161123562045)(20161123564045)(20161123560045)(6072148)(201708071742011); SRVR:SN4PR2101MB0878; BCL:0; PCL:0; RULEID:(100000803126)(100110400120); SRVR:SN4PR2101MB0878; X-Forefront-PRVS: 0560A2214D X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(346002)(39860400002)(396003)(366004)(39380400002)(376002)(199004)(189003)(10090500001)(52396003)(76176011)(48376002)(4326008)(7696005)(51416003)(52116002)(50466002)(39060400002)(107886003)(10290500003)(47776003)(305945005)(7736002)(6666003)(2351001)(6116002)(36756003)(2361001)(2950100002)(8676002)(6916009)(81156014)(386003)(81166006)(5660300001)(25786009)(8936002)(105586002)(478600001)(68736007)(50226002)(2906002)(86362001)(22452003)(106356001)(86612001)(6486002)(53936002)(97736004)(6346003)(316002)(16586007); DIR:OUT; SFP:1102; SCL:1; SRVR:SN4PR2101MB0878; H:JUTERRY-DEV2.corp.microsoft.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=juterry@microsoft.com; X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN4PR2101MB0878; 23:SJj1kfUQ+nx5CtPn2AFAaH9LSuTx24oYYywlEgb?= =?us-ascii?Q?+octRZ+ZmD8c6fLDbL49XVk91df7Nr4yl5IaYVKcTxEM217JqOl+w3+ZnYHr?= =?us-ascii?Q?9mhzPIIAf2G7J+XdR3mHx+NUoHJDVTUG0WOpBtuIfVQYLLWGn/EaiffKOk3r?= =?us-ascii?Q?owNKt3coHcS4QE8GFTJ3rlWTrx7zeHNFz2fyT/mzYdXHJK4b+XqC9jt5zhks?= =?us-ascii?Q?/Wa7qaG2i2X0hyhSwNcBcVvIfkU1iJVBif1V0Od7MJAQoHzhabIhk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zOD/n3gD7LPPcMB7xQQUv0IIVhKoujfmQJUtwhsYOzlVxYWE1?= =?us-ascii?Q?SNgjnTFXzPYAW8A+XBEGroAQ1Wrh3s8uarrgD?= X-Microsoft-Exchange-Diagnostics: 1; SN4PR2101MB0878; 6:9Y3GcC8HDn/W5LW7T+2RcAXoSoegeJKCHM4f/QDUbQzwsrtBihSroIh2FZZvsR644u9UBe01wm0vi5NnjFZMPQrNwry1dVK8PimynqhwtA5fh8TpfzdWNIihS9A5rMhvqj2Z9oIzF2o1IRiGOEmcm26XSjohdwtIk84fbRNMjr2upvc03JPWc5/j0IqzbIrZNS/gEOdhO62x8KEj7Mf4ago4ho+ceBF6FJwkDPDWHoPKRx+vysvqeLCUht0VVqHH5s5q+7FjZWCPTyWwFetaAWHKLkvWZUQ+ExHYMx2UBkwqxTb3H3cCMkSX5Kp2lT2S7SNfyiV9+CNtJWwtEUvD0yUPKzQv+K+WqM+sbi0l1vY=; 5:CTv86+H8VzofoObQi+//srrBFOVtdDZdsURSYnjTcHEOmJ7z6KucpuoPyZoduk2tr684fOAnrBdyArdcuk++9U/G//CrnKb980PbeQts/muLruzBb9ZL3WVhUUqOWFQVxaYDGiLeFxpmbjNwTbrpfcXodxUU3fY6jlZett+ALhw=; 24:vv5al0mrdV9S+de+jOjzlW6ezBVvve+njcOS8ACjip5a2qlMt4CSXNe8Bh2LkLMXJL3/xP8bQe+o7jT687H4fcvz7mlDU3u4R6fd7HNLx4I=; 7:KXpBEENg7i5VgJV17A8Po19XRNI6KnSPICU3uaifldHyJzZzNPi33HLg/vjTQ22/l5lGdIT8tuSDDyu/l/hv05ouS7swg9xIJT2psfFJon5vAs0XnM09RHNqPhu/rnjig+9TOq+1kfCjB7+lQ1BV0BqgYat68JIcG4de7JXWTFNFMQWkP5ZczYqRjzRkfJcuSLXmbwGe4l01Gxy0zod/elDWlqwrrsy02aVyBg+RhNivKpccusGwIF0pybWqJTFR SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 22 Jan 2018 21:08:02.9230 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 48645dac-d05b-4288-79aa-08d561dc39de X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR2101MB0878 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 104.47.33.96 Subject: [Qemu-devel] [PATCH v2 2/4] Add the WHPX vcpu API 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: , X-Patchwork-Original-From: "Justin Terry \(VM\) via Qemu-devel" From: "Denis V. Lunev\" via" Reply-To: "Justin Terry \(VM\)" Cc: "Justin Terry \(VM\)" , pbonzini@redhat.com, rth@twiddle.net, ehabkost@redhat.com, crosthwaite.peter@gmail.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Adds support for the Windows Hypervisor Platform accelerator (WHPX) stubs and introduces the whpx.h sysemu API for managing the vcpu scheduling and management. Signed-off-by: Justin Terry (VM) --- accel/stubs/Makefile.objs | 9 +++++---- accel/stubs/whpx-stub.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++ include/sysemu/whpx.h | 40 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 93 insertions(+), 4 deletions(-) create mode 100644 accel/stubs/whpx-stub.c create mode 100644 include/sysemu/whpx.h diff --git a/accel/stubs/Makefile.objs b/accel/stubs/Makefile.objs index 779343b..3894caf 100644 --- a/accel/stubs/Makefile.objs +++ b/accel/stubs/Makefile.objs @@ -1,4 +1,5 @@ -obj-$(call lnot,$(CONFIG_HAX)) += hax-stub.o -obj-$(call lnot,$(CONFIG_HVF)) += hvf-stub.o -obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o -obj-$(call lnot,$(CONFIG_TCG)) += tcg-stub.o +obj-$(call lnot,$(CONFIG_HAX)) += hax-stub.o +obj-$(call lnot,$(CONFIG_HVF)) += hvf-stub.o +obj-$(call lnot,$(CONFIG_WHPX)) += whpx-stub.o +obj-$(call lnot,$(CONFIG_KVM)) += kvm-stub.o +obj-$(call lnot,$(CONFIG_TCG)) += tcg-stub.o diff --git a/accel/stubs/whpx-stub.c b/accel/stubs/whpx-stub.c new file mode 100644 index 0000000..5fb049c --- /dev/null +++ b/accel/stubs/whpx-stub.c @@ -0,0 +1,48 @@ +/* + * QEMU Windows Hypervisor Platform accelerator (WHPX) stub + * + * Copyright Microsoft Corp. 2017 + * + * 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-common.h" +#include "cpu.h" +#include "sysemu/whpx.h" + +int whpx_init_vcpu(CPUState *cpu) +{ + return -1; +} + +int whpx_vcpu_exec(CPUState *cpu) +{ + return -1; +} + +void whpx_destroy_vcpu(CPUState *cpu) +{ +} + +void whpx_vcpu_kick(CPUState *cpu) +{ +} + +void whpx_cpu_synchronize_state(CPUState *cpu) +{ +} + +void whpx_cpu_synchronize_post_reset(CPUState *cpu) +{ +} + +void whpx_cpu_synchronize_post_init(CPUState *cpu) +{ +} + +void whpx_cpu_synchronize_pre_loadvm(CPUState *cpu) +{ +} diff --git a/include/sysemu/whpx.h b/include/sysemu/whpx.h new file mode 100644 index 0000000..89592ae --- /dev/null +++ b/include/sysemu/whpx.h @@ -0,0 +1,40 @@ +/* + * QEMU Windows Hypervisor Platform accelerator (WHPX) support + * + * Copyright Microsoft, Corp. 2017 + * + * Authors: + * + * 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 QEMU_WHPX_H +#define QEMU_WHPX_H + +#include "config-host.h" +#include "qemu-common.h" + +int whpx_init_vcpu(CPUState *cpu); +int whpx_vcpu_exec(CPUState *cpu); +void whpx_destroy_vcpu(CPUState *cpu); +void whpx_vcpu_kick(CPUState *cpu); + + +void whpx_cpu_synchronize_state(CPUState *cpu); +void whpx_cpu_synchronize_post_reset(CPUState *cpu); +void whpx_cpu_synchronize_post_init(CPUState *cpu); +void whpx_cpu_synchronize_pre_loadvm(CPUState *cpu); + +#ifdef CONFIG_WHPX + +int whpx_enabled(void); + +#else /* CONFIG_WHPX */ + +#define whpx_enabled() (0) + +#endif /* CONFIG_WHPX */ + +#endif /* QEMU_WHPX_H */