From patchwork Mon Oct 21 15:57:10 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Wei Liu X-Patchwork-Id: 11202571 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 06DC313BD for ; Mon, 21 Oct 2019 15:58:50 +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 D6E942084B for ; Mon, 21 Oct 2019 15:58:49 +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="VruVKoyo" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org D6E942084B 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 1iMa3l-00089G-Pw; Mon, 21 Oct 2019 15:57:29 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iMa3k-000897-RI for xen-devel@lists.xenproject.org; Mon, 21 Oct 2019 15:57:28 +0000 X-Inumbo-ID: 78843960-f41b-11e9-beca-bc764e2007e4 Received: from mail-wr1-x441.google.com (unknown [2a00:1450:4864:20::441]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 78843960-f41b-11e9-beca-bc764e2007e4; Mon, 21 Oct 2019 15:57:23 +0000 (UTC) Received: by mail-wr1-x441.google.com with SMTP id p4so14608084wrm.8 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:in-reply-to:references :mime-version:content-transfer-encoding; bh=2IQZ0I9t3yp3C2z2Yat7e79RK0J/6Y0pVIEi33A2QSI=; b=VruVKoyoi46WAAHCyYpv0dGzGVF1ZckzzUzsj95IsyeRj1/XGMx307+lSI+hc/7CAU 2CikH0B8lc4LImyaGBxZOdMX/fVfaQQ7VHhrEisWdl1M9AhiCISV1atFai6pVaekYFA2 FGXSTKUVKfwMivjWeD+rbtSaDCm2uj4pSWppIH1ak5dbgORbwAKMFJH3yFSrbcFtDs60 zaliS1LEq4d0BiYhu/txo+b3EeP3ewK6JiB4PJnfaUPO/Le+gsihMUFTozn5dBY67m79 bAFgUWnM3uPZH3V42u4lV/0welJ3E5bwMrfl0Fq7aolaHbOstJGseorIEjT9fKiW21Fb Y5Zg== 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=2IQZ0I9t3yp3C2z2Yat7e79RK0J/6Y0pVIEi33A2QSI=; b=Bzqk7IFqqVIE5vDvgF6tdnzdMY8wer8wEh09crvqgkYF0u9C0zFhxX7ocEKSjnPACx 3y1mMlYnVUDL7kQcELc9khnVfo86YuisXgaiKdMDeadekalKMqfvOxKC1bYjpgXfi2// QhCyK8QvF8/efWqAshxE3WKRzvmBTXqrvlCFW2fWHr8x0UCK2dSJQl+q2AcFYbbai4WL ZuZ8GugJPAkypp5Q4y7bH6zIY/GbsVbkz6WLveFmg31LZQcFXYqq3D3b3b68HrZOwR6g FndcIZvhXOIz0akqoV8oBXgpJMTXvpQt6a+Dl7TYVZRlA1u/8k20aUM5jmnXjm+lnuPy Gp2A== X-Gm-Message-State: APjAAAWUu9G6Q94bI5YuBYz5HxYkAACtWLLaNr0P3UF2bFv0uvet8g7a 1mDUix3YcTWQJa1NW52LVPmtx18K7p8= X-Google-Smtp-Source: APXvYqz/QpnhkeeMScCEg9ZNdUkKmo902bBYBew0ECK1PuASsgxTU2ay2Q+X5j/q5P7jRm1MdJlThg== X-Received: by 2002:adf:f44e:: with SMTP id f14mr10351123wrp.56.1571673442946; 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.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Oct 2019 08:57:22 -0700 (PDT) From: Wei Liu X-Google-Original-From: Wei Liu To: Xen Development List Date: Mon, 21 Oct 2019 16:57:10 +0100 Message-Id: <20191021155718.28653-2-liuwe@microsoft.com> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20191021155718.28653-1-liuwe@microsoft.com> References: <20191021155718.28653-1-liuwe@microsoft.com> MIME-Version: 1.0 Subject: [Xen-devel] [PATCH for-next v3 1/9] 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 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