Skip to contentSkip to conversation

linux-yocto: Add xen guest kernel fragment support for PV/HVM guests, using 'xen-guest' distro flag.

PATCH In review Chris Patterson 2 participants 10 messages Oct 6, 2013 – Oct 8, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 linux-yocto: Add xen guest kernel fragment support for PV/HVM guests, using 'xen-guest' distro flag.

---
 recipes-kernel/linux/linux-yocto/xen-guest.cfg | 55 ++++++++++++++++++++++++++
 recipes-kernel/linux/linux-yocto/xen-guest.scc |  4 ++
 recipes-kernel/linux/linux-yocto_3.10.bbappend |  3 ++
 recipes-kernel/linux/linux-yocto_3.4.bbappend  |  3 ++
 recipes-kernel/linux/linux-yocto_3.8.bbappend  |  3 ++
 5 files changed, 68 insertions(+)
 create mode 100644 recipes-kernel/linux/linux-yocto/xen-guest.cfg
 create mode 100644 recipes-kernel/linux/linux-yocto/xen-guest.scc
recipes-kernel/linux/linux-yocto/xen-guest.cfg new file +55 -0
new file mode 100644
index 0000000..cbde3cc
@@ -0,0 +1,55 @@
+###
+# linux 3.4, 3.8
+CONFIG_PARAVIRT_GUEST=y
+###
+
+###
+# linux 3.10
+CONFIG_HYPERVISOR_GUEST=y
+###
+
+CONFIG_PARAVIRT=y
+CONFIG_XEN=y
+CONFIG_XEN_DOM0=y
+CONFIG_XEN_PRIVILEGED_GUEST=y
+CONFIG_XEN_PVHVM=y
+CONFIG_XEN_MAX_DOMAIN_MEMORY=500
+CONFIG_XEN_SAVE_RESTORE=y
+CONFIG_KVM_GUEST=y
+CONFIG_PARAVIRT_CLOCK=y
+CONFIG_HIBERNATE_CALLBACKS=y
+CONFIG_PCI_XEN=y
+CONFIG_XEN_PCIDEV_FRONTEND=m
+CONFIG_SYS_HYPERVISOR=y
+CONFIG_XEN_BLKDEV_FRONTEND=y
+CONFIG_XEN_BLKDEV_BACKEND=m
+CONFIG_XEN_NETDEV_FRONTEND=y
+CONFIG_XEN_NETDEV_BACKEND=m
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y
+CONFIG_HVC_IRQ=y
+CONFIG_HVC_XEN=y
+CONFIG_HVC_XEN_FRONTEND=y
+CONFIG_XEN_WDT=m
+CONFIG_FB_SYS_FILLRECT=y
+CONFIG_FB_SYS_COPYAREA=y
+CONFIG_FB_SYS_IMAGEBLIT=y
+CONFIG_FB_SYS_FOPS=y
+CONFIG_FB_DEFERRED_IO=y
+CONFIG_XEN_FBDEV_FRONTEND=y
+CONFIG_XEN_BALLOON=y
+CONFIG_XEN_SCRUB_PAGES=y
+CONFIG_XEN_DEV_EVTCHN=y
+CONFIG_XEN_BACKEND=y
+CONFIG_XENFS=y
+CONFIG_XEN_COMPAT_XENFS=y
+CONFIG_XEN_SYS_HYPERVISOR=y
+CONFIG_XEN_XENBUS_FRONTEND=y
+CONFIG_XEN_GNTDEV=y
+CONFIG_XEN_GRANT_DEV_ALLOC=y
+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
recipes-kernel/linux/linux-yocto/xen-guest.scc new file +4 -0
new file mode 100644
index 0000000..575bc43
@@ -0,0 +1,4 @@
+define KFEATURE_DESCRIPTION "Xen PV Guest Support"
+define KFEATURE_COMPATIBILITY board
+
+kconf non-hardware xen-guest.cfg
recipes-kernel/linux/linux-yocto_3.10.bbappend +3 -0
index cc7fd98..a3165cd 100644
@@ -17,3 +17,6 @@ KERNEL_FEATURES_append += "${@base_contains('DISTRO_FEATURES', 'aufs', ' feature
 
 # xen dom0 kernel support
 SRC_URI += "${@base_contains('DISTRO_FEATURES', 'xen', ' file://xen.scc', '', d)}"
