From patchwork Mon Oct 21 15:57:09 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 11202575 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9B2831895 for ; Mon, 21 Oct 2019 15:58:51 +0000 (UTC) Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 769C32084B for ; Mon, 21 Oct 2019 15:58:51 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="TmjhXTJg" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 769C32084B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=xen.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iMa3h-00088Y-Ft; Mon, 21 Oct 2019 15:57:25 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iMa3f-00088L-RY for xen-devel@lists.xenproject.org; Mon, 21 Oct 2019 15:57:23 +0000 X-Inumbo-ID: 7806aacc-f41b-11e9-beca-bc764e2007e4 Received: from mail-wm1-x343.google.com (unknown [2a00:1450:4864:20::343]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 7806aacc-f41b-11e9-beca-bc764e2007e4; Mon, 21 Oct 2019 15:57:23 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id i16so13935394wmd.3 for ; Mon, 21 Oct 2019 08:57:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=5dFi2sc6pkRJiFAdc0gvsBLh0tTb5eWnrhywydp8l68=; b=TmjhXTJgquu8WC4Cdw+hAI7eXTAieje7loUzjlBCO/lATCasuhwn5g2T3ZbEfQ+Hr2 JwjG+ZEBeoy6IELNTQTbT7qn5n4/8rWi9SHLyr8JZMFnbBbGb3QTKYgs5KYUmdw/AtFy 9JULg46iyT0My3Bfagg9DYfajgq/cTvevbZdFOqZEGNNdTBhqbT4OQ5NBA9z3qLGo4cZ gOgZ4hovEROPHKXKOhqG3OwUhzZmlKLnPUdgsKepHnzz/e972nsnv8jBWSeKdDjZJ4ug HxM1Oi0VxL4alwwBmLk0J8UEahAU4cWlP0zhcVexN887dgTa0hj+xMPyIS+4d/RuZ9lp onJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version:content-transfer-encoding; bh=5dFi2sc6pkRJiFAdc0gvsBLh0tTb5eWnrhywydp8l68=; b=r0DlIdW+CV/wEUyl/MXXwUqt2bg4sY8mg8W9SHYNxMhcl81wW+qpMbNbGY94/izYBH PBkbH+MmQ6JOSAZfh8x8uFdju9s8cZ4P+G1dsS0VpozNdKdi4zeG6Z+C88R+tv9c6J6G u8Soet8bDdwWsDgW9eE8tSf9+VjAfsAZr7usiMPZb40tm7wnIlGrLpDwM6m3Zs3Wu+hu rBwWrsgIFrtBmGhvvXj8NFwPpjOsVLiYO6tSW2Wue+pxHQnZblPSSasczgQinWOJrCiA ZRqmaNas1Be4qO/RpDR4ez69H5CSI7yPat8yOaBYC+7fdHtVPGnbIuKNAEcKPnCq0Rtw 1T5w== X-Gm-Message-State: APjAAAXuZ7brplxgE74dKWt73aDQPsOV1vS5GNHfIOxPL0yhMm3MTCeA wkx4AkKeYnQQYN8uz8IdB5I3gr3lE20= X-Google-Smtp-Source: APXvYqwz3ne2ZhTabQE+x+QrrgV6DWDhgks072RrjdEA/rTeMh6kviUZQFgjIPRa71XcRQljrASJKg== X-Received: by 2002:a05:600c:22d7:: with SMTP id 23mr19441474wmg.31.1571673442171; Mon, 21 Oct 2019 08:57:22 -0700 (PDT) Received: from debian.mshome.net (54.163.200.146.dyn.plus.net. [146.200.163.54]) by smtp.gmail.com with ESMTPSA id x12sm5667410wru.93.2019.10.21.08.57.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2019 08:57:21 -0700 (PDT) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Mon, 21 Oct 2019 16:57:09 +0100 Message-Id: <20191021155718.28653-1-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH for-next v3 0/9] Port Xen to Hyper-V X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Wei Liu , Wei Liu , Andrew Cooper , Michael Kelley , Jan Beulich , =?utf-8?q?Roger_Pau_Monn=C3=A9?= Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" Hi all This is version 3 of the patch series. This is the very first stage for porting Xen to run on Hyper-V with all the goodies Hyper-V has to offer. With this series, Xen can successfully detect Hyper-V and prints out a message. I would like to first get the code structure and kconfig options agreed upon. There are two major areas to be worked on: * Make Dom0 able to use Hyper-V's synthetic devices. * Make Xen use of the synthetic timer, reference TSC and enlightenment VMCS and other interfaces. They aren't trivial, and time can be scarce on my side, so I intend to post patches piecemeal when they are ready. Questions and comments are welcome. Thanks, Wei. --- Changes in v3: See invididual patches Changes in v2: 1. Introduce and use a hypervisor framework 2. Keep memmap infra under Xen for now Cc: Jan Beulich Cc: Andrew Cooper Cc: Wei Liu Cc: Roger Pau Monné Wei Liu (9): x86: introduce CONFIG_GUEST and move code x86: include asm_defns.h directly in hypercall.h x86: drop hypervisor_cpuid_base x86: include xen/lib.h in guest/hypercall.h x86: introduce hypervisor framework x86: rename hypervisor_{alloc,free}_unused_page x86: switch xen implementation to use hypervisor framework x86: be more verbose when running on a hypervisor x86: introduce CONFIG_HYPERV and detection code xen/arch/x86/Kconfig | 13 +++ xen/arch/x86/Makefile | 2 +- xen/arch/x86/guest/Makefile | 6 +- xen/arch/x86/guest/hyperv/Makefile | 1 + xen/arch/x86/guest/hyperv/hyperv.c | 54 +++++++++++ xen/arch/x86/guest/hypervisor.c | 89 +++++++++++++++++++ xen/arch/x86/guest/xen/Makefile | 4 + xen/arch/x86/guest/{ => xen}/hypercall_page.S | 0 xen/arch/x86/guest/{ => xen}/pvh-boot.c | 2 +- xen/arch/x86/guest/{ => xen}/xen.c | 39 ++++---- xen/arch/x86/pv/shim.c | 6 +- xen/arch/x86/setup.c | 6 +- xen/include/asm-x86/guest.h | 2 + xen/include/asm-x86/guest/hypercall.h | 4 + xen/include/asm-x86/guest/hyperv.h | 45 ++++++++++ xen/include/asm-x86/guest/hypervisor.h | 64 +++++++++++++ xen/include/asm-x86/guest/xen.h | 24 ++--- 17 files changed, 314 insertions(+), 47 deletions(-) create mode 100644 xen/arch/x86/guest/hyperv/Makefile create mode 100644 xen/arch/x86/guest/hyperv/hyperv.c create mode 100644 xen/arch/x86/guest/hypervisor.c create mode 100644 xen/arch/x86/guest/xen/Makefile rename xen/arch/x86/guest/{ => xen}/hypercall_page.S (100%) rename xen/arch/x86/guest/{ => xen}/pvh-boot.c (99%) rename xen/arch/x86/guest/{ => xen}/xen.c (93%) create mode 100644 xen/include/asm-x86/guest/hyperv.h create mode 100644 xen/include/asm-x86/guest/hypervisor.h