Re: [PATCH] kvm tools: Make the whole guest memory mergeable

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

 



On Fri, 2011-12-16 at 17:33 +0800, Zang Hongyong wrote:
> > Do you see an issue with increasing kvm->ram_size?
> >
> Yes, it will cause some problems after simply increase the kvm->ram_size.
> For examples:
> In kvm__init_ram() code we use kvm->ram_size to calculate the size of
> the second
> RAM range from 4GB to the end of RAM (phys_size = kvm->ram_size -
> phys_size;),
> so after increase the kvm->ram_size, it will goes wrong.
> This problem also happens in e820_setup() code and load_bzimage() code. 

Yup, but fixing it is much easier than having two different sizes of the same thing.

For example, the fix for the problem in kvm__init_ram() (and e820_setup()) would be:

@@ -112,7 +112,7 @@ void kvm__init_ram(struct kvm *kvm)
                /* Second RAM range from 4GB to the end of RAM: */
 
                phys_start = 0x100000000ULL;
-               phys_size  = kvm->ram_size - phys_size;
+               phys_size  = kvm->ram_size - phys_start;
                host_mem   = kvm->ram_start + phys_start;
 
                kvm__register_mem(kvm, phys_start, phys_size, host_mem);

I basically want one memory map with one size which includes *everything*, even if that memory map includes a gap in the middle I still want the total size to include that gap.

btw, what problem do you see in load_bzimage()?

-- 

Sasha.

--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[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