Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 1 addition & 8 deletions conf/machine/xenclient-common.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,6 @@
# Tune for Core 2 CPU
require conf/machine/include/tune-core2.inc

# GHC6 does not honor 16 byte stack alignment which end up throwing a
# protection fault in upgrade-db while calling ldexp from the libc.
# This did not crash in jethro using GCC 5.2 for some reason, in all likelihood
# something forced realignment of the stack on 16 bytes. Lets now politely ask
# GCC to do that again until someone upgrades GHC6 or replace Haskell
# components.
# The trade off with -mstackrealign should be less than disabling SSE.
TUNE_CCARGS += "-mstackrealign"
TUNE_CCARGS_remove += "-mstackrealign"
Copy link
Contributor

@eric-ch eric-ch Mar 14, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Patch churn.
EDIT: Misread...

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is "-mstackrealign" in TUNE_CCARGS such that we need to remove, or should TUNE_CCARGS and comment be deleted?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I felt leaving this in was a defensive choice. Grepping over the layers shows that no recipes are setting mstackrealign, but it's possible one might in the future for some unknown reason.

If you think that's low enough risk we should be able to drop it altogether.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems unlikely. But, if you want to be defensive, you should update the comment to make it clear why it is present. It would be nice if bitbake/oe has a "build-time assert" for checking something like this.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems more likely that different alignment would be enforced using -mpreferred-stack-boundary. -mstackrealign will just allow mixing legacy code (4-byte aligned stack) with modern ones (16-bytes). Unless GHC is doing something funny, -mstackrealign in 64bit most likely has no effect?

Newer GHC versions probably have force_align_arg_pointer for unaligned stack calling to libc functions, if such things are still around.


KERNEL_IMAGETYPE = "bzImage"
2 changes: 2 additions & 0 deletions conf/machine/xenclient-dom0.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,5 @@ MACHINE_FEATURES = "kernel26 screen keyboard ethernet pci usbhost acpi ext2 x86"

SERIAL_CONSOLE = "115200 hvc0"

TARGET_ARCH="x86_64"
DEFAULTTUNE="core2-64"
3 changes: 3 additions & 0 deletions conf/machine/xenclient-ndvm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,6 @@ MACHINE_FEATURES = "kernel26 ethernet pci ext2 x86"
KERNEL_CMDLINE = "root=/dev/xvda2 ro console=hvc0 iommu=soft"

USE_VT = "0"

TARGET_ARCH="x86_64"
DEFAULTTUNE="core2-64"
3 changes: 3 additions & 0 deletions conf/machine/xenclient-stubdomain.conf
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
#@NAME: xenclient-stubdomain
#@DESCRIPTION: Machine configuration for XenClient stubdomain VM

TARGET_ARCH="x86_64"
DEFAULTTUNE="core2-64"

require xenclient-common.conf

MACHINE_FEATURES = "kernel26 screen keyboard ethernet pci acpi ext2 x86"
Expand Down
3 changes: 3 additions & 0 deletions conf/machine/xenclient-syncvm.conf
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
require xenclient-common.conf

MACHINE_FEATURES = "kernel26 pci acpi ext2 x86"

TARGET_ARCH = "x86_64"
DEFAULTTUNE="core2-64"
3 changes: 3 additions & 0 deletions conf/machine/xenclient-uivm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -9,3 +9,6 @@ require xenclient-common.conf
MACHINE_FEATURES = "kernel26 screen keyboard ethernet pci acpi ext2 x86"

USE_VT = "0"

TARGET_ARCH="x86_64"
DEFAULTTUNE="core2-64"
Binary file added recipes-bsp/pciutils/files/pci.ids.gz.20180615
Binary file not shown.
13 changes: 13 additions & 0 deletions recipes-bsp/pciutils/pciutils_3.5.2.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
PR .= ".1"

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

SRC_URI += "file://pci.ids.gz.20180615 \
"

do_install_append () {
# "make install" misses the debug file for the library
oe_libinstall -so -C lib libpci ${D}/${libdir}

install -m 0644 ${WORKDIR}/pci.ids.gz.20180615 ${D}/${datadir}/pci.ids.gz
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
--- a/src/ap-menu-item.c 2011-10-21 02:15:24.000000000 -0400
+++ b/src/ap-menu-item.c 2018-12-27 15:41:34.135068677 -0500
@@ -189,7 +189,7 @@
g_object_unref (pixbuf);
}

