[PATCH] kexec-tools: multiboot2: Correct BASIC_MEMINFO memory units

dinhngoc.tu at irit.fr dinhngoc.tu at irit.fr
Fri Sep 24 10:03:27 PDT 2021


From: Tu Dinh <dinhngoc.tu at irit.fr>

mem_lower and mem_upper are measured in kilobytes.
---
 kexec/arch/i386/kexec-mb2-x86.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/kexec/arch/i386/kexec-mb2-x86.c b/kexec/arch/i386/kexec-mb2-x86.c
index 36fef20..0d2e93b 100644
--- a/kexec/arch/i386/kexec-mb2-x86.c
+++ b/kexec/arch/i386/kexec-mb2-x86.c
@@ -256,8 +256,8 @@ static uint64_t multiboot2_make_mbi(struct kexec_info *info, char *cmdline, int
 
 		tag->type = MULTIBOOT_TAG_TYPE_BASIC_MEMINFO;
 		tag->size = sizeof (struct multiboot_tag_basic_meminfo);
-		tag->mem_lower = mem_lower;
-		tag->mem_upper = mem_upper;
+		tag->mem_lower = mem_lower >> 10;
+		tag->mem_upper = mem_upper >> 10;
 		ptrorig += ALIGN_UP (tag->size, MULTIBOOT_TAG_ALIGN) / sizeof (*ptrorig);
 	}
 
-- 
2.25.1




More information about the kexec mailing list