From patchwork Sat Nov 30 11:57:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 11267935 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 6EEC5112B for ; Sat, 30 Nov 2019 11:58:45 +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 4B2DB2075A for ; Sat, 30 Nov 2019 11:58:45 +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="tM84jsze" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 4B2DB2075A 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 1ib1Nk-0004j5-Br; Sat, 30 Nov 2019 11:57:48 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1ib1Nj-0004j0-J8 for xen-devel@lists.xenproject.org; Sat, 30 Nov 2019 11:57:47 +0000 X-Inumbo-ID: 9d6a9eec-1368-11ea-9db0-bc764e2007e4 Received: from mail-wr1-x444.google.com (unknown [2a00:1450:4864:20::444]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 9d6a9eec-1368-11ea-9db0-bc764e2007e4; Sat, 30 Nov 2019 11:57:43 +0000 (UTC) Received: by mail-wr1-x444.google.com with SMTP id b18so38143851wrj.8 for ; Sat, 30 Nov 2019 03:57:43 -0800 (PST) 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=1f/6ovzsUnbptzU+DDt1DpPbxK4REdzWx0FX+36JZiI=; b=tM84jszeXAgJmuS9cI4RAHa5XBSm7iwI4IQHzGxWwdobKzRy92wohrHXZFSOdT3UQ4 /XMfQVgC5AGnaTfwqQ8EEQEriah4KA/Z7VQTs1Ef8wxPNDqLNCLCnovqoGtCkobTALr3 fAuC02pLIvPHSzdfvZ7aQEmIRicLO3whK6h/0VMjCevQF935Ve2FoJDEm2jSOILO4pFh YfpZTWGgn6XvHjgz+0ECh7wa7dzpMh1inkSEQdHH3PCNJmSbGnCGLeXBg9xRGG5i3XW5 3KK4tetmsEwYj0nQBvw5oQjbf1pkX2aQxjN3Aiu5z5f+SDv7mbfi5g4xiVQfaQsLu0fb bs2g== 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=1f/6ovzsUnbptzU+DDt1DpPbxK4REdzWx0FX+36JZiI=; b=f1QYHdnnV3NjIGLuWHNBS+qA2sy/CDQKhyJdR5wXllGS83DYDTWsoEVSg6agZJae9G bmYHIaWRgSm/BSE5u++Kn2U12vStFCZrY4UIk2uclGmaXe0PTaRubML58fNVbj6/fhI5 zI3fEIuWdvcQ0l27TPbP1wayBBSPqBJ9mFDxn1cd6SUUh16mnovjTzqrFaoGMSmtJ8dM rOPgTbYszKxdIaH5A+CSbdIpY3UV/lZWO3enC9Q0uKJQkXbh3WDM7JV7Vhn15FZS8mWm nCDyVDlZoUaWyqjGrmg5vw3GwJaw71IMVonm52H6xbTwkSW5GVzQl0GyNjxT1Pkdzdz3 GFdQ== X-Gm-Message-State: APjAAAW5utVLxhMjyRTX3X7quP6QK/Rk0CFSfXC7k4/xA9GYhdPmtp7c mXk5o3ztdP5gnpCgUY4xW/uQljIuEb0= X-Google-Smtp-Source: APXvYqyyIeSFipY2L5zCrvjVyGV22e0fJLzKmD2ox0/iof9L1BYxpz68ozcPJ+7h0tr26Y1G/ABuhw== X-Received: by 2002:a05:6000:1286:: with SMTP id f6mr5211146wrx.44.1575115062180; Sat, 30 Nov 2019 03:57:42 -0800 (PST) Received: from debian.mshome.net (122.163.200.146.dyn.plus.net. [146.200.163.122]) by smtp.gmail.com with ESMTPSA id z11sm2227769wrt.82.2019.11.30.03.57.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 30 Nov 2019 03:57:41 -0800 (PST) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Sat, 30 Nov 2019 11:57:30 +0000 Message-Id: <20191130115737.15752-2-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191130115737.15752-1-liuwe@microsoft.com> References: <20191130115737.15752-1-liuwe@microsoft.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v5 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é Acked-by: Jan Beulich --- xen/arch/x86/Kconfig | 7 +++++-- 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, 11 insertions(+), 7 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 28b3b4692a..18c8f6fd26 100644 --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -161,9 +161,12 @@ config XEN_ALIGN_2M endchoice +config GUEST + bool + config XEN_GUEST - def_bool n - prompt "Xen Guest" + bool "Xen Guest" + select 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 a0b2f4ab15..7da5a2631e 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