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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, Sep 24, 2021 at 07:03:27PM +0200, dinhngoc.tu@xxxxxxx wrote:
> From: Tu Dinh <dinhngoc.tu@xxxxxxx>
> 
> mem_lower and mem_upper are measured in kilobytes.

Thanks,

I'm curious to know how the current code could have worked.
Do we have some testing to verify this change?

> ---
>  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
> 
> 
> _______________________________________________
> kexec mailing list
> kexec@xxxxxxxxxxxxxxxxxxx
> http://lists.infradead.org/mailman/listinfo/kexec
> 

_______________________________________________
kexec mailing list
kexec@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/kexec



[Index of Archives]     [LM Sensors]     [Linux Sound]     [ALSA Users]     [ALSA Devel]     [Linux Audio Users]     [Linux Media]     [Kernel]     [Gimp]     [Yosemite News]     [Linux Media]

  Powered by Linux