Skip to content

Commit

Permalink
kexec patch: remove unneeded xen EBDA patch.
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
tlaurion committed Apr 21, 2023
1 parent 7cf99a5 commit 4f88f35
Showing 1 changed file with 0 additions and 32 deletions.
32 changes: 0 additions & 32 deletions patches/kexec-2.0.26.patch
Expand Up @@ -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
Expand Down

0 comments on commit 4f88f35

Please sign in to comment.