Re: [PATCH kvmtool] x86: Fix bios memory size in e820_setup

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

 



On Wed, Feb 21, 2024 at 05:28:43AM +0000, Sicheng Liu wrote:
> The memory region of MB_BIOS is [MB_BIOS_BEGIN, MB_BIOS_END],
> so its memory size should be MB_BIOS_END - MB_BIOS_BEGIN + 1.
> 
> Signed-off-by: Sicheng Liu <lsc2001@xxxxxxxxxxx>
> ---
>  x86/bios.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/x86/bios.c b/x86/bios.c
> index 5ac9e24ae0a8..380e0aba7129 100644
> --- a/x86/bios.c
> +++ b/x86/bios.c
> @@ -75,7 +75,7 @@ static void e820_setup(struct kvm *kvm)
>  	};
>  	mem_map[i++]	= (struct e820entry) {
>  		.addr		= MB_BIOS_BEGIN,
> -		.size		= MB_BIOS_END - MB_BIOS_BEGIN,
> +		.size		= MB_BIOS_END - MB_BIOS_BEGIN + 1,

Use MB_BIOS_SIZE for this?

Even with that, there are a whole bunch of suspicious-looking memset()s
in setup_bios() that probably need similar treatment.

Will




[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux