2014-06-06 23:11:20

by Luis Chamberlain

[permalink] [raw]
Subject: [PATCH 1/3] x86, platform, xen, kconfig: clarify kvmconfig is for kvm

From: "Luis R. Rodriguez" <[email protected]>

We'll be adding options for xen as well.

Cc: Borislav Petkov <[email protected]>
Cc: Pekka Enberg <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Michal Marek <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: David Vrabel <[email protected]>
Cc: Ian Campbell <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: [email protected]
Signed-off-by: Luis R. Rodriguez <[email protected]>
---
arch/x86/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 33f71b0..37621ac 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -269,5 +269,5 @@ define archhelp
echo ' bzdisk/fdimage*/isoimage also accept:'
echo ' FDARGS="..." arguments for the booted kernel'
echo ' FDINITRD=file initrd for the booted kernel'
- echo ' kvmconfig - Enable additional options for guest kernel support'
+ echo ' kvmconfig - Enable additional options for kvm guest kernel support'
endef
--
2.0.0.rc3.18.g00a5b79


2014-06-06 23:11:25

by Luis Chamberlain

[permalink] [raw]
Subject: [PATCH 2/3] x86, platform, xen, kconfig: add xen defconfig helper

From: "Luis R. Rodriguez" <[email protected]>

This lets you build a kernel which can support xen dom0
or xen gusets by just using:

make xenconfig

Technically xen supports a dom0 kernel and also a guest
kernel configuration but upon review with the xen team
since we don't have many dom0 options its best to just
combine these two into one.

Cc: Borislav Petkov <[email protected]>
Cc: Pekka Enberg <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Michal Marek <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: David Vrabel <[email protected]>
Cc: Ian Campbell <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: [email protected]
Signed-off-by: Luis R. Rodriguez <[email protected]>
---
arch/x86/Makefile | 7 +++++++
arch/x86/configs/xen.config | 36 ++++++++++++++++++++++++++++++++++++
2 files changed, 43 insertions(+)
create mode 100644 arch/x86/configs/xen.config

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 37621ac..9db34e2 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -256,6 +256,12 @@ kvmconfig:
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(srctree)/arch/x86/configs/kvm_guest.config
$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig

