From mboxrd@z Thu Jan 1 00:00:00 1970 From: Zang Hongyong Subject: Re: [PATCH] kvm tools: Make the whole guest memory mergeable Date: Mon, 19 Dec 2011 10:39:42 +0800 Message-ID: <4EEEA3EE.3000409@huawei.com> References: <1323997263-2031-1-git-send-email-zanghongyong@huawei.com> <1324014621.4496.3.camel@lappy> <4EEAED0E.5050106@huawei.com> <1324020188.4496.17.camel@lappy> <4EEB031B.2020806@huawei.com> <1324025135.4496.31.camel@lappy> <4EEB105F.9050307@huawei.com> <1324028809.4496.40.camel@lappy> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: QUOTED-PRINTABLE Cc: kvm@vger.kernel.org, penberg@kernel.org, xiaowei.yang@huawei.com, hanweidong@huawei.com, wusongwei@huawei.com, kongbo@huawei.com To: Sasha Levin Return-path: Received: from szxga04-in.huawei.com ([119.145.14.67]:60302 "EHLO szxga04-in.huawei.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752053Ab1LSClI (ORCPT ); Sun, 18 Dec 2011 21:41:08 -0500 Received: from huawei.com (szxga04-in [172.24.2.12]) by szxga04-in.huawei.com (iPlanet Messaging Server 5.2 HotFix 2.14 (built Aug 8 2006)) with ESMTP id <0LWF0096PJEVNC@szxga04-in.huawei.com> for kvm@vger.kernel.org; Mon, 19 Dec 2011 10:40:07 +0800 (CST) Received: from szxrg02-dlp.huawei.com ([172.24.2.119]) by szxga04-in.huawei.com (iPlanet Messaging Server 5.2 HotFix 2.14 (built Aug 8 2006)) with ESMTP id <0LWF00MA7JECZU@szxga04-in.huawei.com> for kvm@vger.kernel.org; Mon, 19 Dec 2011 10:40:07 +0800 (CST) In-reply-to: <1324028809.4496.40.camel@lappy> Sender: kvm-owner@vger.kernel.org List-ID: =E4=BA=8E 2011/12/16,=E6=98=9F=E6=9C=9F=E4=BA=94 17:46, Sasha Levin =E5= =86=99=E9=81=93: > 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 o= f >> the second >> RAM range from 4GB to the end of RAM (phys_size =3D 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() co= de. > 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_set= up()) 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 =3D 0x100000000ULL; > - phys_size =3D kvm->ram_size - phys_size; > + phys_size =3D kvm->ram_size - phys_start; > host_mem =3D kvm->ram_start + phys_start; > > kvm__register_mem(kvm, phys_start, phys_size, host_m= em); > > I basically want one memory map with one size which includes *everyth= ing*, 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()? > I've got what you mean. And there's nothing wrong in load_bzimage(). It's my misunderstanding.