Skip to contentSkip to conversation

Xen 4.6 updates

PATCH In review Doug Goldstein 3 participants 11 messages Jan 26, 2016 – Feb 1, 2016

lore
Share & tools
lore
#0 lore raw

v2 cover Xen 4.6 updates

A number of updates for building Xen 4.6. This should be the last of the patches that I've been carrying locally for 4.6 (save for init script changes but those I'm trying to upstream).

change since v1:
- readd libgcc to xen-xl per Chris Patterson's testing
- add patches I forgot to submit in the first place
- squash in EXTRA_OEMAKE and do_install_append changes into xen.inc
- make sure xen_git is able to fetch

Doug Goldstein (8):
xen: update git version to 4.6.x
xen: drop explicit DEPEND on libgcc
xen: fix up typo in XSM comments
xen: separate the extra steps into their own tasks
xen: move bits common to all Xen versions to xen.inc
xen: merge do_install_append to do_install
xen: don't allow the build system to fetch
xen: don't inject -mfpmath=sse which causes build issues

 ...xen-x86-Fix-up-rules-when-forcing-mno-sse.patch | 28 ----------
 recipes-extended/xen/xen.inc                       | 59 ++++++++++++++++++++--
 recipes-extended/xen/xen_4.6.0.bb                  | 40 ---------------
 recipes-extended/xen/xen_git.bb                    |  8 +--
 4 files changed, 60 insertions(+), 75 deletions(-)
 delete mode 100644 recipes-extended/xen/files/xen-x86-Fix-up-rules-when-forcing-mno-sse.patch
Signature · 1 line
2.4.10
#1 lore raw

PATCH v2 1/8 xen: update git version to 4.6.x

Since xen.inc has been updated to support only Xen 4.6.x, the xen_git.bb should be updated to a revision in the 4.6.x stable series.

---
 recipes-extended/xen/xen_git.bb | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)
recipes-extended/xen/xen_git.bb +5 -3
index 88145a3..a86a501 100644
@@ -1,13 +1,15 @@
 require xen.inc
 
-SRCREV = "68bd172e6fa565899c846eb72755c8ffd8562c8a"
+SRCREV = "1fd615aa0108490ffc558d27627f509183cbfdaf"
 
-PV = "4.4.0+git${SRCPV}"
+XEN_REL="4.6"
+
+PV = "${XEN_REL}.0+git${SRCPV}"
 
 S = "${WORKDIR}/git"
 
 SRC_URI = " \
-    git://xenbits.xen.org/xen.git \
+    git://xenbits.xen.org/xen.git;branch=staging-${XEN_REL} \
     "
 
 DEFAULT_PREFERENCE = "-1"
Signature · 1 line
2.4.10
#2 lore raw

PATCH v2 2/8 xen: drop explicit DEPEND on libgcc

In reply to Doug Goldstein

'xen-base' is a meta package and itself should not depend on a library this. Yocto checks the NEEDED of the dynamic section and automatically includes those libraries as dependencies.

---
 recipes-extended/xen/xen.inc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
recipes-extended/xen/xen.inc +1 -1
index c63cb2c..966d356 100644
@@ -54,7 +54,7 @@ DEPENDS = " \
 RDEPENDS_${PN} = ""
 
 RDEPENDS_${PN}-base = "\
-    libgcc bash perl xz \
+    bash perl xz \
     ${PN}-blktap \
     ${PN}-console \
     ${PN}-libblktapctl \
Signature · 1 line
2.4.10
#3 lore raw

PATCH v2 3/8 xen: fix up typo in XSM comments

In reply to Doug Goldstein
---
 recipes-extended/xen/xen.inc | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
recipes-extended/xen/xen.inc +2 -2
index 966d356..789fd34 100644
@@ -722,7 +722,7 @@ EXTRA_OECONF += " \
     --disable-ocamltools \
     "
 
