Skip to content

Commit 3944eb2

Browse files
author
robelin
committed
Fix regression when bumping Linux to 6.1.88
Starting from Linux v6.1.88 commit f31f521, the first bootsec is complete removed and filled with 0xff to reserve for PE header. Since we load the full 512 bytes, those 0xff will break kvm-host. Instead, we only have to take the part of setup header.
1 parent 6aebede commit 3944eb2

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/arch/x86/vm.c

+4-1
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <asm/e820.h>
77
#include <linux/kvm.h>
88
#include <linux/kvm_para.h>
9+
#include <stddef.h>
910
#include <string.h>
1011
#include <sys/ioctl.h>
1112

@@ -131,7 +132,9 @@ int vm_arch_load_image(vm_t *v, void *data, size_t datasz)
131132
void *kernel = ((uint8_t *) v->mem) + 0x100000;
132133

133134
memset(boot, 0, sizeof(struct boot_params));
134-
memmove(boot, data, sizeof(struct boot_params));
135+
memmove((void *) boot + offsetof(struct boot_params, hdr),
136+
data + offsetof(struct boot_params, hdr),
137+
sizeof(struct setup_header));
135138

136139
size_t setup_sectors = boot->hdr.setup_sects;
137140
size_t setupsz = (setup_sectors + 1) * 512;

0 commit comments

Comments
 (0)