-const const char *
+const char *
nm_network_menu_item_get_hash (NMNetworkMenuItem * item)
{
g_return_val_if_fail (item != NULL, NULL);
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ SRC_URI += " \
file://default-certs-dir.patch \
file://always-use-psk-hash.patch \
file://disable-show-password.patch \
file://remove-extra-const.patch \
"
SRC_URI[archive.md5sum] = "feaf2c8427d23924dde7de52ff4c5078"
SRC_URI[archive.sha256sum] = "287301692224cc1bb20abe8bc52140461f565e58898a99daef11a188bb29b362"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
Index: NetworkManager-0.9.2.0/src/nm-netlink-monitor.c
===================================================================
--- NetworkManager-0.9.2.0.orig/src/nm-netlink-monitor.c
+++ NetworkManager-0.9.2.0/src/nm-netlink-monitor.c
@@ -248,7 +248,7 @@ nlh_setup (struct nl_sock *nlh,
{
int err;

- nl_socket_modify_cb (nlh, NL_CB_MSG_IN, NL_CB_CUSTOM, event_msg_recv, cb_data);
+ nl_socket_modify_cb (nlh, NL_CB_MSG_IN, NL_CB_CUSTOM, event_msg_recv, nlh);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Candidate for backport if NetworkManager is not upgraded before, this is a lingering segfault in 32bit as well.


if (valid_func)
nl_socket_modify_cb (nlh, NL_CB_VALID, NL_CB_CUSTOM, valid_func, cb_data);
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ SRC_URI += " \
file://auto-activate-connections.patch \
file://linux3-compile.patch \
file://remove-libgcrypt.patch \
file://use-correct-data-in-nl-cb.patch \
file://gtk-doc.make \
file://NetworkManager.conf \
file://ac-wireless \
Expand Down
5 changes: 5 additions & 0 deletions recipes-core/base-files/files/xenclient-dom0/fstab
Original file line number Diff line number Diff line change
Expand Up @@ -39,3 +39,8 @@ ramfs /mnt/secure ramfs context=syste
/dev/mapper/xenclient-boot /boot/system ext4 errors=remount-ro,noatime 1 4
/dev/mapper/xenclient-storage /storage ext4 errors=remount-ro,user_xattr,noatime 1 5
/dev/mapper/swap none swap sw 0 0

# OpenXT: The following mount will fail on non-UEFI installs.
# For some reason, at boot time, that usually results in the rest of this file getting ignored.
# Having it be the last one makes it a non-issue.
efivarfs /sys/firmware/efi/efivars efivarfs ro,nosuid,nodev,noexec,noatime 0 0
2 changes: 1 addition & 1 deletion recipes-core/images/xenclient-uivm-image.bb
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ XSERVER = " \

IMAGE_INSTALL = "\
${ROOTFS_PKGMANAGE} \
packagegroup-core-x11-xserver \
${XSERVER} \
modules \
packagegroup-xenclient-common \
packagegroup-xenclient-xfce-minimal \
Expand Down
1 change: 1 addition & 0 deletions recipes-extended/libtirpc/libtirpc_%.bbappend
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
CFLAGS += "-fPIC"
2 changes: 1 addition & 1 deletion recipes-extended/qemu-dm/qemu-dm/acpi-pm-feature.patch
Original file line number Diff line number Diff line change
Expand Up @@ -675,7 +675,7 @@ PATCHES
+ break;
+ }
+ default:
+ XBM_ERROR_MSG("unknown cmd: %llu", val);
+ XBM_ERROR_MSG("unknown cmd: %lu", val);
+ break;
+ }
+
Expand Down
14 changes: 14 additions & 0 deletions recipes-extended/xen/files/add-xc-hypercall-page.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
--- a/xen/arch/x86/guest/hypercall_page.S 2018-11-12 14:51:49.920565676 -0500
+++ b/xen/arch/x86/guest/hypercall_page.S 2018-11-12 14:52:39.357054001 -0500
@@ -59,8 +59,10 @@
DECLARE_HYPERCALL(domctl)
DECLARE_HYPERCALL(kexec_op)
DECLARE_HYPERCALL(tmem_op)
-DECLARE_HYPERCALL(xc_reserved_op)
+DECLARE_HYPERCALL(v4v_op)
DECLARE_HYPERCALL(xenpmu_op)
+DECLARE_HYPERCALL(dm_op)
+DECLARE_HYPERCALL(txt_op)

DECLARE_HYPERCALL(arch_0)
DECLARE_HYPERCALL(arch_1)
18 changes: 13 additions & 5 deletions recipes-extended/xen/files/tboot-xen-evtlog-support.patch
Original file line number Diff line number Diff line change
Expand Up @@ -98,31 +98,37 @@ PATCHES
+ */
--- a/xen/arch/x86/hvm/hypercall.c
+++ b/xen/arch/x86/hvm/hypercall.c
@@ -139,6 +139,7 @@ static const hypercall_table_t hvm_hyper
@@ -139,6 +139,9 @@ static const hypercall_table_t hvm_hyper
COMPAT_CALL(mmuext_op),
HYPERCALL(xenpmu_op),
COMPAT_CALL(dm_op),
+#ifdef CONFIG_TXT_OP
+ HYPERCALL(txt_op),
+#endif
HYPERCALL(arch_1)
};

