Index: head/emulators/xen-kernel/Makefile =================================================================== --- head/emulators/xen-kernel/Makefile (revision 505753) +++ head/emulators/xen-kernel/Makefile (revision 505754) @@ -1,69 +1,73 @@ # $FreeBSD$ PORTNAME= xen PORTVERSION= 4.12.0 -PORTREVISION= 2 +PORTREVISION= 3 CATEGORIES= emulators MASTER_SITES= http://downloads.xenproject.org/release/xen/${PORTVERSION}/ PKGNAMESUFFIX= -kernel MAINTAINER= royger@FreeBSD.org COMMENT= Hypervisor using a microkernel design LICENSE= GPLv2 ONLY_FOR_ARCHS= amd64 USES= cpe gmake python:2.7,build -# LLD 8 changed the behaviour re the placement of orphaned sections, which -# produces a non-bootable Xen kernel: -# -# https://bugs.llvm.org/show_bug.cgi?id=42327 -# -# Switch to GNU LD (and NM) until this is resolved. -USE_BINUTILS= yes + # Ports build environment has ARCH=amd64 set which disables Xen automatic arch # detection, but amd64 is not a valid arch for Xen. Hardcode x86_64 on the # command line in order to overwrite the one from the environment. -MAKE_ARGS= clang=y PYTHON=${PYTHON_CMD} ARCH=x86_64 LD=${LD} NM=${NM} +MAKE_ARGS= clang=y PYTHON=${PYTHON_CMD} ARCH=x86_64 NO_MTREE= yes STRIP= # PLIST_FILES= /boot/xen \ lib/debug/boot/xen.debug # Pre-patches for XSA-297 to apply cleanly EXTRA_PATCHES+= ${PATCHDIR}/0001-x86-tsx-Implement-controls-for-RTM-force-abort-mode.patch:-p1 \ ${PATCHDIR}/0001-x86-msr-Shorten-ARCH_CAPABILITIES_-constants.patch:-p1 \ ${PATCHDIR}/0002-x86-spec-ctrl-Extend-repoline-safey-calcuations-for-.patch:-p1 # Fixes for XSA-297 (MDS) EXTRA_PATCHES+= ${PATCHDIR}/xsa297-4.12-1.patch:-p1 \ ${PATCHDIR}/xsa297-4.12-2.patch:-p1 \ ${PATCHDIR}/xsa297-4.12-3.patch:-p1 \ ${PATCHDIR}/xsa297-4.12-4.patch:-p1 \ ${PATCHDIR}/xsa297-4.12-5.patch:-p1 \ ${PATCHDIR}/xsa297-4.12-6.patch:-p1 \ ${PATCHDIR}/xsa297-4.12-7.patch:-p1 + +# LLD 8 changed the behaviour re the placement of orphaned sections, which +# produces a non-bootable Xen kernel: +# +# https://bugs.llvm.org/show_bug.cgi?id=42327 +# +# Backport the fixes from upstream +EXTRA_PATCHES+= ${PATCHDIR}/0001-x86-linker-add-a-reloc-section-to-ELF-linker-script.patch:-p1 \ + ${PATCHDIR}/0003-xen-link-handle-.init.rodata.cst-sections-in-the-lin.patch:-p1 \ + ${PATCHDIR}/0004-x86-check-for-multiboot-1-2-header-presence.patch:-p1 .include .if ${OPSYS} != FreeBSD IGNORE= only supported on FreeBSD .endif .if ${OSVERSION} < 1200074 IGNORE= only supported on FreeBSD 12.0 or newer .endif # The ports native 'build' target cannot be used because it sets # CFLAGS, and that breaks the Xen build system. do-build: ${MAKE_CMD} -j${MAKE_JOBS_NUMBER} -C ${WRKSRC} build-xen ${MAKE_ARGS} do-install: ${MKDIR} ${STAGEDIR}/boot ${MKDIR} ${STAGEDIR}${PREFIX}/lib/debug/boot/ ${INSTALL_PROGRAM} ${WRKSRC}/xen/xen ${STAGEDIR}/boot ${INSTALL_DATA} ${WRKSRC}/xen/xen-syms ${STAGEDIR}${PREFIX}/lib/debug/boot/xen.debug .include Index: head/emulators/xen-kernel/files/0001-x86-linker-add-a-reloc-section-to-ELF-linker-script.patch =================================================================== --- head/emulators/xen-kernel/files/0001-x86-linker-add-a-reloc-section-to-ELF-linker-script.patch (nonexistent) +++ head/emulators/xen-kernel/files/0001-x86-linker-add-a-reloc-section-to-ELF-linker-script.patch (revision 505754) @@ -0,0 +1,50 @@ +From 597c57becbeba21ff9f0c078ba2e32973d09d258 Mon Sep 17 00:00:00 2001 +From: Roger Pau Monne +Date: Thu, 27 Jun 2019 11:33:33 +0200 +Subject: [PATCH 1/4] x86/linker: add a reloc section to ELF linker script +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +if the hypervisor has been built with EFI support (ie: multiboot2). +This allows to position the .reloc section correctly in the output +binary. + +Note that for the ELF output format the .reloc section is moved before +.bss because the data it contains is read-only, so it belongs with the +other sections containing read-only data. + +Signed-off-by: Roger Pau Monné +Acked-by: Jan Beulich +Acked-by: Andrew Cooper +--- + xen/arch/x86/xen.lds.S | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S +index 98a99444c2..cee7cf80dd 100644 +--- a/xen/arch/x86/xen.lds.S ++++ b/xen/arch/x86/xen.lds.S +@@ -175,6 +175,19 @@ SECTIONS + } :text + #endif + #endif ++ ++/* ++ * ELF builds are linked to a fixed virtual address, and in principle ++ * shouldn't have a .reloc section. However, due to the way EFI support is ++ * currently implemented, retaining the .reloc section is necessary. ++ */ ++#if defined(XEN_BUILD_EFI) && !defined(EFI) ++ . = ALIGN(4); ++ DECL_SECTION(.reloc) { ++ *(.reloc) ++ } :text ++#endif ++ + _erodata = .; + + . = ALIGN(SECTION_ALIGN); +-- +2.20.1 (Apple Git-117) + Property changes on: head/emulators/xen-kernel/files/0001-x86-linker-add-a-reloc-section-to-ELF-linker-script.patch ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/emulators/xen-kernel/files/0003-xen-link-handle-.init.rodata.cst-sections-in-the-lin.patch =================================================================== --- head/emulators/xen-kernel/files/0003-xen-link-handle-.init.rodata.cst-sections-in-the-lin.patch (nonexistent) +++ head/emulators/xen-kernel/files/0003-xen-link-handle-.init.rodata.cst-sections-in-the-lin.patch (revision 505754) @@ -0,0 +1,53 @@ +From 874fc28b72fbb49f4f304b9acd3d49afd8326042 Mon Sep 17 00:00:00 2001 +From: Roger Pau Monne +Date: Thu, 27 Jun 2019 11:33:34 +0200 +Subject: [PATCH 3/4] xen/link: handle .init.rodata.cst* sections in the linker + script +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Note that those sections when not prefixed with .init are already +handled by the more general .rodata.* matching pattern in the .rodata +output section. + +Signed-off-by: Roger Pau Monné +Acked-by: Andrew Cooper +[Make .init.rodata consistent with .rodata] +Signed-off-by: Andrew Cooper +--- + xen/arch/arm/xen.lds.S | 3 +-- + xen/arch/x86/xen.lds.S | 3 +-- + 2 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S +index e664c4441a..12c107f45d 100644 +--- a/xen/arch/arm/xen.lds.S ++++ b/xen/arch/arm/xen.lds.S +@@ -154,8 +154,7 @@ SECTIONS + . = ALIGN(PAGE_SIZE); + .init.data : { + *(.init.rodata) +- *(.init.rodata.rel) +- *(.init.rodata.str*) ++ *(.init.rodata.*) + + . = ALIGN(POINTER_ALIGN); + __setup_start = .; +diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S +index cee7cf80dd..a73139cd29 100644 +--- a/xen/arch/x86/xen.lds.S ++++ b/xen/arch/x86/xen.lds.S +@@ -219,8 +219,7 @@ SECTIONS + #endif + + *(.init.rodata) +- *(.init.rodata.rel) +- *(.init.rodata.str*) ++ *(.init.rodata.*) + + . = ALIGN(POINTER_ALIGN); + __setup_start = .; +-- +2.20.1 (Apple Git-117) + Property changes on: head/emulators/xen-kernel/files/0003-xen-link-handle-.init.rodata.cst-sections-in-the-lin.patch ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/emulators/xen-kernel/files/0004-x86-check-for-multiboot-1-2-header-presence.patch =================================================================== --- head/emulators/xen-kernel/files/0004-x86-check-for-multiboot-1-2-header-presence.patch (nonexistent) +++ head/emulators/xen-kernel/files/0004-x86-check-for-multiboot-1-2-header-presence.patch (revision 505754) @@ -0,0 +1,64 @@ +From e632d56f0f5787204ef9b640d5f9153dcd4cb3de Mon Sep 17 00:00:00 2001 +From: Roger Pau Monne +Date: Thu, 27 Jun 2019 11:33:35 +0200 +Subject: [PATCH 4/4] x86: check for multiboot{1, 2} header presence +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +After building the hypervisor binary. Note that the check is performed +by searching for the magic header value at the start of the binary. + +Signed-off-by: Roger Pau Monné +Acked-by: Jan Beulich +Acked-by: Andrew Cooper +--- + .gitignore | 1 + + xen/arch/x86/Makefile | 10 ++++++++-- + 2 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/.gitignore b/.gitignore +index a77cbff02c..8a19c8af04 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -278,6 +278,7 @@ tools/xentrace/xentrace + xen/.banner + xen/.config + xen/.config.old ++xen/.xen.elf32 + xen/System.map + xen/arch/x86/asm-macros.i + xen/arch/x86/boot/mkelf32 +diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile +index 8a8d8f060f..5e3840084b 100644 +--- a/xen/arch/x86/Makefile ++++ b/xen/arch/x86/Makefile +@@ -99,9 +99,15 @@ endif + syms-warn-dup-y := --warn-dup + syms-warn-dup-$(CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS) := + ++$(TARGET): TMP = $(@D)/.$(@F).elf32 + $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32 +- ./boot/mkelf32 $(notes_phdrs) $(TARGET)-syms $(TARGET) $(XEN_IMG_OFFSET) \ ++ ./boot/mkelf32 $(notes_phdrs) $(TARGET)-syms $(TMP) $(XEN_IMG_OFFSET) \ + `$(NM) $(TARGET)-syms | sed -ne 's/^\([^ ]*\) . __2M_rwdata_end$$/0x\1/p'` ++ od -t x4 -N 8192 $(TMP) | grep 1badb002 > /dev/null || \ ++ { echo "No Multiboot1 header found" >&2; false; } ++ od -t x4 -N 32768 $(TMP) | grep e85250d6 > /dev/null || \ ++ { echo "No Multiboot2 header found" >&2; false; } ++ mv $(TMP) $(TARGET) + + ALL_OBJS := $(BASEDIR)/arch/x86/boot/built_in.o $(BASEDIR)/arch/x86/efi/built_in.o $(ALL_OBJS) + +@@ -249,7 +255,7 @@ efi/mkreloc: efi/mkreloc.c + clean:: + rm -f asm-offsets.s *.lds boot/*.o boot/*~ boot/core boot/mkelf32 + rm -f asm-macros.i $(BASEDIR)/include/asm-x86/asm-macros.* +- rm -f $(BASEDIR)/.xen-syms.[0-9]* boot/.*.d ++ rm -f $(BASEDIR)/.xen-syms.[0-9]* boot/.*.d $(BASEDIR)/.xen.elf32 + rm -f $(BASEDIR)/.xen.efi.[0-9]* efi/*.efi efi/mkreloc + rm -f boot/cmdline.S boot/reloc.S boot/*.lnk boot/*.bin + rm -f note.o +-- +2.20.1 (Apple Git-117) + Property changes on: head/emulators/xen-kernel/files/0004-x86-check-for-multiboot-1-2-header-presence.patch ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/sysutils/xen-tools/Makefile =================================================================== --- head/sysutils/xen-tools/Makefile (revision 505753) +++ head/sysutils/xen-tools/Makefile (revision 505754) @@ -1,105 +1,115 @@ # $FreeBSD$ PORTNAME= xen PKGNAMESUFFIX= -tools PORTVERSION= 4.12.0 -PORTREVISION= 1 +PORTREVISION= 2 CATEGORIES= sysutils emulators MASTER_SITES= http://downloads.xenproject.org/release/xen/${PORTVERSION}/ MAINTAINER= royger@FreeBSD.org COMMENT= Xen management tools LICENSE= GPLv2 LGPL3 LICENSE_COMB= multi LIB_DEPENDS= libyajl.so:devel/yajl \ liblzo2.so:archivers/lzo2 \ libpixman-1.so:x11/pixman \ libargp.so:devel/argp-standalone BUILD_DEPENDS= seabios>0:misc/seabios RUN_DEPENDS= seabios>0:misc/seabios DOCS_BUILD_DEPENDS=markdown:textproc/markdown OPTIONS_DEFINE= DOCS SPICE OPTIONS_DEFAULT= DOCS OPTIONS_SUB= yes SPICE_DESC= Enable SPICE protocol for QEMU SPICE_CONFIGURE_WITH= extra-qemuu-configure-args="--enable-spice" SPICE_BUILD_DEPENDS= spice-protocol>=0.12.10:devel/spice-protocol SPICE_LIB_DEPENDS= libspice-server.so:devel/libspice-server ONLY_FOR_ARCHS= amd64 ONLY_FOR_ARCHS_REASON= "not yet ported to anything other than amd64" USES= cpe gettext gmake libtool localbase:ldflags perl5 pkgconfig \ python:2.7 shebangfix USE_GNOME= glib20 USE_LDCONFIG= yes HAS_CONFIGURE= yes # Set ARCH=x86_64 in order to overwrite the environment ARCH=amd64 MAKE_ARGS= clang=y ARCH=x86_64 CONFIGURE_ARGS+= --with-system-seabios=${LOCALBASE}/share/seabios/bios.bin \ --mandir=${MANPREFIX}/man SHEBANG_FILES= tools/misc/xencov_split \ tools/python/scripts/convert-legacy-stream \ tools/python/scripts/verify-stream-v2 \ tools/xenmon/xenmon.py ALL_TARGET= tools DOCS_ALL_TARGET= docs INSTALL_TARGET= install-tools DOCS_INSTALL_TARGET= install-docs EXTRA_PATCHES+= ${PATCHDIR}/0001-tools-include-propagate-python-interpreter-path.patch:-p1 # Pre-patches for XSA-297 to apply cleanly EXTRA_PATCHES+= ${PATCHDIR}/0001-x86-tsx-Implement-controls-for-RTM-force-abort-mode.patch:-p1 \ ${PATCHDIR}/0001-x86-msr-Shorten-ARCH_CAPABILITIES_-constants.patch:-p1 \ ${PATCHDIR}/0002-x86-spec-ctrl-Extend-repoline-safey-calcuations-for-.patch:-p1 # Fixes for XSA-297 (MDS) EXTRA_PATCHES+= ${PATCHDIR}/xsa297-4.12-1.patch:-p1 \ ${PATCHDIR}/xsa297-4.12-2.patch:-p1 \ ${PATCHDIR}/xsa297-4.12-3.patch:-p1 \ ${PATCHDIR}/xsa297-4.12-4.patch:-p1 \ ${PATCHDIR}/xsa297-4.12-5.patch:-p1 \ ${PATCHDIR}/xsa297-4.12-6.patch:-p1 \ ${PATCHDIR}/xsa297-4.12-7.patch:-p1 + +# LLD 8 changed the behaviour re the placement of orphaned sections, which +# produces a non-bootable Xen kernel: +# +# https://bugs.llvm.org/show_bug.cgi?id=42327 +# +# Backport the fixes from upstream +EXTRA_PATCHES+= ${PATCHDIR}/0001-x86-linker-add-a-reloc-section-to-ELF-linker-script.patch:-p1 \ + ${PATCHDIR}/0003-xen-link-handle-.init.rodata.cst-sections-in-the-lin.patch:-p1 \ + ${PATCHDIR}/0004-x86-check-for-multiboot-1-2-header-presence.patch:-p1 .include .if ${OPSYS} != FreeBSD IGNORE= only supported on FreeBSD .endif .if ${OSVERSION} < 1200074 IGNORE= only supported on FreeBSD 12.0 or newer .endif .if ${PORT_OPTIONS:MSPICE} && ${OSVERSION} < 1300008 BROKEN= SPICE support requires FreeBSD version 13.0 or higher .endif post-patch: @for p in `ls ${FILESDIR}/*qemuu*.patch 2>/dev/null`; do \ ${ECHO_CMD} "====> Applying $${p##*/}" ; \ ${PATCH} -s -p1 -i $${p} -d ${WRKSRC}/tools/qemu-xen ; \ done # The ports native 'build' target cannot be used because it sets CFLAGS, and # that breaks the Xen kernel build system that's used by the tools in order to # build the pv-shim. do-build: ${MAKE_CMD} -j${MAKE_JOBS_NUMBER} -C ${WRKSRC} ${MAKE_ARGS} ${ALL_TARGET} do-install: ${MAKE_CMD} -j${MAKE_JOBS_NUMBER} -C ${WRKSRC} ${MAKE_ARGS} ${INSTALL_TARGET} post-install: ${MKDIR} ${STAGEDIR}/var/run/xen .include Index: head/sysutils/xen-tools/files/0001-x86-linker-add-a-reloc-section-to-ELF-linker-script.patch =================================================================== --- head/sysutils/xen-tools/files/0001-x86-linker-add-a-reloc-section-to-ELF-linker-script.patch (nonexistent) +++ head/sysutils/xen-tools/files/0001-x86-linker-add-a-reloc-section-to-ELF-linker-script.patch (revision 505754) @@ -0,0 +1,50 @@ +From 597c57becbeba21ff9f0c078ba2e32973d09d258 Mon Sep 17 00:00:00 2001 +From: Roger Pau Monne +Date: Thu, 27 Jun 2019 11:33:33 +0200 +Subject: [PATCH 1/4] x86/linker: add a reloc section to ELF linker script +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +if the hypervisor has been built with EFI support (ie: multiboot2). +This allows to position the .reloc section correctly in the output +binary. + +Note that for the ELF output format the .reloc section is moved before +.bss because the data it contains is read-only, so it belongs with the +other sections containing read-only data. + +Signed-off-by: Roger Pau Monné +Acked-by: Jan Beulich +Acked-by: Andrew Cooper +--- + xen/arch/x86/xen.lds.S | 13 +++++++++++++ + 1 file changed, 13 insertions(+) + +diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S +index 98a99444c2..cee7cf80dd 100644 +--- a/xen/arch/x86/xen.lds.S ++++ b/xen/arch/x86/xen.lds.S +@@ -175,6 +175,19 @@ SECTIONS + } :text + #endif + #endif ++ ++/* ++ * ELF builds are linked to a fixed virtual address, and in principle ++ * shouldn't have a .reloc section. However, due to the way EFI support is ++ * currently implemented, retaining the .reloc section is necessary. ++ */ ++#if defined(XEN_BUILD_EFI) && !defined(EFI) ++ . = ALIGN(4); ++ DECL_SECTION(.reloc) { ++ *(.reloc) ++ } :text ++#endif ++ + _erodata = .; + + . = ALIGN(SECTION_ALIGN); +-- +2.20.1 (Apple Git-117) + Property changes on: head/sysutils/xen-tools/files/0001-x86-linker-add-a-reloc-section-to-ELF-linker-script.patch ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/sysutils/xen-tools/files/0003-xen-link-handle-.init.rodata.cst-sections-in-the-lin.patch =================================================================== --- head/sysutils/xen-tools/files/0003-xen-link-handle-.init.rodata.cst-sections-in-the-lin.patch (nonexistent) +++ head/sysutils/xen-tools/files/0003-xen-link-handle-.init.rodata.cst-sections-in-the-lin.patch (revision 505754) @@ -0,0 +1,53 @@ +From 874fc28b72fbb49f4f304b9acd3d49afd8326042 Mon Sep 17 00:00:00 2001 +From: Roger Pau Monne +Date: Thu, 27 Jun 2019 11:33:34 +0200 +Subject: [PATCH 3/4] xen/link: handle .init.rodata.cst* sections in the linker + script +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +Note that those sections when not prefixed with .init are already +handled by the more general .rodata.* matching pattern in the .rodata +output section. + +Signed-off-by: Roger Pau Monné +Acked-by: Andrew Cooper +[Make .init.rodata consistent with .rodata] +Signed-off-by: Andrew Cooper +--- + xen/arch/arm/xen.lds.S | 3 +-- + xen/arch/x86/xen.lds.S | 3 +-- + 2 files changed, 2 insertions(+), 4 deletions(-) + +diff --git a/xen/arch/arm/xen.lds.S b/xen/arch/arm/xen.lds.S +index e664c4441a..12c107f45d 100644 +--- a/xen/arch/arm/xen.lds.S ++++ b/xen/arch/arm/xen.lds.S +@@ -154,8 +154,7 @@ SECTIONS + . = ALIGN(PAGE_SIZE); + .init.data : { + *(.init.rodata) +- *(.init.rodata.rel) +- *(.init.rodata.str*) ++ *(.init.rodata.*) + + . = ALIGN(POINTER_ALIGN); + __setup_start = .; +diff --git a/xen/arch/x86/xen.lds.S b/xen/arch/x86/xen.lds.S +index cee7cf80dd..a73139cd29 100644 +--- a/xen/arch/x86/xen.lds.S ++++ b/xen/arch/x86/xen.lds.S +@@ -219,8 +219,7 @@ SECTIONS + #endif + + *(.init.rodata) +- *(.init.rodata.rel) +- *(.init.rodata.str*) ++ *(.init.rodata.*) + + . = ALIGN(POINTER_ALIGN); + __setup_start = .; +-- +2.20.1 (Apple Git-117) + Property changes on: head/sysutils/xen-tools/files/0003-xen-link-handle-.init.rodata.cst-sections-in-the-lin.patch ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property Index: head/sysutils/xen-tools/files/0004-x86-check-for-multiboot-1-2-header-presence.patch =================================================================== --- head/sysutils/xen-tools/files/0004-x86-check-for-multiboot-1-2-header-presence.patch (nonexistent) +++ head/sysutils/xen-tools/files/0004-x86-check-for-multiboot-1-2-header-presence.patch (revision 505754) @@ -0,0 +1,64 @@ +From e632d56f0f5787204ef9b640d5f9153dcd4cb3de Mon Sep 17 00:00:00 2001 +From: Roger Pau Monne +Date: Thu, 27 Jun 2019 11:33:35 +0200 +Subject: [PATCH 4/4] x86: check for multiboot{1, 2} header presence +MIME-Version: 1.0 +Content-Type: text/plain; charset=UTF-8 +Content-Transfer-Encoding: 8bit + +After building the hypervisor binary. Note that the check is performed +by searching for the magic header value at the start of the binary. + +Signed-off-by: Roger Pau Monné +Acked-by: Jan Beulich +Acked-by: Andrew Cooper +--- + .gitignore | 1 + + xen/arch/x86/Makefile | 10 ++++++++-- + 2 files changed, 9 insertions(+), 2 deletions(-) + +diff --git a/.gitignore b/.gitignore +index a77cbff02c..8a19c8af04 100644 +--- a/.gitignore ++++ b/.gitignore +@@ -278,6 +278,7 @@ tools/xentrace/xentrace + xen/.banner + xen/.config + xen/.config.old ++xen/.xen.elf32 + xen/System.map + xen/arch/x86/asm-macros.i + xen/arch/x86/boot/mkelf32 +diff --git a/xen/arch/x86/Makefile b/xen/arch/x86/Makefile +index 8a8d8f060f..5e3840084b 100644 +--- a/xen/arch/x86/Makefile ++++ b/xen/arch/x86/Makefile +@@ -99,9 +99,15 @@ endif + syms-warn-dup-y := --warn-dup + syms-warn-dup-$(CONFIG_SUPPRESS_DUPLICATE_SYMBOL_WARNINGS) := + ++$(TARGET): TMP = $(@D)/.$(@F).elf32 + $(TARGET): $(TARGET)-syms $(efi-y) boot/mkelf32 +- ./boot/mkelf32 $(notes_phdrs) $(TARGET)-syms $(TARGET) $(XEN_IMG_OFFSET) \ ++ ./boot/mkelf32 $(notes_phdrs) $(TARGET)-syms $(TMP) $(XEN_IMG_OFFSET) \ + `$(NM) $(TARGET)-syms | sed -ne 's/^\([^ ]*\) . __2M_rwdata_end$$/0x\1/p'` ++ od -t x4 -N 8192 $(TMP) | grep 1badb002 > /dev/null || \ ++ { echo "No Multiboot1 header found" >&2; false; } ++ od -t x4 -N 32768 $(TMP) | grep e85250d6 > /dev/null || \ ++ { echo "No Multiboot2 header found" >&2; false; } ++ mv $(TMP) $(TARGET) + + ALL_OBJS := $(BASEDIR)/arch/x86/boot/built_in.o $(BASEDIR)/arch/x86/efi/built_in.o $(ALL_OBJS) + +@@ -249,7 +255,7 @@ efi/mkreloc: efi/mkreloc.c + clean:: + rm -f asm-offsets.s *.lds boot/*.o boot/*~ boot/core boot/mkelf32 + rm -f asm-macros.i $(BASEDIR)/include/asm-x86/asm-macros.* +- rm -f $(BASEDIR)/.xen-syms.[0-9]* boot/.*.d ++ rm -f $(BASEDIR)/.xen-syms.[0-9]* boot/.*.d $(BASEDIR)/.xen.elf32 + rm -f $(BASEDIR)/.xen.efi.[0-9]* efi/*.efi efi/mkreloc + rm -f boot/cmdline.S boot/reloc.S boot/*.lnk boot/*.bin + rm -f note.o +-- +2.20.1 (Apple Git-117) + Property changes on: head/sysutils/xen-tools/files/0004-x86-check-for-multiboot-1-2-header-presence.patch ___________________________________________________________________ Added: fbsd:nokeywords ## -0,0 +1 ## +yes \ No newline at end of property Added: svn:eol-style ## -0,0 +1 ## +native \ No newline at end of property Added: svn:mime-type ## -0,0 +1 ## +text/plain \ No newline at end of property