+
+# xen guest kernel support
+SRC_URI += "${@base_contains('DISTRO_FEATURES', 'xen-guest', ' file://xen-guest.scc', '', d)}"
recipes-kernel/linux/linux-yocto_3.4.bbappend +3 -0
index 448d57f..4d3a0d1 100644
@@ -14,3 +14,6 @@ module_autoload_kvm-intel = "kvm-intel"
 
 # xen dom0 kernel support
 SRC_URI += "${@base_contains('DISTRO_FEATURES', 'xen', ' file://xen.scc', '', d)}"
+
+# xen guest kernel support
+SRC_URI += "${@base_contains('DISTRO_FEATURES', 'xen-guest', ' file://xen-guest.scc', '', d)}"
recipes-kernel/linux/linux-yocto_3.8.bbappend +3 -0
index cc7fd98..a3165cd 100644
@@ -17,3 +17,6 @@ KERNEL_FEATURES_append += "${@base_contains('DISTRO_FEATURES', 'aufs', ' feature
 
 # xen dom0 kernel support
 SRC_URI += "${@base_contains('DISTRO_FEATURES', 'xen', ' file://xen.scc', '', d)}"
+
+# xen guest kernel support
+SRC_URI += "${@base_contains('DISTRO_FEATURES', 'xen-guest', ' file://xen-guest.scc', '', d)}"
Signature · 1 line
1.8.4.rc3
#1 lore raw

PATCH 1/1 xen: add INSANE_SKIP flag 'already-stripped' to silence QA warnings about stripped qemu binaries.

---
 recipes-extended/xen/xen_4.3.0.bb | 1 +
 1 file changed, 1 insertion(+)
recipes-extended/xen/xen_4.3.0.bb +1 -0
index 9cbd2ac..e9a22cc 100644
@@ -299,6 +299,7 @@ FILES_${PN}-python = "\
     ${libdir}/python2.7 \
     "
 
+INSANE_SKIP_${PN} = "already-stripped"
 INSANE_SKIP_${PN}-qemu = "arch"
 FILES_${PN}-qemu = " \
     ${datadir}/xen/qemu \
Signature · 1 line
1.8.4.rc3
#2 lore raw

Re: [PATCH] xen: add INSANE_SKIP flag 'already-stripped' to silence QA warnings about stripped qemu binaries.

+1 on this

Quoted 18 lines · Chris Patterson
---
 recipes-extended/xen/xen_4.3.0.bb | 1 +
 1 file changed, 1 insertion(+)
recipes-extended/xen/xen_4.3.0.bb +1 -0
index 9cbd2ac..e9a22cc 100644
@@ -299,6 +299,7 @@ FILES_${PN}-python = "\
     ${libdir}/python2.7 \
     "
 
+INSANE_SKIP_${PN} = "already-stripped"
 INSANE_SKIP_${PN}-qemu = "arch"
 FILES_${PN}-qemu = " \
     ${datadir}/xen/qemu \
#3 lore raw

PATCH 1/1 xen: Add sdl support by including dependency for libsdl.

In reply to Chris Patterson
---
 recipes-extended/xen/xen_4.3.0.bb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
recipes-extended/xen/xen_4.3.0.bb +2 -2
index 233be99..9cbd2ac 100644
@@ -17,13 +17,13 @@ COMPATIBLE_HOST = '(x86_64.*).*-linux'
 
 inherit autotools gettext setuptools update-rc.d
 
-DEPENDS = "util-linux util-linux-native file-native zlib ncurses openssl bison-native flex-native gettext dev86-native iasl-native pciutils virtual/libgl virtual/libsdl bridge-utils iproute2 procps yajl pixman python python-setuptools-native xz xz-native"
+DEPENDS = "util-linux util-linux-native file-native zlib ncurses openssl bison-native flex-native gettext dev86-native iasl-native pciutils virtual/libgl virtual/libsdl bridge-utils iproute2 procps yajl pixman python python-setuptools-native xz xz-native libsdl"
 
 # inherit setuptools adds python to RDEPENDS, override it
 RDEPENDS_${PN} = ""
 
 RDEPENDS_${PN}-base = "\
-    libgcc udev bash perl xz \
+    libgcc libsdl udev bash perl xz \
     ${PN}-blktap \
     ${PN}-console \
     ${PN}-libblktapctl \
Signature · 1 line
1.8.4.rc3
#4 lore raw