--- a/xen/arch/x86/hypercall.c
+++ b/xen/arch/x86/hypercall.c
@@ -68,6 +68,7 @@ const hypercall_args_t hypercall_args_ta
@@ -68,6 +68,9 @@ const hypercall_args_t hypercall_args_ta
ARGS(v4v_op, 6),
ARGS(xenpmu_op, 2),
ARGS(dm_op, 3),
+#ifdef CONFIG_TXT_OP
+ ARGS(txt_op, 3),
+#endif
ARGS(mca, 1),
ARGS(arch_1, 1),
};
--- a/xen/arch/x86/pv/hypercall.c
+++ b/xen/arch/x86/pv/hypercall.c
@@ -81,6 +81,7 @@ const hypercall_table_t pv_hypercall_tab
@@ -81,6 +81,9 @@ const hypercall_table_t pv_hypercall_tab
HYPERCALL(v4v_op),
HYPERCALL(xenpmu_op),
COMPAT_CALL(dm_op),
+#ifdef CONFIG_TXT_OP
+ HYPERCALL(txt_op),
+#endif
HYPERCALL(mca),
HYPERCALL(arch_1),
};
Expand Down Expand Up @@ -235,13 +241,15 @@ PATCHES
#define __HYPERVISOR_arch_0 48
--- a/xen/include/xen/hypercall.h
+++ b/xen/include/xen/hypercall.h
@@ -148,6 +148,9 @@ do_dm_op(
@@ -148,6 +148,11 @@ do_dm_op(
unsigned int nr_bufs,
XEN_GUEST_HANDLE_PARAM(xen_dm_op_buf_t) bufs);


+#ifdef CONFIG_TXT_OP
+extern long
+do_txt_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) arg);
+
+#endif
#ifdef CONFIG_COMPAT

extern int
11 changes: 10 additions & 1 deletion recipes-extended/xen/xen-common.inc
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
LIC_FILES_CHKSUM := "file://COPYING;md5=bbb4b1bdc2c3b6743da3c39d03249095"

require xen-version.inc

PV = "${XEN_PV}"
Expand Down Expand Up @@ -51,6 +50,7 @@ SRC_URI_append = " \
file://tboot-xen-evtlog-support.patch \
file://disable-cpuid-hle-rtm.patch \
file://allow-stubdoms-cacheattr-control.patch \
file://add-xc-hypercall-page.patch \
file://libxl-do-not-destroy-in-use-tapdevs.patch \
file://libxl-syslog.patch \
file://libxl-RFC-4of7-Add-stubdomain-version-tools-domain-build-info.patch \
Expand Down Expand Up @@ -104,6 +104,8 @@ PACKAGECONFIG =+ "hvm"

S = "${WORKDIR}/git"

TUNE_CCARGS := "${@oe.utils.str_filter_out('-msse3', '${TUNE_CCARGS}', d)}"

#--
# Override meta-virtualization's path to seabios and add ovmf:
PACKAGECONFIG[hvm] = "--with-system-seabios="/usr/share/firmware/bios.bin" --with-system-ovmf="/usr/share/firmware/ovmf.bin",--disable-seabios,seabios ipxe vgabios ovmf,"
Expand All @@ -116,4 +118,11 @@ PACKAGECONFIG[hvm] = "--with-system-seabios="/usr/share/firmware/bios.bin" --wit

