From 4f88f3562ae4ca511cd0e875bfd36dd63c38091b Mon Sep 17 00:00:00 2001 From: Thierry Laurion Date: Fri, 21 Apr 2023 11:56:18 -0400 Subject: [PATCH] kexec patch: remove unneeded xen EBDA patch. Tested on x230 against Q4.2 (xen 4.17) and Q4.1 (xen 4.14) which changed behavior since original patch. For history, EBDA patch was introduced when Xen stopped being packed inside of Heads (yes. Xen was inside of Heads in the beginning). Things have been upstreamed since then. Note: Q4.1 and 4.2 gets vga on x230 when i915 driver is loaded in plymouth boot stage. --- patches/kexec-2.0.26.patch | 32 -------------------------------- 1 file changed, 32 deletions(-) diff --git a/patches/kexec-2.0.26.patch b/patches/kexec-2.0.26.patch index 71c84abaf..012807823 100644 --- a/patches/kexec-2.0.26.patch +++ b/patches/kexec-2.0.26.patch @@ -102,38 +102,6 @@ index 14263b0..55291d6 100644 real_mode->lfb_width = var.xres; real_mode->lfb_height = var.yres; real_mode->lfb_depth = var.bits_per_pixel; -diff --git a/kexec/kexec.c b/kexec/kexec.c -index 0e92d96..f7984a8 100644 ---- a/kexec/kexec.c -+++ b/kexec/kexec.c -@@ -807,6 +807,27 @@ static int my_load(const char *type, int fileind, int argc, char **argv, - if (sort_segments(&info) < 0) { - return -1; - } -+ -+#if 1 -+ // force segment 0 to have memsz == bufsz -+ // so that it won't overwrite EBDA -+ if (info.segment[0].mem == 0) -+ { -+ if (kexec_debug) -+ printf("hack ebda into segment 0!\n"); -+ -+ uint8_t * ebda = calloc(1, info.segment[0].memsz); -+ memcpy(ebda, info.segment[0].buf, info.segment[0].bufsz); -+ info.segment[0].bufsz = info.segment[0].memsz; -+ info.segment[0].buf = ebda; -+ -+ // install some default EBDA values that are off scale, -+ // which will force Xen to use the multiboot info -+ *(uint16_t*)(ebda + 0x40e) = 0xFFFF; // segment -+ *(uint16_t*)(ebda + 0x413) = 0xFFFF; // size -+ } -+#endif -+ - /* if purgatory is loaded update it */ - update_purgatory(&info); - if (entry) diff --git a/purgatory/Makefile b/purgatory/Makefile index 4d2d071..ee5c642 100644 --- a/purgatory/Makefile