PATCH 1/1 xen-guest-image-minimal: example image for a PV/HVM/PVHVM xen guest built with the 'xen-guest' kernel fragment.

In reply to Chris Patterson
---
 recipes-extended/images/xen-guest-image-minimal.bb | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 recipes-extended/images/xen-guest-image-minimal.bb
recipes-extended/images/xen-guest-image-minimal.bb new file +31 -0
new file mode 100644
index 0000000..05b0b61
@@ -0,0 +1,31 @@
+DESCRIPTION = "A Xen PV guest image."
+
+inherit core-image
+
+IMAGE_INSTALL += " \
+    packagegroup-core-boot \
+    kernel-module-xen-acpi-processor \
+    kernel-module-xen-blkback \
+    kernel-module-xen-netback \
+    kernel-module-xen-pciback \
+    kernel-module-xen-pcifront \
+    "
+
+IMAGE_INSTALL += "${@base_contains('DISTRO_FEATURES', 'x11', ' xf86-video-fbdev', '', d)}"
+IMAGE_INSTALL += "${@base_contains('DISTRO_FEATURES', 'x11', ' xf86-video-vesa', '', d)}"
+
+LICENSE = "MIT"
+
+SYSLINUX_KERNEL_ARGS ?= "LABEL=boot ramdisk_size=32768 root=/dev/ram0 rootimg=rootfs.img rw console=hvc0 console=tty0 panic=10 debugshell=5"
+
+# syslinux is not required for PV guest configuration, but for HVM
+build_syslinux_cfg () {
+	echo "ALLOWOPTIONS 1" > ${SYSLINUXCFG}
+	echo "DEFAULT boot" >> ${SYSLINUXCFG}
+	echo "TIMEOUT 10" >> ${SYSLINUXCFG}
+	echo "PROMPT 1" >> ${SYSLINUXCFG}
+	echo "LABEL boot" >> ${SYSLINUXCFG}
+	echo "  KERNEL /vmlinuz" >> ${SYSLINUXCFG}
+	echo "  INITRD /initrd" >> ${SYSLINUXCFG}
+	echo "  APPEND ${SYSLINUX_KERNEL_ARGS}" >> ${SYSLINUXCFG}
+}
Signature · 1 line
1.8.4.rc3
#5 lore raw

Re: [PATCH] xen-guest-image-minimal: example image for a PV/HVM/PVHVM xen guest built with the 'xen-guest' kernel fragment.

I'm a bit confused about this one. Maybe it's my misunderstanding. Questions in line:

Quoted 12 lines · Chris Patterson
---
 recipes-extended/images/xen-guest-image-minimal.bb | 31 ++++++++++++++++++++++
 1 file changed, 31 insertions(+)
 create mode 100644 recipes-extended/images/xen-guest-image-minimal.bb
recipes-extended/images/xen-guest-image-minimal.bb new file +0 -0
new file mode 100644
index 0000000..05b0b61

recipes-extended/images/xen-guest-image-minimal.bb line 10

Quoted 10 lines
recipes-extended/images/xen-guest-image-minimal.bb new file +10 -0
@@ -0,0 +1,31 @@
+DESCRIPTION = "A Xen PV guest image."
+
+inherit core-image
+
+IMAGE_INSTALL += " \
+    packagegroup-core-boot \
+    kernel-module-xen-acpi-processor \
+    kernel-module-xen-blkback \
+    kernel-module-xen-netback \
+    kernel-module-xen-pciback \

For a minimal guest I'd expect you wouldn't want any of the *back drivers. Did you mean for these to be the *front drivers?

Cheers,
- Philip