-# check for XSM in package config to allow XSM_ENABLE to be set 
+# check for XSM in package config to allow XSM_ENABLE to be set
 python () {
     pkgconfig = d.getVar('PACKAGECONFIG', True)
     if ('xsm') in pkgconfig.split():
@@ -743,7 +743,7 @@ do_configure() {
         fi
     fi
 
-    #./configure --enable-xsm does not set XSM_ENABLE must be done manually
+    #./configure --enable-xsmpolicy does not set XSM_ENABLE must be done manually
     if [ "${XSM_ENABLED}" = "1" ]; then
         echo "XSM_ENABLE := y" > ${S}/.config
     fi
Signature · 1 line
2.4.10
#4 lore raw

PATCH v2 4/8 xen: separate the extra steps into their own tasks

In reply to Doug Goldstein

do_configure() was overloaded with a lot of behaviors that really were source code patching so instead make them as extra tasks that happen after do_patch() and before do_configure().

---
 recipes-extended/xen/xen.inc      | 21 ++++++++++++++++++++-
 recipes-extended/xen/xen_4.6.0.bb | 12 ------------
 2 files changed, 20 insertions(+), 13 deletions(-)
recipes-extended/xen/xen.inc +20 -1
index 789fd34..86508ff 100644
@@ -731,7 +731,21 @@ python () {
         d.setVar('XSM_ENABLED', '0')
 }
 
-do_configure() {
+do_post_patch() {
+    # fixup AS/CC/CCP/etc variable within StdGNU.mk
+    for i in LD CC CPP CXX; do
+        sed -i "s/^\($i\s\s*\).*=/\1?=/" ${S}/config/StdGNU.mk
+    done
+    # fixup environment passing in some makefiles
+    sed -i 's#\(\w*\)=\(\$.\w*.\)#\1="\2"#' ${S}/tools/firmware/Makefile
+
+    # libsystemd-daemon -> libsystemd for newer systemd versions
+    sed -i 's#libsystemd-daemon#libsystemd#' ${S}/tools/configure
+}
+
+addtask post_patch after do_patch before do_configure
+
+do_stubs() {
     # no stubs-32.h in our 64-bit sysroot - hack it into tools/include/gnu
     if ! test -f ${STAGING_DIR_TARGET}/usr/include/gnu/stubs-32.h ; then
         if test -f ${STAGING_DIR_TARGET}/usr/include/gnu/stubs-64.h ; then
@@ -742,6 +756,11 @@ do_configure() {
             echo \#define __stub___kernel_tanl >> ${S}/tools/include/gnu/stubs-32.h
         fi
     fi
+}
+
+addtask stubs after do_patch before do_configure
+
+do_configure() {
 
     #./configure --enable-xsmpolicy does not set XSM_ENABLE must be done manually
     if [ "${XSM_ENABLED}" = "1" ]; then
recipes-extended/xen/xen_4.6.0.bb +0 -12
index 92975a0..95570a7 100644
@@ -27,18 +27,6 @@ EXTRA_OEMAKE += "SEABIOS_ROM=${STAGING_DIR_HOST}/usr/share/firmware/bios.bin"
 EXTRA_OEMAKE += "ETHERBOOT_ROMS=${STAGING_DIR_HOST}/usr/share/firmware/rtl8139.rom"
 #EXTRA_OEMAKE += "XENGFX_ROM=${STAGING_DIR_HOST}/usr/share/firmware/vgabios.bin"
 
-do_configure_prepend() {
-    # fixup AS/CC/CCP/etc variable within StdGNU.mk
-    for i in LD CC CPP CXX; do
-        sed -i "s/^\($i\s\s*\).*=/\1?=/" ${S}/config/StdGNU.mk
-    done
-    # fixup environment passing in some makefiles
-    sed -i 's#\(\w*\)=\(\$.\w*.\)#\1="\2"#' ${S}/tools/firmware/Makefile
-
-    # libsystemd-daemon -> libsystemd for newer systemd versions
-    sed -i 's#libsystemd-daemon#libsystemd#' ${S}/tools/configure
-}
-
 do_install_append() {
     # fixup default path to qemu-system-i386
     sed -i 's#\(test -z "$QEMU_XEN" && QEMU_XEN=\).*$#\1"/usr/bin/qemu-system-i386"#' ${D}/etc/init.d/xencommons
Signature · 1 line
2.4.10
#5 lore raw

PATCH v2 5/8 xen: move bits common to all Xen versions to xen.inc

In reply to Doug Goldstein

These items are common for all Xen versions since at least 4.5 and newer so these should just go in the common include file.

---
 recipes-extended/xen/xen.inc      | 14 ++++++++++++++
 recipes-extended/xen/xen_4.6.0.bb | 17 -----------------
 2 files changed, 14 insertions(+), 17 deletions(-)
recipes-extended/xen/xen.inc +14 -0
index 86508ff..a46421b 100644
@@ -693,6 +693,11 @@ python () {
         raise bb.parse.SkipPackage('Cannot map `%s` to a xen architecture' % d.getVar('TARGET_ARCH', True))
 }
 
+# Yocto appends ${PN} to libexecdir by default and Xen appends 'xen' as well
+# the result is a nested xen/xen/ so let's avoid that by shunning Yocto's
+# extra ${PN} appended.
+libexecdir = "${libdir}"
+
 # hardcoded as Linux, as the only compatible hosts are Linux.
 export XEN_OS = "Linux"
 
@@ -720,8 +725,17 @@ EXTRA_OECONF += " \
     --disable-xenstore-stubdom \
     --disable-rombios \
     --disable-ocamltools \
+    --with-initddir=${INIT_D_DIR} \
+    --with-sysconfig-leaf-dir=default \
+    --with-system-qemu=/usr/bin/qemu-system-i386 \
+    --disable-qemu-traditional \
     "
 
+EXTRA_OEMAKE += "STDVGA_ROM=${STAGING_DIR_HOST}/usr/share/firmware/vgabios-0.7a.bin"
+EXTRA_OEMAKE += "CIRRUSVGA_ROM=${STAGING_DIR_HOST}/usr/share/firmware/vgabios-0.7a.cirrus.bin"
+EXTRA_OEMAKE += "SEABIOS_ROM=${STAGING_DIR_HOST}/usr/share/firmware/bios.bin"
+EXTRA_OEMAKE += "ETHERBOOT_ROMS=${STAGING_DIR_HOST}/usr/share/firmware/rtl8139.rom"
+
 # check for XSM in package config to allow XSM_ENABLE to be set
 python () {
     pkgconfig = d.getVar('PACKAGECONFIG', True)
recipes-extended/xen/xen_4.6.0.bb +0 -17
index 95570a7..93c6d2e 100644
@@ -10,23 +10,6 @@ SRC_URI[sha256sum] = "6fa1c2431df55aa5950d248e6093b8c8c0f11c357a0adbd348a2186478
 
 S = "${WORKDIR}/xen-${PV}"
 
-# Xen suffixes the libexecdir within its configure scripts, prevent the nested xen/xen/
-libexecdir = "${libdir}"
-
-# These options override detected values from the build.
-EXTRA_OECONF_append += " \
-    --with-initddir=${INIT_D_DIR} \
-    --with-sysconfig-leaf-dir=default \
-    --with-system-qemu=/usr/bin/qemu-system-i386 \
-    --disable-qemu-traditional \
-    "
-
-EXTRA_OEMAKE += "STDVGA_ROM=${STAGING_DIR_HOST}/usr/share/firmware/vgabios-0.7a.bin"
-EXTRA_OEMAKE += "CIRRUSVGA_ROM=${STAGING_DIR_HOST}/usr/share/firmware/vgabios-0.7a.cirrus.bin"
-EXTRA_OEMAKE += "SEABIOS_ROM=${STAGING_DIR_HOST}/usr/share/firmware/bios.bin"
-EXTRA_OEMAKE += "ETHERBOOT_ROMS=${STAGING_DIR_HOST}/usr/share/firmware/rtl8139.rom"
-#EXTRA_OEMAKE += "XENGFX_ROM=${STAGING_DIR_HOST}/usr/share/firmware/vgabios.bin"
-
 do_install_append() {
     # fixup default path to qemu-system-i386
     sed -i 's#\(test -z "$QEMU_XEN" && QEMU_XEN=\).*$#\1"/usr/bin/qemu-system-i386"#' ${D}/etc/init.d/xencommons
Signature · 1 line
2.4.10
#6 lore raw

PATCH v2 6/8 xen: merge do_install_append to do_install

In reply to Doug Goldstein

The do_install_append is necessary for the git build as well so just merge that into the main include.

---
 recipes-extended/xen/xen.inc      |  8 ++++++++
 recipes-extended/xen/xen_4.6.0.bb | 10 ----------
 2 files changed, 8 insertions(+), 10 deletions(-)
recipes-extended/xen/xen.inc +8 -0
index a46421b..beb255c 100644
@@ -828,6 +828,14 @@ do_install() {
             echo "d $i 0755 root root - -"  >> ${D}${sysconfdir}/tmpfiles.d/xen.conf
         done
     fi
+
+    # fixup default path to qemu-system-i386
+    sed -i 's#\(test -z "$QEMU_XEN" && QEMU_XEN=\).*$#\1"/usr/bin/qemu-system-i386"#' ${D}/etc/init.d/xencommons
+
+    if [ -e ${D}${systemd_unitdir}/system/xen-qemu-dom0-disk-backend.service ]; then
+        sed -i 's#ExecStart=.*qemu-system-i386\(.*\)$#ExecStart=/usr/bin/qemu-system-i386\1#' \
+            ${D}${systemd_unitdir}/system/xen-qemu-dom0-disk-backend.service
+    fi
 }
 
 pkg_postinst_${PN}-volatiles() {
recipes-extended/xen/xen_4.6.0.bb +0 -10
index 93c6d2e..0391dbd 100644
@@ -9,13 +9,3 @@ SRC_URI[md5sum] = "48e232f90927c08326a7b52bb06f49bc"
 SRC_URI[sha256sum] = "6fa1c2431df55aa5950d248e6093b8c8c0f11c357a0adbd348a2186478e80909"
 
 S = "${WORKDIR}/xen-${PV}"
-
-do_install_append() {
-    # fixup default path to qemu-system-i386
-    sed -i 's#\(test -z "$QEMU_XEN" && QEMU_XEN=\).*$#\1"/usr/bin/qemu-system-i386"#' ${D}/etc/init.d/xencommons
-
-    if [ -e ${D}${systemd_unitdir}/system/xen-qemu-dom0-disk-backend.service ]; then
-        sed -i 's#ExecStart=.*qemu-system-i386\(.*\)$#ExecStart=/usr/bin/qemu-system-i386\1#' \
-            ${D}${systemd_unitdir}/system/xen-qemu-dom0-disk-backend.service
-    fi
-}
Signature · 1 line
2.4.10
#7 lore raw

PATCH v2 7/8 xen: don't allow the build system to fetch

In reply to Doug Goldstein

All dependencies should be reflected in the Yocto dependency and the Xen build system should not go off fetching things on its own.

---
 recipes-extended/xen/xen.inc | 5 +++++
 1 file changed, 5 insertions(+)
recipes-extended/xen/xen.inc +5 -0
index beb255c..f937b05 100644
@@ -736,6 +736,11 @@ EXTRA_OEMAKE += "CIRRUSVGA_ROM=${STAGING_DIR_HOST}/usr/share/firmware/vgabios-0.
 EXTRA_OEMAKE += "SEABIOS_ROM=${STAGING_DIR_HOST}/usr/share/firmware/bios.bin"
 EXTRA_OEMAKE += "ETHERBOOT_ROMS=${STAGING_DIR_HOST}/usr/share/firmware/rtl8139.rom"
 
+# prevent the Xen build scripts from fetching things during the build
+# all dependencies should be reflected in the Yocto recipe
+EXTRA_OEMAKE += "WGET=/bin/false"
+EXTRA_OEMAKE += "GIT=/bin/false"
+
 # check for XSM in package config to allow XSM_ENABLE to be set
 python () {
     pkgconfig = d.getVar('PACKAGECONFIG', True)
Signature · 1 line
2.4.10
#8 lore raw

PATCH v2 8/8 xen: don't inject -mfpmath=sse which causes build issues

In reply to Doug Goldstein

Don't inject -mfpmath=sse into the build which causes issues with the hypervisor build.

---
 ...xen-x86-Fix-up-rules-when-forcing-mno-sse.patch | 28 ----------------------
 recipes-extended/xen/xen.inc                       |  5 ++++
 recipes-extended/xen/xen_4.6.0.bb                  |  1 -
 3 files changed, 5 insertions(+), 29 deletions(-)
 delete mode 100644 recipes-extended/xen/files/xen-x86-Fix-up-rules-when-forcing-mno-sse.patch
recipes-extended/xen/files/xen-x86-Fix-up-rules-when-forcing-mno-sse.patch deleted +0 -28
deleted file mode 100644
index 4c3e297..0000000
@@ -1,28 +0,0 @@
-From: Nathan Rossi <[email protected]>
-Subject: [PATCH] xen/x86: Fix up rules when forcing -mno-sse
-
-* When forcing -mno-sse specify -mfpmath=387 to avoid the fallback
-  warning
-
-Signed-off-by: Nathan Rossi <[email protected]>
-Upstream-Status: Not-Submitted
----
- xen/arch/x86/Rules.mk | 2 +-
- 1 file changed, 1 insertion(+), 1 deletion(-)
-
-diff --git a/xen/arch/x86/Rules.mk b/xen/arch/x86/Rules.mk
-index 6775cb5..03848f7 100644
---- a/xen/arch/x86/Rules.mk
-+++ b/xen/arch/x86/Rules.mk
-@@ -42,7 +42,7 @@ x86 := y
- x86_32 := n
- x86_64 := y
- 
--CFLAGS += -mno-red-zone -mno-sse -fpic
-+CFLAGS += -mno-red-zone -mno-sse -fpic -mfpmath=387
- CFLAGS += -fno-asynchronous-unwind-tables
- # -fvisibility=hidden reduces -fpic cost, if it's available
- ifneq ($(call cc-option,$(CC),-fvisibility=hidden,n),n)
--- 
-2.1.1
-
recipes-extended/xen/xen.inc +5 -0
index f937b05..5555ed3 100644
@@ -713,6 +713,11 @@ export CROSS_COMPILE="${TARGET_PREFIX}"
 # overide LDFLAGS to allow xen to build without: "x86_64-oe-linux-ld: unrecognized option '-Wl,-O1'"
 export LDFLAGS=""
 
+# Yocto injects -mfpmath=sse for some machine types into the CFLAGS which
+# conflicts with -mno-sse so instead we strip -mfpmath=sse instead of
+# patching the build to be ok with this
+TUNE_CCARGS := "${@oe_filter_out('-mfpmath=sse', '${TUNE_CCARGS}', d)}"
+
 EXTRA_OECONF += " \
     --exec-prefix=/usr \
     --prefix=/usr \
recipes-extended/xen/xen_4.6.0.bb +0 -1
index 0391dbd..41241cd 100644
@@ -2,7 +2,6 @@ require xen.inc
 
 SRC_URI = " \
     http://bits.xensource.com/oss-xen/release/${PV}/xen-${PV}.tar.gz \
-    file://xen-x86-Fix-up-rules-when-forcing-mno-sse.patch \
     "
 
 SRC_URI[md5sum] = "48e232f90927c08326a7b52bb06f49bc"
Signature · 1 line
2.4.10
#9 lore raw
In reply to Doug Goldstein

Ran a quick test of the series, LGTM. +1

Quoted 35 lines · Doug Goldstein

A number of updates for building Xen 4.6. This should be the last of the patches that I've been carrying locally for 4.6 (save for init script changes but those I'm trying to upstream).

change since v1:
- readd libgcc to xen-xl per Chris Patterson's testing
- add patches I forgot to submit in the first place
- squash in EXTRA_OEMAKE and do_install_append changes into xen.inc
- make sure xen_git is able to fetch

Doug Goldstein (8):
xen: update git version to 4.6.x
xen: drop explicit DEPEND on libgcc
xen: fix up typo in XSM comments
xen: separate the extra steps into their own tasks
xen: move bits common to all Xen versions to xen.inc
xen: merge do_install_append to do_install
xen: don't allow the build system to fetch
xen: don't inject -mfpmath=sse which causes build issues

 ...xen-x86-Fix-up-rules-when-forcing-mno-sse.patch | 28 ----------
 recipes-extended/xen/xen.inc                       | 59 ++++++++++++++++++++--
 recipes-extended/xen/xen_4.6.0.bb                  | 40 ---------------
 recipes-extended/xen/xen_git.bb                    |  8 +--
 4 files changed, 60 insertions(+), 75 deletions(-)
 delete mode 100644 recipes-extended/xen/files/xen-x86-Fix-up-rules-when-forcing-mno-sse.patch

--
2.4.10

--
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

#10 lore raw
In reply to Doug Goldstein

I've merged this to master. Stay tuned for the jethro version.

Bruce

Quoted 38 lines · Doug Goldstein

A number of updates for building Xen 4.6. This should be the last of the patches that I've been carrying locally for 4.6 (save for init script changes but those I'm trying to upstream).

change since v1:
- readd libgcc to xen-xl per Chris Patterson's testing
- add patches I forgot to submit in the first place
- squash in EXTRA_OEMAKE and do_install_append changes into xen.inc
- make sure xen_git is able to fetch

Doug Goldstein (8):
xen: update git version to 4.6.x
xen: drop explicit DEPEND on libgcc
xen: fix up typo in XSM comments
xen: separate the extra steps into their own tasks
xen: move bits common to all Xen versions to xen.inc
xen: merge do_install_append to do_install
xen: don't allow the build system to fetch
xen: don't inject -mfpmath=sse which causes build issues

 ...xen-x86-Fix-up-rules-when-forcing-mno-sse.patch | 28 ----------
 recipes-extended/xen/xen.inc                       | 59
++++++++++++++++++++--
 recipes-extended/xen/xen_4.6.0.bb                  | 40 ---------------
 recipes-extended/xen/xen_git.bb                    |  8 +--
 4 files changed, 60 insertions(+), 75 deletions(-)
 delete mode 100644

recipes-extended/xen/files/xen-x86-Fix-up-rules-when-forcing-mno-sse.patch

--
2.4.10

--
_______________________________________________
meta-virtualization mailing list
[email protected]
https://lists.yoctoproject.org/listinfo/meta-virtualization

Signature · 2 lines
"Thou shalt not follow the NULL pointer, for chaos and madness await thee
at its end"