From patchwork Mon Sep 23 10:09:24 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 11156549 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 25E8D112B for ; Mon, 23 Sep 2019 10:11:13 +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 EF85220820 for ; Mon, 23 Sep 2019 10:11:12 +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="rfOY0YM/" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org EF85220820 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 1iCLHs-0006oO-Dx; Mon, 23 Sep 2019 10:09:44 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iCLHr-0006oG-9A for xen-devel@lists.xenproject.org; Mon, 23 Sep 2019 10:09:43 +0000 X-Inumbo-ID: 4006c716-ddea-11e9-b299-bc764e2007e4 Received: from mail-wm1-x342.google.com (unknown [2a00:1450:4864:20::342]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 4006c716-ddea-11e9-b299-bc764e2007e4; Mon, 23 Sep 2019 10:09:38 +0000 (UTC) Received: by mail-wm1-x342.google.com with SMTP id 3so8597401wmi.3 for ; Mon, 23 Sep 2019 03:09:38 -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:in-reply-to:references :mime-version:content-transfer-encoding; bh=WfEwbooFHv5S4uohbQtKqFZG0alfSTL0zc81uOqCx5Q=; b=rfOY0YM/GS8B4DZaHL04QXqwE9/Z8EQHCCqC8SIXPOn6TzOvqts5fPPXBjFZeii78B YchAW+yyDMpTIv+oF5XnuIJ0Qn0VPYV37MXY/SyShIQTOJWQEBW3BY7Q81zPnsl2XHiZ kc+8C8sfwN5Ical+rvSFXKCo7+83YA9lHlJvC70Op3lnf2i3uEkcRx2nKM+Hb0C6vETj YCgyTvUCWiqNdXxSSIBKHfqg1DK7GzSHxzIIz+buO4a+4pImvvpsSzmc1yJr/3rTmBKd pA6WC6W1yxNYzjCSKdKvSma1XL8Ud/ygSVssgYxybWZBz0rhTvbbgf7rVWOjvTIxgNCw JDkg== 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 :in-reply-to:references:mime-version:content-transfer-encoding; bh=WfEwbooFHv5S4uohbQtKqFZG0alfSTL0zc81uOqCx5Q=; b=Ha4TfcemyaFHqiQU/DLC2AWRcqDGpL/Wc5pMhuACtK83qS/QrAc7+oqYsYIhpVKFIO /GVYu90L/YznILrt1gil0hLA/3uWfdDv7fx8RMA2oQUG/gcff1ZUHfBaWmaYIIbS7Cmi X0YYhaV4bmivfNRXjg81to8FTFE8T/HBt38epF7gx/c5ZMA+3V2ulKOnmYonZUupI71m 27eUzRzh466Zl9PUQcnGBdiqgkkLRL79+zxhyoj6vrcX9U9BgNN5W/IvvBSWLQ72qe0c zRT4G41zJH13paz3cWW2YyE22gMy+yJXN8uhYHhnKjt1pdSWP6xAZKVj5Em6Chd0oYfs L/sA== X-Gm-Message-State: APjAAAXq/7nBFyXJkmIDb6WuV2EAxUAPMJJ3ZPg4umeL9v4TulBGH5oF k7kD6SyzWNRWAy0wxDgvsAc6X9Ii X-Google-Smtp-Source: APXvYqymy6baXzi0Y9kq559ouYA+w9Oj465awni9IyfMroJ2t1VNktR9c4NPWiaqmCi7JJpFOX3i+w== X-Received: by 2002:a05:600c:118a:: with SMTP id i10mr12986650wmf.80.1569233377350; Mon, 23 Sep 2019 03:09:37 -0700 (PDT) Received: from debian.mshome.net (207.148.159.143.dyn.plus.net. [143.159.148.207]) by smtp.gmail.com with ESMTPSA id s10sm18241662wmf.48.2019.09.23.03.09.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 23 Sep 2019 03:09:36 -0700 (PDT) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Mon, 23 Sep 2019 11:09:24 +0100 Message-Id: <20190923100931.29670-2-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190923100931.29670-1-liuwe@microsoft.com> References: <20190923100931.29670-1-liuwe@microsoft.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH for-next RFC 1/8] x86: introduce CONFIG_GUEST and move code 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" Xen is able to run as a guest on Xen. We plan to make it able to run on Hyper-V as well. Introduce CONFIG_GUEST which is set to true if either running on Xen or Hyper-V is desired. Restructure code hierarchy for new code to come. No functional change intended. Signed-off-by: Wei Liu Reviewed-by: Roger Pau Monné --- xen/arch/x86/Kconfig | 4 ++++ xen/arch/x86/Makefile | 2 +- xen/arch/x86/guest/Makefile | 5 +---- xen/arch/x86/guest/xen/Makefile | 4 ++++ xen/arch/x86/guest/{ => xen}/hypercall_page.S | 0 xen/arch/x86/guest/{ => xen}/pvh-boot.c | 0 xen/arch/x86/guest/{ => xen}/xen.c | 0 7 files changed, 10 insertions(+), 5 deletions(-) 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 (100%) rename xen/arch/x86/guest/{ => xen}/xen.c (100%) diff --git a/xen/arch/x86/Kconfig b/xen/arch/x86/Kconfig index 288dc6c042..584bdc1bb8 100644 --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -160,8 +160,12 @@ config XEN_ALIGN_2M endchoice +config GUEST + bool + config XEN_GUEST def_bool n + select GUEST prompt "Xen Guest" ---help--- Support for Xen detecting when it is running under Xen. diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile index 2443fd2cc5..99a12d0090 100644 --- a/xen/arch/x86/Makefile +++ b/xen/arch/x86/Makefile @@ -1,7 +1,7 @@ subdir-y += acpi subdir-y += cpu subdir-y += genapic -subdir-$(CONFIG_XEN_GUEST) += guest +subdir-$(CONFIG_GUEST) += guest subdir-$(CONFIG_HVM) += hvm subdir-y += mm subdir-$(CONFIG_XENOPROF) += oprofile diff --git a/xen/arch/x86/guest/Makefile b/xen/arch/x86/guest/Makefile index 26fb4b1007..6806f04947 100644 --- a/xen/arch/x86/guest/Makefile +++ b/xen/arch/x86/guest/Makefile @@ -1,4 +1 @@ -obj-y += hypercall_page.o -obj-y += xen.o - -obj-bin-$(CONFIG_PVH_GUEST) += pvh-boot.init.o +subdir-$(CONFIG_XEN_GUEST) += xen diff --git a/xen/arch/x86/guest/xen/Makefile b/xen/arch/x86/guest/xen/Makefile new file mode 100644 index 0000000000..26fb4b1007 --- /dev/null +++ b/xen/arch/x86/guest/xen/Makefile @@ -0,0 +1,4 @@ +obj-y += hypercall_page.o +obj-y += xen.o + +obj-bin-$(CONFIG_PVH_GUEST) += pvh-boot.init.o diff --git a/xen/arch/x86/guest/hypercall_page.S b/xen/arch/x86/guest/xen/hypercall_page.S similarity index 100% rename from xen/arch/x86/guest/hypercall_page.S rename to xen/arch/x86/guest/xen/hypercall_page.S diff --git a/xen/arch/x86/guest/pvh-boot.c b/xen/arch/x86/guest/xen/pvh-boot.c similarity index 100% rename from xen/arch/x86/guest/pvh-boot.c rename to xen/arch/x86/guest/xen/pvh-boot.c diff --git a/xen/arch/x86/guest/xen.c b/xen/arch/x86/guest/xen/xen.c similarity index 100% rename from xen/arch/x86/guest/xen.c rename to xen/arch/x86/guest/xen/xen.c