diff mbox series

[for-next,v3,1/9] x86: introduce CONFIG_GUEST and move code

Message ID 20191021155718.28653-2-liuwe@microsoft.com (mailing list archive)
State Superseded
Headers show
Series Port Xen to Hyper-V | expand

Commit Message

Wei Liu Oct. 21, 2019, 3:57 p.m. UTC
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 <liuwe@microsoft.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
---
 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%)

Comments

Paul Durrant Oct. 23, 2019, 7:55 a.m. UTC | #1
On Mon, 21 Oct 2019 at 16:59, Wei Liu <wl@xen.org> wrote:
>
> 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 <liuwe@microsoft.com>
> Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
> ---
>  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.

This text needs to be modified. Perhaps just say 'when it is running
in a virtual machine'. That should be future-proof.

  Paul

> 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
> --
> 2.20.1
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xenproject.org
> https://lists.xenproject.org/mailman/listinfo/xen-devel
Wei Liu Oct. 23, 2019, 10:49 a.m. UTC | #2
On Wed, Oct 23, 2019 at 08:55:24AM +0100, Paul Durrant wrote:
> On Mon, 21 Oct 2019 at 16:59, Wei Liu <wl@xen.org> wrote:
> >
> > 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 <liuwe@microsoft.com>
> > Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
> > ---
> >  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.
> 
> This text needs to be modified. Perhaps just say 'when it is running
> in a virtual machine'. That should be future-proof.
> 

I don't think it should be modified -- XEN_GUEST here really means
specifically running under Xen but not others.

We will later introduced HYPERV_GUEST.

Wei.
Jan Beulich Nov. 15, 2019, 1:34 p.m. UTC | #3
On 21.10.2019 17:57, Wei Liu wrote:
> 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 <liuwe@microsoft.com>
> Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>

Acked-by: Jan Beulich <jbeulich@suse.com>
diff mbox series

Patch

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