Quoted 22 lines
recipes-extended/images/xen-guest-image-minimal.bb new file +21 -0
+    kernel-module-xen-pcifront \
+    "
+
+IMAGE_INSTALL += "${@base_contains('DISTRO_FEATURES', 'x11', ' xf86-video-fbdev', '', d)}"
+IMAGE_INSTALL += "${@base_contains('DISTRO_FEATURES', 'x11', ' xf86-video-vesa', '', d)}"
+
+LICENSE = "MIT"
+
+SYSLINUX_KERNEL_ARGS ?= "LABEL=boot ramdisk_size=32768 root=/dev/ram0 rootimg=rootfs.img rw console=hvc0 console=tty0 panic=10 debugshell=5"
+
+# syslinux is not required for PV guest configuration, but for HVM
+build_syslinux_cfg () {
+	echo "ALLOWOPTIONS 1" > ${SYSLINUXCFG}
+	echo "DEFAULT boot" >> ${SYSLINUXCFG}
+	echo "TIMEOUT 10" >> ${SYSLINUXCFG}
+	echo "PROMPT 1" >> ${SYSLINUXCFG}
+	echo "LABEL boot" >> ${SYSLINUXCFG}
+	echo "  KERNEL /vmlinuz" >> ${SYSLINUXCFG}
+	echo "  INITRD /initrd" >> ${SYSLINUXCFG}
+	echo "  APPEND ${SYSLINUX_KERNEL_ARGS}" >> ${SYSLINUXCFG}
+}
#6 lore raw

Re: [PATCH] xen-guest-image-minimal: example image for a PV/HVM/PVHVM xen guest built with the 'xen-guest' kernel fragment.

Quoted 23 lines · Philip Tricca

I'm a bit confused about this one. Maybe it's my misunderstanding. Questions in line:

Quoted 3 lines · Chris Patterson
---
 recipes-extended/images/xen-guest-image-minimal.bb | 31

++++++++++++++++++++++

Review

Quoted 4 lines
 1 file changed, 31 insertions(+)
 create mode 100644 recipes-extended/images/xen-guest-image-minimal.bb
(quoted diff) +0 -0

xen-guest-image-minimal.bb

Quoted 10 lines

new file mode 100644
index 0000000..05b0b61

recipes-extended/images/xen-guest-image-minimal.bb new file +5 -0
@@ -0,0 +1,31 @@
+DESCRIPTION = "A Xen PV guest image."
+
+inherit core-image
+
+IMAGE_INSTALL += " \
Quoted 10 lines

recipes-extended/images/xen-guest-image-minimal.bb line 10

Quoted 5 lines
recipes-extended/images/xen-guest-image-minimal.bb new file +5 -0
+    packagegroup-core-boot \
+    kernel-module-xen-acpi-processor \
+    kernel-module-xen-blkback \
+    kernel-module-xen-netback \
+    kernel-module-xen-pciback \

For a minimal guest I'd expect you wouldn't want any of the *back drivers. Did you mean for these to be the *front drivers?

This image was matching up to the xen-guest kernel fragment, including the remaining xen modules. The backend modules are not required and could be removed from this image.

Thanks,
-Chris

Quoted 30 lines

Cheers,
- Philip

recipes-extended/images/xen-guest-image-minimal.bb

Quoted 4 lines
recipes-extended/images/xen-guest-image-minimal.bb new file +4 -0
+    kernel-module-xen-pcifront \
+    "
+
+IMAGE_INSTALL += "${@base_contains('DISTRO_FEATURES', 'x11', '

xf86-video-fbdev', '', d)}"

recipes-extended/images/xen-guest-image-minimal.bb line 15

Quoted 1 line
recipes-extended/images/xen-guest-image-minimal.bb new file +1 -0
+IMAGE_INSTALL += "${@base_contains('DISTRO_FEATURES', 'x11', '

xf86-video-vesa', '', d)}"

recipes-extended/images/xen-guest-image-minimal.bb

Quoted 4 lines
recipes-extended/images/xen-guest-image-minimal.bb new file +4 -0
+
+LICENSE = "MIT"
+
+SYSLINUX_KERNEL_ARGS ?= "LABEL=boot ramdisk_size=32768 root=/dev/ram0

rootimg=rootfs.img rw console=hvc0 console=tty0 panic=10 debugshell=5"

Quoted 13 lines
recipes-extended/images/xen-guest-image-minimal.bb new file +12 -0
+
+# syslinux is not required for PV guest configuration, but for HVM
+build_syslinux_cfg () {
+     echo "ALLOWOPTIONS 1" > ${SYSLINUXCFG}
+     echo "DEFAULT boot" >> ${SYSLINUXCFG}
+     echo "TIMEOUT 10" >> ${SYSLINUXCFG}
+     echo "PROMPT 1" >> ${SYSLINUXCFG}
+     echo "LABEL boot" >> ${SYSLINUXCFG}
+     echo "  KERNEL /vmlinuz" >> ${SYSLINUXCFG}
+     echo "  INITRD /initrd" >> ${SYSLINUXCFG}
+     echo "  APPEND ${SYSLINUX_KERNEL_ARGS}" >> ${SYSLINUXCFG}
+}
#7 lore raw