+PHONY += xenconfig
+xenconfig:
+ $(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target))
+ $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(srctree)/arch/x86/configs/xen.config
+ $(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
+
define archhelp
echo '* bzImage - Compressed kernel image (arch/x86/boot/bzImage)'
echo ' install - Install kernel using'
@@ -270,4 +276,5 @@ define archhelp
echo ' FDARGS="..." arguments for the booted kernel'
echo ' FDINITRD=file initrd for the booted kernel'
echo ' kvmconfig - Enable additional options for kvm guest kernel support'
+ echo ' xenconfig - Enable additional options for xen dom0 and guest kernel support'
endef
diff --git a/arch/x86/configs/xen.config b/arch/x86/configs/xen.config
new file mode 100644
index 0000000..fbfbe5c
--- /dev/null
+++ b/arch/x86/configs/xen.config
@@ -0,0 +1,36 @@
+CONFIG_XEN=y
+CONFIG_XEN_DOM0=y
+CONFIG_XEN_PVHVM=y
+CONFIG_XEN_MAX_DOMAIN_MEMORY=500
+CONFIG_XEN_SAVE_RESTORE=y
+# CONFIG_XEN_DEBUG_FS is not set
+CONFIG_XEN_PVH=y
+CONFIG_PCI_XEN=y
+CONFIG_XEN_PCIDEV_FRONTEND=m
+CONFIG_XEN_BLKDEV_FRONTEND=m
+CONFIG_XEN_BLKDEV_BACKEND=m
+CONFIG_XEN_NETDEV_FRONTEND=m
+CONFIG_XEN_NETDEV_BACKEND=m
+CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y
+CONFIG_HVC_XEN=y
+CONFIG_HVC_XEN_FRONTEND=y
+CONFIG_TCG_XEN=m
+CONFIG_XEN_WDT=m
+CONFIG_XEN_FBDEV_FRONTEND=y
+CONFIG_XEN_BALLOON=y
+CONFIG_XEN_BALLOON_MEMORY_HOTPLUG=y
+CONFIG_XEN_SCRUB_PAGES=y
+CONFIG_XEN_DEV_EVTCHN=m
+CONFIG_XEN_BACKEND=y
+CONFIG_XENFS=m
+CONFIG_XEN_COMPAT_XENFS=y
+CONFIG_XEN_SYS_HYPERVISOR=y
+CONFIG_XEN_XENBUS_FRONTEND=y
+CONFIG_XEN_GNTDEV=m
+CONFIG_XEN_GRANT_DEV_ALLOC=m
+CONFIG_SWIOTLB_XEN=y
+CONFIG_XEN_PCIDEV_BACKEND=m
+CONFIG_XEN_PRIVCMD=m
+CONFIG_XEN_ACPI_PROCESSOR=m
+CONFIG_XEN_MCE_LOG=y
+CONFIG_XEN_HAVE_PVMMU=y
--
2.0.0.rc3.18.g00a5b79

2014-06-06 23:11:31

by Luis Chamberlain

[permalink] [raw]
Subject: [PATCH 3/3] x86, platform, kconfig: add virtconfig defconfig helper

From: "Luis R. Rodriguez" <[email protected]>

This lets you use:

make virtconfig

to merge you current kernel configuration with options to
enable both kvm and xen (dom0 and guest) requirements.

Cc: Borislav Petkov <[email protected]>
Cc: Pekka Enberg <[email protected]>
Cc: David Rientjes <[email protected]>
Cc: Michal Marek <[email protected]>
Cc: Randy Dunlap <[email protected]>
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: [email protected]
Cc: David Vrabel <[email protected]>
Cc: Ian Campbell <[email protected]>
Cc: Konrad Rzeszutek Wilk <[email protected]>
Cc: [email protected]
Signed-off-by: Luis R. Rodriguez <[email protected]>
---
arch/x86/Makefile | 6 ++++++
1 file changed, 6 insertions(+)

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
index 9db34e2..f2df13e 100644
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -262,6 +262,11 @@ xenconfig:
$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(srctree)/arch/x86/configs/xen.config
$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig

+PHONY += virtconfig
+virtconfig:
+ $(Q)$(MAKE) kvmconfig
+ $(Q)$(MAKE) xenconfig
+
define archhelp
echo '* bzImage - Compressed kernel image (arch/x86/boot/bzImage)'
echo ' install - Install kernel using'
@@ -277,4 +282,5 @@ define archhelp
echo ' FDINITRD=file initrd for the booted kernel'
echo ' kvmconfig - Enable additional options for kvm guest kernel support'
echo ' xenconfig - Enable additional options for xen dom0 and guest kernel support'
+ echo ' virtconfig - Enable additional options for kvm and xen kernel support'
endef
--
2.0.0.rc3.18.g00a5b79

2014-06-07 09:04:35

by Borislav Petkov

[permalink] [raw]
Subject: Re: [PATCH 3/3] x86, platform, kconfig: add virtconfig defconfig helper

On Fri, Jun 06, 2014 at 04:11:09PM -0700, Luis R. Rodriguez wrote:
> From: "Luis R. Rodriguez" <[email protected]>
>
> This lets you use:
>
> make virtconfig
>
> to merge you current kernel configuration with options to
> enable both kvm and xen (dom0 and guest) requirements.

What would be the use case for that?

2014-06-07 09:08:51

by David Rientjes

[permalink] [raw]
Subject: Re: [PATCH 1/3] x86, platform, xen, kconfig: clarify kvmconfig is for kvm

On Fri, 6 Jun 2014, Luis R. Rodriguez wrote:

> From: "Luis R. Rodriguez" <[email protected]>
>
> We'll be adding options for xen as well.
>
> Cc: Borislav Petkov <[email protected]>
> Cc: Pekka Enberg <[email protected]>
> Cc: David Rientjes <[email protected]>
> Cc: Michal Marek <[email protected]>
> Cc: Randy Dunlap <[email protected]>
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: [email protected]
> Cc: David Vrabel <[email protected]>
> Cc: Ian Campbell <[email protected]>
> Cc: Konrad Rzeszutek Wilk <[email protected]>
> Cc: [email protected]
> Signed-off-by: Luis R. Rodriguez <[email protected]>

Acked-by: David Rientjes <[email protected]>

2014-06-07 09:11:37

by David Rientjes

[permalink] [raw]
Subject: Re: [PATCH 2/3] x86, platform, xen, kconfig: add xen defconfig helper

On Fri, 6 Jun 2014, Luis R. Rodriguez wrote:

> diff --git a/arch/x86/Makefile b/arch/x86/Makefile
> index 37621ac..9db34e2 100644
> --- a/arch/x86/Makefile
> +++ b/arch/x86/Makefile
> @@ -256,6 +256,12 @@ kvmconfig:
> $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(srctree)/arch/x86/configs/kvm_guest.config
> $(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
>
> +PHONY += xenconfig
> +xenconfig:
> + $(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target))
> + $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(srctree)/arch/x86/configs/xen.config
> + $(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
> +
> define archhelp
> echo '* bzImage - Compressed kernel image (arch/x86/boot/bzImage)'
> echo ' install - Install kernel using'
> @@ -270,4 +276,5 @@ define archhelp
> echo ' FDARGS="..." arguments for the booted kernel'
> echo ' FDINITRD=file initrd for the booted kernel'
> echo ' kvmconfig - Enable additional options for kvm guest kernel support'
> + echo ' xenconfig - Enable additional options for xen dom0 and guest kernel support'
> endef

I suppose it would be easier to generalize the functionality and do
something like this instead since the two are otherwise identical:

diff --git a/arch/x86/Makefile b/arch/x86/Makefile
--- a/arch/x86/Makefile
+++ b/arch/x86/Makefile
@@ -250,11 +250,19 @@ archclean:
$(Q)$(MAKE) $(clean)=$(boot)
$(Q)$(MAKE) $(clean)=arch/x86/tools

+define build-virtconfig
+$(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target))
+$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(srctree)/arch/x86/configs/$(1)
+$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
+endef
+
PHONY += kvmconfig
kvmconfig:
- $(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target))
- $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(srctree)/arch/x86/configs/kvm_guest.config
- $(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
+ $(call build-virtconfig,kvm_guest.config)
+
+PHONY += xenconfig
+xenconfig:
+ $(call build-virtconfig,xen.config)

define archhelp
echo '* bzImage - Compressed kernel image (arch/x86/boot/bzImage)'

2014-06-07 09:14:16

by David Rientjes

[permalink] [raw]
Subject: Re: [PATCH 3/3] x86, platform, kconfig: add virtconfig defconfig helper

On Fri, 6 Jun 2014, Luis R. Rodriguez wrote:

> From: "Luis R. Rodriguez" <[email protected]>
>
> This lets you use:
>
> make virtconfig
>
> to merge you current kernel configuration with options to
> enable both kvm and xen (dom0 and guest) requirements.
>

I'm not sure that this shortcut is worth a separate make target.

2014-06-09 17:15:29

by Luis Chamberlain

[permalink] [raw]
Subject: Re: [PATCH 3/3] x86, platform, kconfig: add virtconfig defconfig helper

On Sat, Jun 07, 2014 at 11:04:30AM +0200, Borislav Petkov wrote:
> On Fri, Jun 06, 2014 at 04:11:09PM -0700, Luis R. Rodriguez wrote:
> > From: "Luis R. Rodriguez" <[email protected]>
> >
> > This lets you use:
> >
> > make virtconfig
> >
> > to merge you current kernel configuration with options to
> > enable both kvm and xen (dom0 and guest) requirements.
>
> What would be the use case for that?

This was based on a recommendation on xen-devel after review of
the xen RFC, the use case would be to enable usage of both in
one go. I'll drop this one.

Luis

2014-06-09 17:15:43

by Luis Chamberlain

[permalink] [raw]
Subject: Re: [PATCH 3/3] x86, platform, kconfig: add virtconfig defconfig helper

On Sat, Jun 07, 2014 at 02:14:11AM -0700, David Rientjes wrote:
> On Fri, 6 Jun 2014, Luis R. Rodriguez wrote:
>
> > From: "Luis R. Rodriguez" <[email protected]>
> >
> > This lets you use:
> >
> > make virtconfig
> >
> > to merge you current kernel configuration with options to
> > enable both kvm and xen (dom0 and guest) requirements.
> >
>
> I'm not sure that this shortcut is worth a separate make target.

OK I'll drop it.

Luis

2014-06-09 17:38:40

by Luis Chamberlain

[permalink] [raw]
Subject: Re: [PATCH 2/3] x86, platform, xen, kconfig: add xen defconfig helper

On Sat, Jun 07, 2014 at 02:11:32AM -0700, David Rientjes wrote:
> On Fri, 6 Jun 2014, Luis R. Rodriguez wrote:
>
> > diff --git a/arch/x86/Makefile b/arch/x86/Makefile
> > index 37621ac..9db34e2 100644
> > --- a/arch/x86/Makefile
> > +++ b/arch/x86/Makefile
> > @@ -256,6 +256,12 @@ kvmconfig:
> > $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(srctree)/arch/x86/configs/kvm_guest.config
> > $(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
> >
> > +PHONY += xenconfig
> > +xenconfig:
> > + $(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target))
> > + $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(srctree)/arch/x86/configs/xen.config
> > + $(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
> > +
> > define archhelp
> > echo '* bzImage - Compressed kernel image (arch/x86/boot/bzImage)'
> > echo ' install - Install kernel using'
> > @@ -270,4 +276,5 @@ define archhelp
> > echo ' FDARGS="..." arguments for the booted kernel'
> > echo ' FDINITRD=file initrd for the booted kernel'
> > echo ' kvmconfig - Enable additional options for kvm guest kernel support'
> > + echo ' xenconfig - Enable additional options for xen dom0 and guest kernel support'
> > endef
>
> I suppose it would be easier to generalize the functionality and do
> something like this instead since the two are otherwise identical:
>
> diff --git a/arch/x86/Makefile b/arch/x86/Makefile
> --- a/arch/x86/Makefile
> +++ b/arch/x86/Makefile
> @@ -250,11 +250,19 @@ archclean:
> $(Q)$(MAKE) $(clean)=$(boot)
> $(Q)$(MAKE) $(clean)=arch/x86/tools
>
> +define build-virtconfig
> +$(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target))
> +$(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(srctree)/arch/x86/configs/$(1)
> +$(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
> +endef
> +
> PHONY += kvmconfig
> kvmconfig:
> - $(if $(wildcard $(objtree)/.config),, $(error You need an existing .config for this target))
> - $(Q)$(CONFIG_SHELL) $(srctree)/scripts/kconfig/merge_config.sh -m -O $(objtree) $(objtree)/.config $(srctree)/arch/x86/configs/kvm_guest.config
> - $(Q)yes "" | $(MAKE) -f $(srctree)/Makefile oldconfig
> + $(call build-virtconfig,kvm_guest.config)
> +
> +PHONY += xenconfig
> +xenconfig:
> + $(call build-virtconfig,xen.config)
>
> define archhelp
> echo '* bzImage - Compressed kernel image (arch/x86/boot/bzImage)'
>

Good idea, I've folded this as a first patch then and will resubmit, dropping
the virtconfig kconfig option.

Luis

2014-06-10 08:35:45

by Ian Campbell

[permalink] [raw]
Subject: Re: [PATCH 3/3] x86, platform, kconfig: add virtconfig defconfig helper

On Mon, 2014-06-09 at 19:15 +0200, Luis R. Rodriguez wrote:
> On Sat, Jun 07, 2014 at 11:04:30AM +0200, Borislav Petkov wrote:
> > On Fri, Jun 06, 2014 at 04:11:09PM -0700, Luis R. Rodriguez wrote:
> > > From: "Luis R. Rodriguez" <[email protected]>
> > >
> > > This lets you use:
> > >
> > > make virtconfig
> > >
> > > to merge you current kernel configuration with options to
> > > enable both kvm and xen (dom0 and guest) requirements.
> >
> > What would be the use case for that?
>
> This was based on a recommendation on xen-devel after review of
> the xen RFC,

Actually what I meant was to *replace* kvmconfig with virtconfig and
then add the Xen stuff to it, i.e. to have a single thing to maintain
for all virt platforms, rather than end up with all 3 options.

I think the overhead of having some Xen stuff enabled in .config when
running on KVM and vice versa is small.

Ian.

2014-06-10 09:04:47

by Borislav Petkov

[permalink] [raw]
Subject: Re: [PATCH 3/3] x86, platform, kconfig: add virtconfig defconfig helper

On Tue, Jun 10, 2014 at 09:35:39AM +0100, Ian Campbell wrote:
> Actually what I meant was to *replace* kvmconfig with virtconfig and
> then add the Xen stuff to it, i.e. to have a single thing to maintain
> for all virt platforms, rather than end up with all 3 options.
>
> I think the overhead of having some Xen stuff enabled in .config when
> running on KVM and vice versa is small.

Hmm, no. I'm running my kvm-enabled configs on baremetal too and I
wouldn't want any overhead at all. So kvmconfig and xenconfig should be
separate targets with separate config files please.

--
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--

2014-06-10 09:13:53

by Ian Campbell

[permalink] [raw]
Subject: Re: [PATCH 3/3] x86, platform, kconfig: add virtconfig defconfig helper

On Tue, 2014-06-10 at 11:01 +0200, Borislav Petkov wrote:
> On Tue, Jun 10, 2014 at 09:35:39AM +0100, Ian Campbell wrote:
> > Actually what I meant was to *replace* kvmconfig with virtconfig and
> > then add the Xen stuff to it, i.e. to have a single thing to maintain
> > for all virt platforms, rather than end up with all 3 options.
> >
> > I think the overhead of having some Xen stuff enabled in .config when
> > running on KVM and vice versa is small.
>
> Hmm, no. I'm running my kvm-enabled configs on baremetal too and I
> wouldn't want any overhead at all. So kvmconfig and xenconfig should be
> separate targets with separate config files please.

NB the overhead I meant was a few kbs of .text and modules, not runtime
overhead.

Ian.

2014-06-10 09:19:22

by Borislav Petkov

[permalink] [raw]
Subject: Re: [PATCH 3/3] x86, platform, kconfig: add virtconfig defconfig helper

On Tue, Jun 10, 2014 at 10:13:48AM +0100, Ian Campbell wrote:
> NB the overhead I meant was a few kbs of .text and modules, not
> runtime overhead.

Whatever, no thanks.

--
Regards/Gruss,
Boris.

Sent from a fat crate under my desk. Formatting is fine.
--