From mboxrd@z Thu Jan 1 00:00:00 1970 From: Avi Kivity Subject: Re: [PATCH] libkvm: fix physical_memory calculation Date: Fri, 02 May 2008 12:48:55 +0300 Message-ID: <481AE387.2000405@qumranet.com> References: <48183A3B.3080802@siemens.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: kvm-devel To: Jan Kiszka Return-path: In-Reply-To: <48183A3B.3080802@siemens.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: kvm-devel-bounces@lists.sourceforge.net Errors-To: kvm-devel-bounces@lists.sourceforge.net List-Id: kvm.vger.kernel.org Jan Kiszka wrote: > This looks bogus, but it is so far without practical impact (phys_start > is always 0 when we do the calculation). > > Signed-off-by: Jan Kiszka > --- > libkvm/libkvm.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > Index: b/libkvm/libkvm.c > =================================================================== > --- a/libkvm/libkvm.c > +++ b/libkvm/libkvm.c > @@ -550,7 +550,7 @@ int kvm_register_userspace_phys_mem(kvm_ > int r; > > if (!kvm->physical_memory) > - kvm->physical_memory = userspace_addr - phys_start; > + kvm->physical_memory = userspace_addr + phys_start; > > I think it's correct. The intent (probably) was that kvm->physical_memory[x] would refer to the contents of physical memory address x. In another way, it's incorrect, since nothing guarantees (now) that memory is contiguous. -- I have a truly marvellous patch that fixes the bug which this signature is too narrow to contain. ------------------------------------------------------------------------- This SF.net email is sponsored by the 2008 JavaOne(SM) Conference Don't miss this year's exciting event. There's still time to save $100. Use priority code J8TL2D2. http://ad.doubleclick.net/clk;198757673;13503038;p?http://java.sun.com/javaone