PATCH 1/1 xen-image-minimal: break out arguments for xen and linux kernel as variables SYSLINUX_XEN_ARGS and SYSLINUX_KERNEL_ARGS to allow modification/overwriting.

In reply to Chris Patterson
---
 recipes-extended/images/xen-image-minimal.bb | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
recipes-extended/images/xen-image-minimal.bb +4 -1
index 23c4911..c582f57 100644
@@ -42,6 +42,9 @@ populate_append() {
 	install -m 0644 ${DEPLOY_DIR_IMAGE}/xen-${MACHINE}.gz ${DEST}/xen.gz
 }
 
+SYSLINUX_XEN_ARGS ?= "loglvl=all guest_loglvl=all console=com1,vga com1=115200,8n1"
+SYSLINUX_KERNEL_ARGS ?= "ramdisk_size=32768 root=/dev/ram0 rw console=hvc0 earlyprintk=xen console=tty0 panic=10 LABEL=boot debugshell=5"
+
 build_syslinux_cfg () {
 	echo "ALLOWOPTIONS 1" > ${SYSLINUXCFG}
 	echo "DEFAULT boot" >> ${SYSLINUXCFG}
@@ -49,6 +52,6 @@ build_syslinux_cfg () {
 	echo "PROMPT 1" >> ${SYSLINUXCFG}
 	echo "LABEL boot" >> ${SYSLINUXCFG}
 	echo "  KERNEL mboot.c32" >> ${SYSLINUXCFG}
-	echo "  APPEND /xen.gz loglvl=all guest_loglvl=all console=com1,vga com1=115200,8n1 --- /vmlinuz ramdisk_size=32768 root=/dev/ram0 rw console=hvc0 earlyprintk=xen console=tty0 panic=10 LABEL=boot debugshell=5 --- /initrd" >> ${SYSLINUXCFG}
+	echo "  APPEND /xen.gz ${SYSLINUX_XEN_ARGS} --- /vmlinuz ${SYSLINUX_KERNEL_ARGS} --- /initrd" >> ${SYSLINUXCFG}
 }
 
Signature · 1 line
1.8.4.rc3
#8 lore raw
In reply to Chris Patterson

I'm not the gate-keeper here so feel free to disagree but I'd like this more if it were broken up a bit. Thoughts on breaking guest support out into a PV guest and a PVHVM guest? The goal here would be to partition the kernel options that aren't modules (specifically PVHVM, DOM0, PVMMU, PRIVILEGED_GUEST etc).

No need to do all of this on the first past I suppose. It may be better to have someone propose a partitioning after this gets picked up.

Also: what's with having 'KVM_GUEST' compiled in? Is it a dependency?

Cheers,
- Philip

Quoted 116 lines · Chris Patterson
---
 recipes-kernel/linux/linux-yocto/xen-guest.cfg | 55 ++++++++++++++++++++++++++
 recipes-kernel/linux/linux-yocto/xen-guest.scc |  4 ++
 recipes-kernel/linux/linux-yocto_3.10.bbappend |  3 ++
 recipes-kernel/linux/linux-yocto_3.4.bbappend  |  3 ++
 recipes-kernel/linux/linux-yocto_3.8.bbappend  |  3 ++
 5 files changed, 68 insertions(+)
 create mode 100644 recipes-kernel/linux/linux-yocto/xen-guest.cfg
 create mode 100644 recipes-kernel/linux/linux-yocto/xen-guest.scc
recipes-kernel/linux/linux-yocto/xen-guest.cfg new file +55 -0
new file mode 100644
index 0000000..cbde3cc
@@ -0,0 +1,55 @@
+###
+# linux 3.4, 3.8
+CONFIG_PARAVIRT_GUEST=y
+###
+
+###
+# linux 3.10
+CONFIG_HYPERVISOR_GUEST=y
+###
+
+CONFIG_PARAVIRT=y
+CONFIG_XEN=y
+CONFIG_XEN_DOM0=y
+CONFIG_XEN_PRIVILEGED_GUEST=y
+CONFIG_XEN_PVHVM=y
+CONFIG_XEN_MAX_DOMAIN_MEMORY=500
+CONFIG_XEN_SAVE_RESTORE=y
+CONFIG_KVM_GUEST=y
+CONFIG_PARAVIRT_CLOCK=y
+CONFIG_HIBERNATE_CALLBACKS=y
+CONFIG_PCI_XEN=y
+CONFIG_XEN_PCIDEV_FRONTEND=m
+CONFIG_SYS_HYPERVISOR=y
+CONFIG_XEN_BLKDEV_FRONTEND=y
+CONFIG_XEN_BLKDEV_BACKEND=m
+CONFIG_XEN_NETDEV_FRONTEND=y
+CONFIG_XEN_NETDEV_BACKEND=m
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y
+CONFIG_HVC_IRQ=y
+CONFIG_HVC_XEN=y
+CONFIG_HVC_XEN_FRONTEND=y
+CONFIG_XEN_WDT=m
+CONFIG_FB_SYS_FILLRECT=y
+CONFIG_FB_SYS_COPYAREA=y
+CONFIG_FB_SYS_IMAGEBLIT=y
+CONFIG_FB_SYS_FOPS=y
+CONFIG_FB_DEFERRED_IO=y
+CONFIG_XEN_FBDEV_FRONTEND=y
+CONFIG_XEN_BALLOON=y
+CONFIG_XEN_SCRUB_PAGES=y
+CONFIG_XEN_DEV_EVTCHN=y
+CONFIG_XEN_BACKEND=y
+CONFIG_XENFS=y
+CONFIG_XEN_COMPAT_XENFS=y
+CONFIG_XEN_SYS_HYPERVISOR=y
+CONFIG_XEN_XENBUS_FRONTEND=y
+CONFIG_XEN_GNTDEV=y
+CONFIG_XEN_GRANT_DEV_ALLOC=y
+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
recipes-kernel/linux/linux-yocto/xen-guest.scc new file +4 -0
new file mode 100644
index 0000000..575bc43
@@ -0,0 +1,4 @@
+define KFEATURE_DESCRIPTION "Xen PV Guest Support"
+define KFEATURE_COMPATIBILITY board
+
+kconf non-hardware xen-guest.cfg
recipes-kernel/linux/linux-yocto_3.10.bbappend +3 -0
index cc7fd98..a3165cd 100644
@@ -17,3 +17,6 @@ KERNEL_FEATURES_append += "${@base_contains('DISTRO_FEATURES', 'aufs', ' feature
 
 # xen dom0 kernel support
 SRC_URI += "${@base_contains('DISTRO_FEATURES', 'xen', ' file://xen.scc', '', d)}"
+
+# xen guest kernel support
+SRC_URI += "${@base_contains('DISTRO_FEATURES', 'xen-guest', ' file://xen-guest.scc', '', d)}"
recipes-kernel/linux/linux-yocto_3.4.bbappend +3 -0
index 448d57f..4d3a0d1 100644
@@ -14,3 +14,6 @@ module_autoload_kvm-intel = "kvm-intel"
 
 # xen dom0 kernel support
 SRC_URI += "${@base_contains('DISTRO_FEATURES', 'xen', ' file://xen.scc', '', d)}"
+
+# xen guest kernel support
+SRC_URI += "${@base_contains('DISTRO_FEATURES', 'xen-guest', ' file://xen-guest.scc', '', d)}"
recipes-kernel/linux/linux-yocto_3.8.bbappend +3 -0
index cc7fd98..a3165cd 100644
@@ -17,3 +17,6 @@ KERNEL_FEATURES_append += "${@base_contains('DISTRO_FEATURES', 'aufs', ' feature
 
 # xen dom0 kernel support
 SRC_URI += "${@base_contains('DISTRO_FEATURES', 'xen', ' file://xen.scc', '', d)}"
+
+# xen guest kernel support
+SRC_URI += "${@base_contains('DISTRO_FEATURES', 'xen-guest', ' file://xen-guest.scc', '', d)}"
#9 lore raw

Hey Phil,

Quoted 7 lines · Philip Tricca

I'm not the gate-keeper here so feel free to disagree but I'd like this more if it were broken up a bit. Thoughts on breaking guest support out into a PV guest and a PVHVM guest? The goal here would be to partition the kernel options that aren't modules (specifically PVHVM, DOM0, PVMMU, PRIVILEGED_GUEST etc).

This was meant more for a general case, rather than the ultra-minimalist. It could certainly be broken up more. But then, it's not entirely clear to me where you draw the line. It appears to me that many yocto kernel configs/fragments tend to build in a significant amount of hardware device support instead of requiring modules.

My thoughts were to make the backend bits as modules and build in the common front ends (which is effectively virtual hardware support) and basics (PVHVM, etc). On that note, I set pcifront as a module in this fragment, which should probably also be built in.

No need to do all of this on the first past I suppose. It may be better to

Quoted 5 lines

have someone propose a partitioning after this gets picked up.

Also: what's with having 'KVM_GUEST' compiled in? Is it a dependency?

I think it slipped into the dom0 config when I was testing nested in KVM. And using that as my starting point, it slipped in again :) It should be able to be safely removed.

