From patchwork Thu Nov 21 18:50:42 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 11256831 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 016BE930 for ; Thu, 21 Nov 2019 18:51:43 +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 D19342067D for ; Thu, 21 Nov 2019 18:51:42 +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="Pvdmzp5f" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D19342067D 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 1iXrXh-00075X-3H; Thu, 21 Nov 2019 18:51:01 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iXrXf-00075H-HH for xen-devel@lists.xenproject.org; Thu, 21 Nov 2019 18:50:59 +0000 X-Inumbo-ID: d8aa9da2-0c8f-11ea-b678-bc764e2007e4 Received: from mail-wm1-x343.google.com (unknown [2a00:1450:4864:20::343]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id d8aa9da2-0c8f-11ea-b678-bc764e2007e4; Thu, 21 Nov 2019 18:50:54 +0000 (UTC) Received: by mail-wm1-x343.google.com with SMTP id x26so4632768wmk.4 for ; Thu, 21 Nov 2019 10:50:54 -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=TWXlLe8IMt8Vs7gsl166Q3OWJ9VnuTA9ivSeF58Db7o=; b=Pvdmzp5f8fRFrvPbU0D9OD+MEjNkTmryCmBaKT+A1mWiEy6zYgiGbrgkfvu6+ib6do 8h1yaSsRgTTCtHgpfmECB4FZJYeGOS7cwASHx2EMoAqvgglYewMbv2dlfmubiPykwT5i FDHirMkogVDsUvy81GZDhyYS9eAUEccq5apRDYvLWMCG/vYQWsVkDm5WOBGaU1anjGVQ vAPgTH4Rsz52BlkyPEzYH9YeXPK/fqfW95vNrtz7l4h/QLguNYnc4C3MyOy7c5gMOsOV /T3v/2ju6wOmv3nj4ViGSNp3EWuATKng6Hp44J0g5+3ha7RO0h0mz2MsEoY669ABaLxZ rfGg== 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=TWXlLe8IMt8Vs7gsl166Q3OWJ9VnuTA9ivSeF58Db7o=; b=gluMyTKzzVb64OvVKlNDPKUUdmps1KhojGPfgo5FkneQo9JCx861BOwbdQ4a3sNMZv RknZgRvC2EOSoqNQGt9k/LhNzOWuLno7Ym1hBOjjCsCYE9j6htteCsxggk2WdpZoZrUz mnpx+bw2lj+NJB9KuIz8UJTvPvFFxdt14Ha7gtfNfew/uALyxBFxPVsKPAeSif72EebF ijjQDf+2rfQcKR5oWpsOxPQh5I8w4LESrZYStUxjOnQyRXc1AUPurez4yYSxsI1pxSCC JkNBR4j708k8eZXndhpu6r1DBfLSD4giyJPU8zhqlXBXlbqohSN905E8hgcsh5GqWt07 G42Q== X-Gm-Message-State: APjAAAXJgvd7EJcBsYkyyAi0mCbSjlwsTKSFeAG3DXnV6yAw9mT0nGoQ iti2dOHxAGcjNN6RjYLpcwIFJcyYJnI3KQ== X-Google-Smtp-Source: APXvYqzcAwIjDfYAE9dxx/6OVltsNTt4lT61svhWwLga+wa9Q0feppnp4da7WQE245eMH0hXromtEA== X-Received: by 2002:a05:600c:cf:: with SMTP id u15mr11982474wmm.60.1574362253803; Thu, 21 Nov 2019 10:50:53 -0800 (PST) Received: from debian.mshome.net (74.162.147.147.dyn.plus.net. [147.147.162.74]) by smtp.gmail.com with ESMTPSA id f24sm535776wmb.37.2019.11.21.10.50.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 21 Nov 2019 10:50:53 -0800 (PST) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Thu, 21 Nov 2019 18:50:42 +0000 Message-Id: <20191121185049.16666-2-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191121185049.16666-1-liuwe@microsoft.com> References: <20191121185049.16666-1-liuwe@microsoft.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH v4 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 | 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 28b3b4692a..867de857e8 100644 --- a/xen/arch/x86/Kconfig +++ b/xen/arch/x86/Kconfig @@ -161,8 +161,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 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