From patchwork Fri Jan 12 20:22:26 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhijian Li (Fujitsu)\" via" X-Patchwork-Id: 10161735 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 A1941602A7 for ; Fri, 12 Jan 2018 21:28:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 92A5728A93 for ; Fri, 12 Jan 2018 21:28:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8776828ABA; Fri, 12 Jan 2018 21:28:40 +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 10CAB28A93 for ; Fri, 12 Jan 2018 21:28:40 +0000 (UTC) Received: from localhost ([::1]:40135 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea6sR-0002UR-BL for patchwork-qemu-devel@patchwork.kernel.org; Fri, 12 Jan 2018 16:28:39 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50314) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ea5qx-00034f-OA for qemu-devel@nongnu.org; Fri, 12 Jan 2018 15:23:04 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ea5qw-0001l7-Nu for qemu-devel@nongnu.org; Fri, 12 Jan 2018 15:23:03 -0500 Received: from mail-dm3nam03on0710.outbound.protection.outlook.com ([2a01:111:f400:fe49::710]:61152 helo=NAM03-DM3-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 1ea5qw-0001jf-Hs for qemu-devel@nongnu.org; Fri, 12 Jan 2018 15:23:02 -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=9ZmtZoEwLyM77WocpU/1fynAjpQSpeGyVGIGXSiDAOc=; b=KdbFBS+b98r5skX9lKCby6AkN8l6RzV+QO9TQYLGhnD76deMzgXQPKzLpO03eruqdOViqALlqKVL1AWnfZxzQjkjIzzbHZ5KnfNr1UwZEjzNwy5rc2/rqqOZoJPJunfgtE6xiPNXmodyQGjkE41Bdg51bDl33wMlN4zLdmPWhME= Received: from JUTERRY-DEV2.corp.microsoft.com (2001:4898:80e8:f::4b) by SN4PR2101MB0879.namprd21.prod.outlook.com (2603:10b6:803:51::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.428.4; Fri, 12 Jan 2018 20:22:59 +0000 To: qemu-devel@nongnu.org Date: Fri, 12 Jan 2018 12:22:26 -0800 Message-Id: <1515788548-3570-3-git-send-email-juterry@microsoft.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1515788548-3570-1-git-send-email-juterry@microsoft.com> References: <1515788548-3570-1-git-send-email-juterry@microsoft.com> MIME-Version: 1.0 X-Originating-IP: [2001:4898:80e8:f::4b] X-ClientProxiedBy: DM5PR1401CA0003.namprd14.prod.outlook.com (2603:10b6:4:4a::13) To SN4PR2101MB0879.namprd21.prod.outlook.com (2603:10b6:803:51::32) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 946887e2-0b69-4338-bc25-08d559fa4671 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020086)(4652020)(5600026)(4604075)(4534117)(4602075)(4627213)(201703031133081)(201702281549075)(48565401081)(2017052603307)(7193020); SRVR:SN4PR2101MB0879; X-Microsoft-Exchange-Diagnostics: 1; SN4PR2101MB0879; 3:+rnRgEa/tqVW+RysChyXr9vR0Fq/rlvCIs/fF++gr0zrSjd/R18l1p4G+Nb8SELCeujK19udZGV6tDazUFf0sK/NIyWacqH/ClYu3LR9/bUHfE9qxxCOFjekKd5YDSZ2qLKUTY2jXhC/aftc2CRa3DTQ307hemgvcG5AuZw1W7CTD/x5Ob7xqh9QhEujttxQ/vp/IjBEoGHuQ1MB8kKoznOOHReWyeZvbEhA4GhoG0nlRIQs2TnIo93iTGFY0Pwv; 25:UWOvhNnJaLcyfoxNdHk6WhW/WEotnp9ROAY2eTISNAc5D0DTuv93mJPmOKCMK6gWfhUbRnL4DHcLlpQtENugqKY86SJkWOTLGwb5dZVZNZKJyNXcPfrLoi8d7jMFv9ambJO4+mUywnFPOZGkeMo7mvYFm6QXWak5y6UY/EwvGocU/QR47SNzP8pV6wVLYmbQU/G0L/6bdD6v7trtYjvTqXNWNUp58Hhk/qpTdUkzwpFOQ3VjvRLuYtkdjVbt6kRl9pheyVlpspQQmQ4YtrBy3ScS0CarbO5muZHDyA6aYlrVDGDMp6J+h2LYGtiNPllt9e0xsYXjAlckA1JVp0Gagg==; 31:+SirRCZgvdYIHU5GxFm614oAFX+1Reio7kuB04bO76ZvWJHoyNdzXyDYEuqJkkWNCSEfZojYLdBK47pCTxGBNDiy1X6WcUhanN9pHMhotYqsmavPI0NRkiqUZLEkdW0a4BhI6GBQGvSXLE7wQWDNzcp2LtWssBGxJ8FMweoIRQ7FXPyJN9hQNUanumyc9wArS60pLtBpC6RKA5L7JC7aRgu5TKk7QO4U7i+z6HO6ToM= X-MS-TrafficTypeDiagnostic: SN4PR2101MB0879: Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=juterry@microsoft.com; X-Microsoft-Exchange-Diagnostics: 1; SN4PR2101MB0879; 20:BOBEEdyiuNBvPQrmwXl6k1xQlSnWDA4HKcB7E+Yjlh+y8zgCu7tSKz+is2uoDqeP2WWqQXziwIqNkonrf2YbPP6oM8ETtuIrlbAlzK+4Z68frT1wC6lB7VTBywRN3odbOPvqUz5kuq1whnG+aPYCnLjAAAeg0nyraC01MNURBrEJl0G5YvjqFUUQ2IMHh3P27Yf/okFceA7kFOjfcz5YP2Kk4fSdeDdzkPwGr+3RlzuwJUbc6zIr1paJiKUlJWj+EzOtveZ4810UXjbUMy1HM2M73fEnycJzlYKzKUU1DMr12wovuixEej4hIEXlOGjCeZrB9VodY/S1shZUdMSPX/VKRCAeR/z1oYoFbNGAruSGcS/XOdIKPA5Ur0qvjKuSrAo2OhsyxN8TI0WCN1noGkPUFzZUnf8LhbAe4yci38v2F4D7VJXSM2Xn2zaUkwM6lGNdXjoThn0hAlqgJG56oqov2HMEG87/oDiMkX1hSx1VcqPTC4sqxp2ITwdkQoi/; 4:O5UiUhQ2jOdxutNjoXFnrFMtAzSPTGaVQAYzl6EyNzfT3zPMSpfO0+XF3YYKhw7Vgnh1OAoQDvxHx8pHMQRef+G6+xRACCL1rbkwvfXK7Do+fWFIbL/L7VnFKIE+rnGFNoCap2xBfWxJ6XJ+7axcGCyEN7SpGefrKnkEWlPjmDjuy6BJ4cUHlZlOKKsTlMbJcP2R8VjxXx4KwO8GsK69U0JaVD2cz5Odxh+vKBWK8c5zxpBLiIKC3dUonLeQhh73Z7LwwLTt21DABK3UlL3MH3YX9S8hoHbTGztMw5oKAqFwzV88N3dJpCv5kepcIAW3sFEeQl75VPheYWeonqrGs35JODdxQ6tZVvxeIssokH4= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(28532068793085)(89211679590171); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(61425038)(6040470)(2401047)(5005006)(8121501046)(3002001)(93006095)(93001095)(10201501046)(3231023)(944501147)(6055026)(61426038)(61427038)(6041268)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(6072148)(201708071742011); SRVR:SN4PR2101MB0879; BCL:0; PCL:0; RULEID:(100000803126)(100110400120); SRVR:SN4PR2101MB0879; X-Forefront-PRVS: 0550778858 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(396003)(39380400002)(39860400002)(366004)(346002)(376002)(199004)(189003)(39060400002)(106356001)(6116002)(316002)(105586002)(22452003)(2351001)(97736004)(25786009)(16586007)(86362001)(5660300001)(53936002)(6916009)(2361001)(6486002)(2950100002)(6666003)(86612001)(51416003)(7696005)(52116002)(52396003)(10290500003)(50466002)(478600001)(305945005)(10090500001)(48376002)(47776003)(386003)(68736007)(81166006)(8676002)(107886003)(81156014)(2906002)(4326008)(8936002)(50226002)(7736002)(36756003)(76176011); DIR:OUT; SFP:1102; SCL:1; SRVR:SN4PR2101MB0879; 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) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN4PR2101MB0879; 23:A5wbOEn+QsFH/8G1ajcpeyVV6RWrmwTfZw8m1LM?= =?us-ascii?Q?XTxzGMVZ1lZRwznOGD16bsPviH5Fq2d736CJUDHp6GqtbzIM0mE6si8KjvDB?= =?us-ascii?Q?RYQvUBEbl9nnijohJ9iNA+c7rhgrrYw/yJEsNGDeRNb/5TxkGUulRHFzOe1V?= =?us-ascii?Q?B3ibnVuWO9qd99onTe6Trtw9+PWcPqbLuUDDHFpGaH84Gyspg3cIIKQGPrS2?= =?us-ascii?Q?8AnAhxQq2lCNCEKHZibT5Geyb2rpqlxKuHbwf+8cGzMOc+INv582L22jtXis?= =?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nosticMetadata: NSPM X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Jan 2018 20:22:59.6191 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 946887e2-0b69-4338-bc25-08d559fa4671 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 72f988bf-86f1-41af-91ab-2d7cd011db47 X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN4PR2101MB0879 X-detected-operating-system: by eggs.gnu.org: Windows 7 or 8 [fuzzy] X-Received-From: 2a01:111:f400:fe49::710 X-Mailman-Approved-At: Fri, 12 Jan 2018 16:25:15 -0500 Subject: [Qemu-devel] [PATCH 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: "Zhijian Li (Fujitsu)\" 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..c1d2451 --- /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..49e6663 --- /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 */ \ No newline at end of file