public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] libkvm: fix physical_memory calculation
@ 2008-04-30  9:22 Jan Kiszka
  2008-05-02  9:48 ` Avi Kivity
  0 siblings, 1 reply; 2+ messages in thread
From: Jan Kiszka @ 2008-04-30  9:22 UTC (permalink / raw)
  To: kvm-devel

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 <jan.kiszka@siemens.com>
---
 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;
 
 	memory.slot = get_free_slot(kvm);
 	r = ioctl(kvm->vm_fd, KVM_SET_USER_MEMORY_REGION, &memory);

-------------------------------------------------------------------------
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

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] libkvm: fix physical_memory calculation
  2008-04-30  9:22 [PATCH] libkvm: fix physical_memory calculation Jan Kiszka
@ 2008-05-02  9:48 ` Avi Kivity
  0 siblings, 0 replies; 2+ messages in thread
From: Avi Kivity @ 2008-05-02  9:48 UTC (permalink / raw)
  To: Jan Kiszka; +Cc: kvm-devel

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 <jan.kiszka@siemens.com>
> ---
>  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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-05-02  9:48 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-04-30  9:22 [PATCH] libkvm: fix physical_memory calculation Jan Kiszka
2008-05-02  9:48 ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox