Skip to contentSkip to conversation

syslinux: fix booting memtest86+ using pxelinux regression

PATCH In review Jonathan Liu 1 participant 2 messages Feb 2, 2014 – Feb 5, 2014

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 syslinux: fix booting memtest86+ using pxelinux regression

After syslinux was updated from 4.07 to 6.01, booting memtest86+ using pxelinux would fail:
PXELINUX 6.01 2013-07-04 Copyright (C) 1994-2013 H. Peter Anvin et al Loading memtest86... ok
Booting kernel failed: invalid argument

This backports the necessary upstream patches to allow memtest86+ to boot using pxelinux again.

[YOCTO #5501]

---
 ...dd-SMT_TERMINAL-a-last-resort-region-type.patch |  50 +++
 ...an-build-a-linked-list-of-memory-scanners.patch | 450 +++++++++++++++++++++
 .../0003-PXELINUX-Add-bios-memscan-function.patch  |  87 ++++
 ...s_fbm-and-real_base_mem-to-calculate-free.patch |  65 +++
 meta/recipes-devtools/syslinux/syslinux_6.01.bb    |   6 +-
 5 files changed, 657 insertions(+), 1 deletion(-)
 create mode 100644 meta/recipes-devtools/syslinux/files/0001-movebits-Add-SMT_TERMINAL-a-last-resort-region-type.patch
 create mode 100644 meta/recipes-devtools/syslinux/files/0002-memscan-build-a-linked-list-of-memory-scanners.patch
 create mode 100644 meta/recipes-devtools/syslinux/files/0003-PXELINUX-Add-bios-memscan-function.patch
 create mode 100644 meta/recipes-devtools/syslinux/files/0004-pxe-use-bios_fbm-and-real_base_mem-to-calculate-free.patch
meta/recipes-devtools/syslinux/files/0001-movebits-Add-SMT_TERMINAL-a-last-resort-region-type.patch new file +50 -0
new file mode 100644
index 0000000..fb03bbf
@@ -0,0 +1,50 @@
+Upstream-Status: Backport [ba638fd9bf72b0c786c88909014136cfa641a147]
+Signed-off-by: Jonathan Liu <[email protected]>
+
+From b663fd7257481438256f8267831dc10b06363b22 Mon Sep 17 00:00:00 2001
+From: Matt Fleming <[email protected]>
+Date: Tue, 16 Jul 2013 22:16:11 +0100
+Subject: [PATCH 1/4] movebits: Add SMT_TERMINAL - a last resort region type
+
+Some memory regions are usable, but only as a last resort just before we
+hand over control to a kernel image. Add the necessary movebits
+infrastructure to use these regions when all other options have been
+exhausted.
+
+Signed-off-by: Matt Fleming <[email protected]>
+
+Conflicts:
+	com32/lib/syslinux/zonelist.c
+---
+ com32/include/syslinux/movebits.h | 1 +
+ com32/lib/syslinux/movebits.c     | 2 +-
+ 2 files changed, 2 insertions(+), 1 deletion(-)
+
+diff --git a/com32/include/syslinux/movebits.h b/com32/include/syslinux/movebits.h
+index 8bcdf3e..114a896 100644
+--- a/com32/include/syslinux/movebits.h
++++ b/com32/include/syslinux/movebits.h
+@@ -34,6 +34,7 @@ enum syslinux_memmap_types {
+     SMT_RESERVED,		/* Unusable memory */
+     SMT_ALLOC,			/* Memory allocated by user */
+     SMT_ZERO,			/* Memory that should be zeroed */
++    SMT_TERMINAL,		/* Memory to be used as a last resort */
+ };
+ 
+ struct syslinux_memmap {
+diff --git a/com32/lib/syslinux/movebits.c b/com32/lib/syslinux/movebits.c
+index 7a05f3c..8ffdc63 100644
+--- a/com32/lib/syslinux/movebits.c
++++ b/com32/lib/syslinux/movebits.c
+@@ -160,7 +160,7 @@ static const struct syslinux_memmap *is_free_zone(const struct syslinux_memmap
+ 	if (list->start <= start) {
+ 	    if (llast >= last) {
+ 		/* Chunk has a single, well-defined type */
+-		if (list->type == SMT_FREE) {
++		if (list->type == SMT_FREE || list->type == SMT_TERMINAL) {
+ 		    dprintf("F: 0x%08x bytes at 0x%08x\n",
+ 			    list->next->start, list->start);
+ 		    return list;	/* It's free */
+-- 
+1.8.5.3
+
meta/recipes-devtools/syslinux/files/0002-memscan-build-a-linked-list-of-memory-scanners.patch new file +450 -0

450 lines not on this page · raw message

meta/recipes-devtools/syslinux/files/0003-PXELINUX-Add-bios-memscan-function.patch new file +87 -0

87 lines not on this page · raw message

meta/recipes-devtools/syslinux/files/0004-pxe-use-bios_fbm-and-real_base_mem-to-calculate-free.patch new file +65 -0

65 lines not on this page · raw message

meta/recipes-devtools/syslinux/syslinux_6.01.bb +5 -1
index 078f8bc..1af6806 100644
@@ -8,7 +8,11 @@ LIC_FILES_CHKSUM = "file://COPYING;md5=0636e73ff0215e8d672dc4c32c317bb3 \
 # ldlinux.* stuff for now, so skip mtools-native
 DEPENDS = "nasm-native util-linux"
 
-SRC_URI = "${KERNELORG_MIRROR}/linux/utils/boot/syslinux/6.xx/syslinux-${PV}.tar.bz2"
+SRC_URI = "${KERNELORG_MIRROR}/linux/utils/boot/syslinux/6.xx/syslinux-${PV}.tar.bz2 \
+           file://0001-movebits-Add-SMT_TERMINAL-a-last-resort-region-type.patch \
+           file://0002-memscan-build-a-linked-list-of-memory-scanners.patch \
+           file://0003-PXELINUX-Add-bios-memscan-function.patch \
+           file://0004-pxe-use-bios_fbm-and-real_base_mem-to-calculate-free.patch"
 
 SRC_URI[md5sum] = "6945ee89e29119d459baed4937bbc534"
 SRC_URI[sha256sum] = "83a04cf81e6a46b80ee5a321926eea095af3498b04317e3674b46c125c7a5b43"
Signature · 1 line
1.8.5.3
#1 lore raw

Hi Robert,

Quoted 6 lines · Jonathan Liu

After syslinux was updated from 4.07 to 6.01, booting memtest86+ using pxelinux would fail:
PXELINUX 6.01 2013-07-04 Copyright (C) 1994-2013 H. Peter Anvin et al Loading memtest86... ok
Booting kernel failed: invalid argument

Quoted 6 lines

This backports the necessary upstream patches to allow memtest86+ to boot using pxelinux again.

[YOCTO #5501]

Can you please cherry pick this patch from master into dora branch?

Regards,
Jonathan