Have a good one,
-Chris

Cheers,

Quoted 135 lines

- Philip

Quoted 3 lines · Chris Patterson
---
 recipes-kernel/linux/linux-yocto/xen-guest.cfg | 55

++++++++++++++++++++++++++

Review

Quoted 9 lines
 recipes-kernel/linux/linux-yocto/xen-guest.scc |  4 ++
 recipes-kernel/linux/linux-yocto_3.10.bbappend |  3 ++
 recipes-kernel/linux/linux-yocto_3.4.bbappend  |  3 ++
 recipes-kernel/linux/linux-yocto_3.8.bbappend  |  3 ++
 5 files changed, 68 insertions(+)
 create mode 100644 recipes-kernel/linux/linux-yocto/xen-guest.cfg
 create mode 100644 recipes-kernel/linux/linux-yocto/xen-guest.scc
(quoted diff) +0 -0

b/recipes-kernel/linux/linux-yocto/xen-guest.cfg

Review

Quoted 61 lines

new file mode 100644
index 0000000..cbde3cc

recipes-kernel/linux/linux-yocto/xen-guest.cfg new file +55 -0
@@ -0,0 +1,55 @@
+###
+# linux 3.4, 3.8
+CONFIG_PARAVIRT_GUEST=y
+###
+
+###
+# linux 3.10
+CONFIG_HYPERVISOR_GUEST=y
+###
+
+CONFIG_PARAVIRT=y
+CONFIG_XEN=y
+CONFIG_XEN_DOM0=y
+CONFIG_XEN_PRIVILEGED_GUEST=y
+CONFIG_XEN_PVHVM=y
+CONFIG_XEN_MAX_DOMAIN_MEMORY=500
+CONFIG_XEN_SAVE_RESTORE=y
+CONFIG_KVM_GUEST=y
+CONFIG_PARAVIRT_CLOCK=y
+CONFIG_HIBERNATE_CALLBACKS=y
+CONFIG_PCI_XEN=y
+CONFIG_XEN_PCIDEV_FRONTEND=m
+CONFIG_SYS_HYPERVISOR=y
+CONFIG_XEN_BLKDEV_FRONTEND=y
+CONFIG_XEN_BLKDEV_BACKEND=m
+CONFIG_XEN_NETDEV_FRONTEND=y
+CONFIG_XEN_NETDEV_BACKEND=m
+CONFIG_INPUT_MISC=y
+CONFIG_INPUT_XEN_KBDDEV_FRONTEND=y
+CONFIG_HVC_IRQ=y
+CONFIG_HVC_XEN=y
+CONFIG_HVC_XEN_FRONTEND=y
+CONFIG_XEN_WDT=m
+CONFIG_FB_SYS_FILLRECT=y
+CONFIG_FB_SYS_COPYAREA=y
+CONFIG_FB_SYS_IMAGEBLIT=y
+CONFIG_FB_SYS_FOPS=y
+CONFIG_FB_DEFERRED_IO=y
+CONFIG_XEN_FBDEV_FRONTEND=y
+CONFIG_XEN_BALLOON=y
+CONFIG_XEN_SCRUB_PAGES=y
+CONFIG_XEN_DEV_EVTCHN=y
+CONFIG_XEN_BACKEND=y
+CONFIG_XENFS=y
+CONFIG_XEN_COMPAT_XENFS=y
+CONFIG_XEN_SYS_HYPERVISOR=y
+CONFIG_XEN_XENBUS_FRONTEND=y
+CONFIG_XEN_GNTDEV=y
+CONFIG_XEN_GRANT_DEV_ALLOC=y
+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
(quoted diff) +0 -0