deltask stubs
deltask deploy

do_configure_append() {
if [ ! -e ${STAGING_INCDIR}/bits/long-double-32.h ]; then
cp ${STAGING_INCDIR}/bits/long-double-64.h ${STAGING_INCDIR}/bits/long-double-32.h
cp ${STAGING_INCDIR}/gnu/stubs-64.h ${STAGING_INCDIR}/gnu/stubs-32.h
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These headers will likely differ and renaming the 64 one to 32 will likely cause issues.
Why is that necessary though? I would expect DISTRO_FEATURES with multiarch to not require that.

The meta-virtualization recipe doesn't do that either.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

openembedded-core does for the gnu-efi recipe, just in the opposite direction. It was also proposed for meta-virt in: https://lists.yoctoproject.org/pipermail/meta-virtualization/2017-August/002719.html though I don't know what became of the PR.

long-double-64.h is actually empty, and stubs-64.h is pretty minimal. multiarch seems to do nothing if a single recipe builds 64 and 32 bit targets.

fi
}
#--
4 changes: 4 additions & 0 deletions recipes-extended/xen/xen-hypervisor.bb
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,10 @@ do_configure() {
echo "FLASK_ENABLE := y" >> .config

cp "${WORKDIR}/defconfig" "${B}/xen/.config"
#Define CONFIG_TXT_OP in the hypervisor build to export tboot evtlog data
#It's stubbed out for the pv-shim since it's not supported, but uses the
#same hypercall headers
echo "CONFIG_TXT_OP=y" >> "${B}/xen/.config"

# do configure
oe_runconf
Expand Down
39 changes: 27 additions & 12 deletions recipes-extended/xen/xen.bb
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ require xen-common.inc

FILESEXTRAPATHS_prepend := "${THISDIR}/files:"

XEN_TARGET_ARCH = "x86_64"

SRC_URI_append = "\
file://xenconsoled.initscript \
file://xenstored.initscript \
Expand All @@ -13,6 +15,7 @@ PACKAGES += " \
${PN}-xenstored-c \
${PN}-libxentoolcore \
${PN}-libxentoolcore-dev \
${PN}-xen-shim \
"

PACKAGES_remove = " \
Expand All @@ -39,6 +42,11 @@ PACKAGES_remove = " \
PROVIDES =+ "${PN}-toolstack-headers"
PROVIDES_${PN}-toolstack-headers = "${PN}-toolstack-headers"

PROVIDES =+ "${PN}-xen-shim"
PROVIDES_${PN}-xen-shim = "${PN}-xen-shim"

INSANE_SKIP_${PN}-xen-shim = "arch"

# OpenXT packages both the C and OCaml versions of XenStored.
# This recipe packages the C daemon; xen-libxl packages the Ocaml one.
PROVIDES =+ "xen-xenstored-c"
Expand Down Expand Up @@ -72,6 +80,11 @@ FILES_${PN}-libxentoolcore-dev = " \
${libdir}/libxentoolcore.so \
${datadir}/pkgconfig/xentoolcore.pc \
"

FILES_${PN}-xen-shim = "\
${libdir}/xen/boot/xen-shim \
"

INITSCRIPT_PACKAGES =+ "${PN}-console ${PN}-xenstored-c"
INITSCRIPT_NAME_${PN}-console = "xenconsoled"
INITSCRIPT_PARAMS_${PN}-console = "defaults 20"
Expand All @@ -94,22 +107,24 @@ pkg_prerm_${PN}-xenstored-c () {
}

do_compile() {
oe_runmake -C tools subdir-all-include
oe_runmake -C tools subdir-all-libs
oe_runmake -C tools subdir-all-libxc
oe_runmake -C tools subdir-all-flask
oe_runmake -C tools subdir-all-xenstore
oe_runmake -C tools subdir-all-misc
oe_runmake -C tools subdir-all-hotplug
oe_runmake -C tools subdir-all-xentrace
oe_runmake -C tools subdir-all-xenmon
oe_runmake -C tools subdir-all-console
oe_runmake -C tools subdir-all-xenstat
unset CFLAGS

oe_runmake CXX=/bin/false -C tools subdir-all-include
oe_runmake CXX=/bin/false -C tools subdir-all-libs
oe_runmake CXX=/bin/false -C tools subdir-all-libxc
oe_runmake CXX=/bin/false -C tools subdir-all-flask
oe_runmake CXX=/bin/false -C tools subdir-all-xenstore
oe_runmake CXX=/bin/false -C tools subdir-all-misc
oe_runmake CXX=/bin/false -C tools subdir-all-hotplug
oe_runmake CXX=/bin/false -C tools subdir-all-xentrace
oe_runmake CXX=/bin/false -C tools subdir-all-xenmon
oe_runmake CXX=/bin/false -C tools subdir-all-console
oe_runmake CXX=/bin/false -C tools subdir-all-xenstat
# tools/firmware/Rules.mk: override XEN_TARGET_ARCH = x86_32
# With a 32bit host targeting a 64bit machine, this will break passing -m32
# -m64 and using the 64bit sysroot.
if [ "${XEN_TARGET_ARCH}" = "${XEN_COMPILE_ARCH}" ]; then
oe_runmake -C tools subdir-all-firmware
oe_runmake CXX=/bin/false -C tools subdir-all-firmware
fi
}

Expand Down
18 changes: 11 additions & 7 deletions recipes-kernel/linux/4.14/defconfigs/xenclient-dom0/defconfig
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,24 @@
# Linux/x86 4.14.63 Kernel Configuration
#
# CONFIG_64BIT is not set
CONFIG_X86_32=y
CONFIG_64BIT=y
CONFIG_X86_64=y
CONFIG_X86=y
CONFIG_INSTRUCTION_DECODER=y
CONFIG_OUTPUT_FORMAT="elf32-i386"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/i386_defconfig"
CONFIG_OUTPUT_FORMAT="elf64-x86-64"
CONFIG_ARCH_DEFCONFIG="arch/x86/configs/x86_64_defconfig"
CONFIG_LOCKDEP_SUPPORT=y
CONFIG_STACKTRACE_SUPPORT=y
CONFIG_MMU=y
CONFIG_ARCH_MMAP_RND_BITS_MIN=8
CONFIG_ARCH_MMAP_RND_BITS_MAX=16
CONFIG_ARCH_MMAP_RND_BITS_MIN=28
CONFIG_ARCH_MMAP_RND_BITS_MAX=32
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MIN=8
CONFIG_ARCH_MMAP_RND_COMPAT_BITS_MAX=16
CONFIG_NEED_DMA_MAP_STATE=y
CONFIG_NEED_SG_DMA_LENGTH=y
CONFIG_GENERIC_ISA_DMA=y
CONFIG_GENERIC_BUG=y
CONFIG_GENERIC_BUG_RELATIVE_POINTERS=y
CONFIG_GENERIC_HWEIGHT=y
CONFIG_ARCH_MAY_HAVE_PC_FDC=y
CONFIG_RWSEM_XCHGADD_ALGORITHM=y
Expand All @@ -32,9 +34,11 @@ CONFIG_ARCH_HIBERNATION_POSSIBLE=y
CONFIG_ARCH_SUSPEND_POSSIBLE=y
CONFIG_ARCH_WANT_HUGE_PMD_SHARE=y
CONFIG_ARCH_WANT_GENERAL_HUGETLB=y
CONFIG_ZONE_DMA32=y
CONFIG_AUDIT_ARCH=y
CONFIG_ARCH_SUPPORTS_OPTIMIZED_INLINING=y
CONFIG_ARCH_SUPPORTS_DEBUG_PAGEALLOC=y
CONFIG_X86_32_SMP=y
CONFIG_X86_64_SMP=y
CONFIG_ARCH_SUPPORTS_UPROBES=y
CONFIG_FIX_EARLYCON_MEM=y
CONFIG_PGTABLE_LEVELS=3
Expand Down Expand Up @@ -268,7 +272,7 @@ CONFIG_HAVE_IRQ_TIME_ACCOUNTING=y
CONFIG_HAVE_ARCH_TRANSPARENT_HUGEPAGE=y
CONFIG_HAVE_ARCH_HUGE_VMAP=y
CONFIG_HAVE_MOD_ARCH_SPECIFIC=y
CONFIG_MODULES_USE_ELF_REL=y
CONFIG_MODULES_USE_ELF_RELA=y
CONFIG_ARCH_HAS_ELF_RANDOMIZE=y
CONFIG_HAVE_ARCH_MMAP_RND_BITS=y
CONFIG_HAVE_EXIT_THREAD=y
Expand Down
Loading