Skip to content

Commit

Permalink
kconfig: add xenconfig defconfig helper
Browse files Browse the repository at this point in the history
This lets you build a kernel which can support xen dom0
or xen guests on i386, x86-64 and arm64 by just using:

   make xenconfig

You can start from an allnoconfig and then switch to xenconfig.
This also splits out the options which are available currently
to be built with x86 and 'make ARCH=arm64' under a shared config.

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.

A few generic notes: we enable both of these:

CONFIG_INET=y
CONFIG_BINFMT_ELF=y

although technically not required given you likely will
end up with a pretty useless system otherwise.

A few architectural differences worth noting:

$ make allnoconfig; make xenconfig > /dev/null ; \
	grep XEN .config > 64-bit-config
$ make ARCH=i386 allnoconfig; make ARCH=i386 xenconfig > /dev/null; \
	grep XEN .config > 32-bit-config
$ make ARCH=arm64 allnoconfig; make ARCH=arm64 xenconfig > /dev/null; \
	grep XEN .config > arm64-config

Since the options are already split up with a generic config and
architecture specific configs you anything on the x86 configs
are known to only work right now on x86. For instance arm64 doesn't
support MEMORY_HOTPLUG yet as such although we try to enabe it
generically arm64 doesn't have it yet, so we leave the xen
specific kconfig option XEN_BALLOON_MEMORY_HOTPLUG on x86's config
file to set expecations correctly.

Then on x86 we have differences between i386 and x86-64. The difference
between 64-bit-config and 32-bit-config is you don't get XEN_MCE_LOG as
this is only supported on 64-bit. You also do not get on i386
XEN_BALLOON_MEMORY_HOTPLUG, there does not seem to be any technical
reasons to not allow this but I gave up after a few attempts.

Cc: Josh Triplett <[email protected]>
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]
Acked-by: Stefano Stabellini <[email protected]>
Acked-by: Julien Grall <[email protected]>
Acked-by: Michal Marek <[email protected]>
Acked-by: David Rientjes <[email protected]>
Reviewed-by: Josh Triplett <[email protected]>
Signed-off-by: Luis R. Rodriguez <[email protected]>
Signed-off-by: David Vrabel <[email protected]>
  • Loading branch information
mcgrof authored and David Vrabel committed Jun 16, 2015
1 parent 9bcd776 commit 6c66850
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 0 deletions.
28 changes: 28 additions & 0 deletions arch/x86/configs/xen.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
# global x86 required specific stuff
# On 32-bit HIGHMEM4G is not allowed
CONFIG_HIGHMEM64G=y
CONFIG_64BIT=y

# These enable us to allow some of the
# not so generic stuff below
CONFIG_HYPERVISOR_GUEST=y
CONFIG_PCI=y
CONFIG_PCI_MSI=y
CONFIG_X86_MCE=y
CONFIG_ACPI_PROCESSOR=y
CONFIG_CPU_FREQ=y

# x86 xen specific config options
CONFIG_XEN_PVH=y
CONFIG_XEN_MAX_DOMAIN_MEMORY=500
CONFIG_XEN_SAVE_RESTORE=y
# CONFIG_XEN_DEBUG_FS is not set
CONFIG_XEN_MCE_LOG=y
CONFIG_XEN_ACPI_PROCESSOR=m
# x86 specific backend drivers
CONFIG_XEN_PCIDEV_BACKEND=m
# x86 specific frontend drivers
CONFIG_XEN_PCIDEV_FRONTEND=m
# depends on MEMORY_HOTPLUG, arm64 doesn't enable this yet,
# move to generic config if it ever does.
CONFIG_XEN_BALLOON_MEMORY_HOTPLUG=y
48 changes: 48 additions & 0 deletions kernel/configs/xen.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# global stuff - these enable us to allow some
# of the not so generic stuff below for xen
CONFIG_PARAVIRT=y
CONFIG_NET=y
CONFIG_NET_CORE=y
CONFIG_NETDEVICES=y
CONFIG_BLOCK=y
CONFIG_WATCHDOG=y
CONFIG_TARGET_CORE=y
CONFIG_SCSI=y
CONFIG_FB=y
CONFIG_INPUT_MISC=y
CONFIG_MEMORY_HOTPLUG=y
CONFIG_TTY=y
# Technically not required but otherwise produces
# pretty useless systems starting from allnoconfig
# You want TCP/IP and ELF binaries right?
CONFIG_INET=y
CONFIG_BINFMT_ELF=y
# generic config
CONFIG_XEN=y
CONFIG_XEN_DOM0=y
# backend drivers
CONFIG_XEN_BACKEND=y
CONFIG_XEN_BLKDEV_BACKEND=m
CONFIG_XEN_NETDEV_BACKEND=m
CONFIG_HVC_XEN=y
CONFIG_XEN_WDT=m
CONFIG_XEN_SCSI_BACKEND=m
# frontend drivers
CONFIG_XEN_FBDEV_FRONTEND=m
CONFIG_HVC_XEN_FRONTEND=y
CONFIG_INPUT_XEN_KBDDEV_FRONTEND=m
CONFIG_XEN_SCSI_FRONTEND=m
# others
CONFIG_XEN_BALLOON=y
CONFIG_XEN_SCRUB_PAGES=y
CONFIG_XEN_DEV_EVTCHN=m
CONFIG_XEN_BLKDEV_FRONTEND=m
CONFIG_XEN_NETDEV_FRONTEND=m
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_PRIVCMD=m
5 changes: 5 additions & 0 deletions scripts/kconfig/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ PHONY += kvmconfig
kvmconfig: kvm_guest.config
@:

PHONY += xenconfig
xenconfig: xen.config
@:

PHONY += tinyconfig
tinyconfig:
$(Q)$(MAKE) -f $(srctree)/Makefile allnoconfig tiny.config
Expand All @@ -140,6 +144,7 @@ help:
@echo ' listnewconfig - List new options'
@echo ' olddefconfig - Same as silentoldconfig but sets new symbols to their default value'
@echo ' kvmconfig - Enable additional options for kvm guest kernel support'
@echo ' xenconfig - Enable additional options for xen dom0 and guest kernel support'
@echo ' tinyconfig - Configure the tiniest possible kernel'

# lxdialog stuff
Expand Down

0 comments on commit 6c66850

Please sign in to comment.