b/recipes-kernel/linux/linux-yocto/xen-guest.scc

Review

Quoted 10 lines

new file mode 100644
index 0000000..575bc43

recipes-kernel/linux/linux-yocto/xen-guest.scc new file +4 -0
@@ -0,0 +1,4 @@
+define KFEATURE_DESCRIPTION "Xen PV Guest Support"
+define KFEATURE_COMPATIBILITY board
+
+kconf non-hardware xen-guest.cfg
(quoted diff) +0 -0

b/recipes-kernel/linux/linux-yocto_3.10.bbappend

recipes-kernel/linux/linux-yocto_3.10.bbappend KERNEL_FEATURES_append +=

Quoted 4 lines

index cc7fd98..a3165cd 100644

recipes-kernel/linux/linux-yocto_3.10.bbappend +0 -0
@@ -17,3 +17,6 @@ KERNEL_FEATURES_append +=

"${@base_contains('DISTRO_FEATURES', 'aufs', ' feature

recipes-kernel/linux/linux-yocto_3.10.bbappend KERNEL_FEATURES_append += · line 18

Quoted 3 lines
recipes-kernel/linux/linux-yocto_3.10.bbappend +0 -0
 # xen dom0 kernel support
 SRC_URI += "${@base_contains('DISTRO_FEATURES', 'xen', '

file://xen.scc', '', d)}"

recipes-kernel/linux/linux-yocto_3.10.bbappend KERNEL_FEATURES_append += "${@base_contains('DISTRO_FEATURES', 'aufs', ' feature

Quoted 3 lines
recipes-kernel/linux/linux-yocto_3.10.bbappend +3 -0
+
+# xen guest kernel support
+SRC_URI += "${@base_contains('DISTRO_FEATURES', 'xen-guest', '

file://xen-guest.scc', '', d)}"

Review

Quoted 1 line
(quoted diff) +0 -0

b/recipes-kernel/linux/linux-yocto_3.4.bbappend

recipes-kernel/linux/linux-yocto_3.4.bbappend module_autoload_kvm-intel = "kvm-intel" · line 16

Quoted 7 lines

index 448d57f..4d3a0d1 100644

recipes-kernel/linux/linux-yocto_3.4.bbappend +0 -0
@@ -14,3 +14,6 @@ module_autoload_kvm-intel = "kvm-intel"
 
 # xen dom0 kernel support
 SRC_URI += "${@base_contains('DISTRO_FEATURES', 'xen', '

file://xen.scc', '', d)}"

recipes-kernel/linux/linux-yocto_3.4.bbappend module_autoload_kvm-intel = "kvm-intel" · line 19

Quoted 3 lines
recipes-kernel/linux/linux-yocto_3.4.bbappend +3 -0
+
+# xen guest kernel support
+SRC_URI += "${@base_contains('DISTRO_FEATURES', 'xen-guest', '

file://xen-guest.scc', '', d)}"

Review

Quoted 1 line
(quoted diff) +0 -0

b/recipes-kernel/linux/linux-yocto_3.8.bbappend

recipes-kernel/linux/linux-yocto_3.8.bbappend KERNEL_FEATURES_append +=

Quoted 4 lines

index cc7fd98..a3165cd 100644

recipes-kernel/linux/linux-yocto_3.8.bbappend +0 -0
@@ -17,3 +17,6 @@ KERNEL_FEATURES_append +=

"${@base_contains('DISTRO_FEATURES', 'aufs', ' feature

recipes-kernel/linux/linux-yocto_3.8.bbappend KERNEL_FEATURES_append += · line 18

Quoted 3 lines
recipes-kernel/linux/linux-yocto_3.8.bbappend +0 -0
 # xen dom0 kernel support
 SRC_URI += "${@base_contains('DISTRO_FEATURES', 'xen', '

file://xen.scc', '', d)}"

recipes-kernel/linux/linux-yocto_3.8.bbappend KERNEL_FEATURES_append += · line 21

Quoted 3 lines
recipes-kernel/linux/linux-yocto_3.8.bbappend +3 -0
+
+# xen guest kernel support
+SRC_URI += "${@base_contains('DISTRO_FEATURES', 'xen-guest', '

file://xen-guest.scc', '', d)}"

Quoted 1 line