public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [ kvm-Bugs-2260759 ] Can not boot up guest on latest kvm commit a605af...
@ 2008-11-11  7:14 SourceForge.net
  2008-11-11  7:30 ` [PATCH 1/1] KVM: Fix kernel allocated memory slot Sheng Yang
  0 siblings, 1 reply; 7+ messages in thread
From: SourceForge.net @ 2008-11-11  7:14 UTC (permalink / raw)
  To: noreply

Bugs item #2260759, was opened at 2008-11-10 23:14
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=893831&aid=2260759&group_id=180599

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: None
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Jiajun Xu (jiajun)
Assigned to: Nobody/Anonymous (nobody)
Summary: Can not boot up guest on latest kvm commit a605af... 

Initial Comment:
Against latest kvm commit
, kvm.git a605af55f79a1b28dc2ae574cb42a89c2949e439, userspace.git a3442e8165f4d639ca4d542b039697a8abae026f,
guest can not boot up, qemu window will pop-up but only show a black screen.

dmesg shows that:
Pid: 11287, comm: qemu-system-x86 Not tainted 2.6.26.2 #1
RIP: 0010:[<ffffffffa050a8fd>]  [<ffffffffa050a8fd>]
:kvm:kvm_vm_ioctl+0xc7/0x517
RSP: 0018:ffff81009f025df8  EFLAGS: 00010207
RAX: 0000000000000000 RBX: 0000000000000000 RCX: ffff8100cf968040
RDX: 0000000000000000 RSI: 0000000000000000 RDI: ffff810206c54480
RBP: ffff81009f074000 R08: 0000000000000008 R09: ffff810001101980
R10: 0000000000000002 R11: 00000000ffffffea R12: 0000000000000000
R13: 0000000000000000 R14: 0000000000000007 R15: 0000000000001000
FS:  00000000408a1940(0063) GS:ffff81022f0cd540(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 000000008005003b
CR2: 0000000000000020 CR3: 000000014129b000 CR4: 00000000000026e0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process qemu-system-x86 (pid: 11287, threadinfo ffff81009f024000, task
ffff81009f00f100)
Stack:  ffff81009f00f100 0000000000000000 001280d2010a9760 0000000300000010
 ffffe20001ae7078 0000000000000000 ffff8100010a9760 ffff81022a4d6ff8
 00000000408a0fe8 ffff81014137d008 ffff81009f11b500 0000000000000000
Call Trace:
 [<ffffffff8027278e>] ? handle_mm_fault+0x2e8/0x708
 [<ffffffff80296c89>] ? vfs_ioctl+0x21/0x6b
 [<ffffffff80296f1b>] ? do_vfs_ioctl+0x248/0x261
 [<ffffffff80296f85>] ? sys_ioctl+0x51/0x70
 [<ffffffff8020bef2>] ? tracesys+0xd5/0xda


Code: 41 89 cd 41 bc ea ff ff ff 0f 87 54 04 00 00 89 ce 48 89 ef e8 35 12 00
00 48 3d 00 f0 ff ff 48 89 c3 41 89 c4 0f 87 38 04 00 00 <48> c7 40 20 00 c8 52
a0 48 89 c7 e8 20 15 00 00 85 c0 41 89 c4 
RIP  [<ffffffffa050a8fd>] :kvm:kvm_vm_ioctl+0xc7/0x517
 RSP <ffff81009f025df8>
CR2: 0000000000000020
---[ end trace 85ba6bd8af7e61d0 ]---


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=893831&aid=2260759&group_id=180599

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

* [PATCH 1/1] KVM: Fix kernel allocated memory slot
  2008-11-11  7:14 [ kvm-Bugs-2260759 ] Can not boot up guest on latest kvm commit a605af SourceForge.net
@ 2008-11-11  7:30 ` Sheng Yang
  2008-11-11 14:58   ` Hollis Blanchard
  2008-11-12 10:07   ` Avi Kivity
  0 siblings, 2 replies; 7+ messages in thread
From: Sheng Yang @ 2008-11-11  7:30 UTC (permalink / raw)
  To: Avi Kivity; +Cc: kvm, \"Hollis Blanchard\", Sheng Yang

Commit 7fd49de9773fdcb7b75e823b21c1c5dc1e218c14 "KVM: ensure that memslot
userspace addresses are page-aligned" broke kernel space allocated memory
slot, for the userspace_addr is invalid.

Signed-off-by: Sheng Yang <sheng@linux.intel.com>
---
 virt/kvm/kvm_main.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
index 0a0a959..4727c08 100644
--- a/virt/kvm/kvm_main.c
+++ b/virt/kvm/kvm_main.c
@@ -715,7 +715,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
 		goto out;
 	if (mem->guest_phys_addr & (PAGE_SIZE - 1))
 		goto out;
-	if (mem->userspace_addr & (PAGE_SIZE - 1))
+	if (user_alloc && (mem->userspace_addr & (PAGE_SIZE - 1)))
 		goto out;
 	if (mem->slot >= KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS)
 		goto out;
-- 
1.5.4.5


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

* Re: [PATCH 1/1] KVM: Fix kernel allocated memory slot
  2008-11-11  7:30 ` [PATCH 1/1] KVM: Fix kernel allocated memory slot Sheng Yang
@ 2008-11-11 14:58   ` Hollis Blanchard
  2008-11-12  1:52     ` Sheng Yang
  2008-11-12 10:09     ` Avi Kivity
  2008-11-12 10:07   ` Avi Kivity
  1 sibling, 2 replies; 7+ messages in thread
From: Hollis Blanchard @ 2008-11-11 14:58 UTC (permalink / raw)
  To: Sheng Yang; +Cc: Avi Kivity, kvm

On Tue, 2008-11-11 at 15:30 +0800, Sheng Yang wrote:
> Commit 7fd49de9773fdcb7b75e823b21c1c5dc1e218c14 "KVM: ensure that memslot
> userspace addresses are page-aligned" broke kernel space allocated memory
> slot, for the userspace_addr is invalid.
> 
> Signed-off-by: Sheng Yang <sheng@linux.intel.com>
> ---
>  virt/kvm/kvm_main.c |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
> 
> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> index 0a0a959..4727c08 100644
> --- a/virt/kvm/kvm_main.c
> +++ b/virt/kvm/kvm_main.c
> @@ -715,7 +715,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
>  		goto out;
>  	if (mem->guest_phys_addr & (PAGE_SIZE - 1))
>  		goto out;
> -	if (mem->userspace_addr & (PAGE_SIZE - 1))
> +	if (user_alloc && (mem->userspace_addr & (PAGE_SIZE - 1)))
>  		goto out;
>  	if (mem->slot >= KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS)
>  		goto out;

Wow, I didn't realize we still had kernel-allocated guest memory. Why is
that?

Anyways, the above patch seems fine to me.
Acked-by: Hollis Blanchard <hollisb@us.ibm.com>

-- 
Hollis Blanchard
IBM Linux Technology Center


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

* Re: [PATCH 1/1] KVM: Fix kernel allocated memory slot
  2008-11-11 14:58   ` Hollis Blanchard
@ 2008-11-12  1:52     ` Sheng Yang
  2008-11-12  1:59       ` Anthony Liguori
  2008-11-12 10:09     ` Avi Kivity
  1 sibling, 1 reply; 7+ messages in thread
From: Sheng Yang @ 2008-11-12  1:52 UTC (permalink / raw)
  To: Hollis Blanchard; +Cc: Avi Kivity, kvm

On Tuesday 11 November 2008 22:58:25 Hollis Blanchard wrote:
> On Tue, 2008-11-11 at 15:30 +0800, Sheng Yang wrote:
> > Commit 7fd49de9773fdcb7b75e823b21c1c5dc1e218c14 "KVM: ensure that memslot
> > userspace addresses are page-aligned" broke kernel space allocated memory
> > slot, for the userspace_addr is invalid.
> >
> > Signed-off-by: Sheng Yang <sheng@linux.intel.com>
> > ---
> >  virt/kvm/kvm_main.c |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
> > index 0a0a959..4727c08 100644
> > --- a/virt/kvm/kvm_main.c
> > +++ b/virt/kvm/kvm_main.c
> > @@ -715,7 +715,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
> >  		goto out;
> >  	if (mem->guest_phys_addr & (PAGE_SIZE - 1))
> >  		goto out;
> > -	if (mem->userspace_addr & (PAGE_SIZE - 1))
> > +	if (user_alloc && (mem->userspace_addr & (PAGE_SIZE - 1)))
> >  		goto out;
> >  	if (mem->slot >= KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS)
> >  		goto out;
>
> Wow, I didn't realize we still had kernel-allocated guest memory. Why is
> that?
>
> Anyways, the above patch seems fine to me.
> Acked-by: Hollis Blanchard <hollisb@us.ibm.com>

it's for VMX EPT and APIC access page, as well as TSS pages. We are planning 
to change that in the future, but I think it's a quick fix for now.

Thanks.

-- 
regards
Yang, Sheng


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

* Re: [PATCH 1/1] KVM: Fix kernel allocated memory slot
  2008-11-12  1:52     ` Sheng Yang
@ 2008-11-12  1:59       ` Anthony Liguori
  0 siblings, 0 replies; 7+ messages in thread
From: Anthony Liguori @ 2008-11-12  1:59 UTC (permalink / raw)
  To: Sheng Yang; +Cc: Hollis Blanchard, Avi Kivity, kvm

Sheng Yang wrote:
> On Tuesday 11 November 2008 22:58:25 Hollis Blanchard wrote:
>   
>> On Tue, 2008-11-11 at 15:30 +0800, Sheng Yang wrote:
>>     
>>> Commit 7fd49de9773fdcb7b75e823b21c1c5dc1e218c14 "KVM: ensure that memslot
>>> userspace addresses are page-aligned" broke kernel space allocated memory
>>> slot, for the userspace_addr is invalid.
>>>
>>> Signed-off-by: Sheng Yang <sheng@linux.intel.com>
>>> ---
>>>  virt/kvm/kvm_main.c |    2 +-
>>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>>
>>> diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c
>>> index 0a0a959..4727c08 100644
>>> --- a/virt/kvm/kvm_main.c
>>> +++ b/virt/kvm/kvm_main.c
>>> @@ -715,7 +715,7 @@ int __kvm_set_memory_region(struct kvm *kvm,
>>>  		goto out;
>>>  	if (mem->guest_phys_addr & (PAGE_SIZE - 1))
>>>  		goto out;
>>> -	if (mem->userspace_addr & (PAGE_SIZE - 1))
>>> +	if (user_alloc && (mem->userspace_addr & (PAGE_SIZE - 1)))
>>>  		goto out;
>>>  	if (mem->slot >= KVM_MEMORY_SLOTS + KVM_PRIVATE_MEM_SLOTS)
>>>  		goto out;
>>>       
>> Wow, I didn't realize we still had kernel-allocated guest memory. Why is
>> that?
>>
>> Anyways, the above patch seems fine to me.
>> Acked-by: Hollis Blanchard <hollisb@us.ibm.com>
>>     
>
> it's for VMX EPT and APIC access page, as well as TSS pages. We are planning 
> to change that in the future, but I think it's a quick fix for now.
>   

It's also there to support older userspaces that still rely on the 
kernel allocating guest memory.  This is only applicable to x86 though.

Regards,

Anthony Liguori

> Thanks.
>
>   


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

* Re: [PATCH 1/1] KVM: Fix kernel allocated memory slot
  2008-11-11  7:30 ` [PATCH 1/1] KVM: Fix kernel allocated memory slot Sheng Yang
  2008-11-11 14:58   ` Hollis Blanchard
@ 2008-11-12 10:07   ` Avi Kivity
  1 sibling, 0 replies; 7+ messages in thread
From: Avi Kivity @ 2008-11-12 10:07 UTC (permalink / raw)
  To: Sheng Yang; +Cc: kvm, "Hollis Blanchard\" <hollisb

Sheng Yang wrote:
> Commit 7fd49de9773fdcb7b75e823b21c1c5dc1e218c14 "KVM: ensure that memslot
> userspace addresses are page-aligned" broke kernel space allocated memory
> slot, for the userspace_addr is invalid.
>
>   

Applied, thanks.

-- 
error compiling committee.c: too many arguments to function


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

* Re: [PATCH 1/1] KVM: Fix kernel allocated memory slot
  2008-11-11 14:58   ` Hollis Blanchard
  2008-11-12  1:52     ` Sheng Yang
@ 2008-11-12 10:09     ` Avi Kivity
  1 sibling, 0 replies; 7+ messages in thread
From: Avi Kivity @ 2008-11-12 10:09 UTC (permalink / raw)
  To: Hollis Blanchard; +Cc: Sheng Yang, kvm

Hollis Blanchard wrote:
> Wow, I didn't realize we still had kernel-allocated guest memory. Why is
> that?
>   

As mentioned, both for compat with the original 2.6.22 interface and for 
guest memory needed by kvm itself.  But note that this kernel-allocated 
memory is equivalent to user memory - it is mmap()ed in and thus pageable.

-- 
error compiling committee.c: too many arguments to function


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

end of thread, other threads:[~2008-11-12 10:09 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-11-11  7:14 [ kvm-Bugs-2260759 ] Can not boot up guest on latest kvm commit a605af SourceForge.net
2008-11-11  7:30 ` [PATCH 1/1] KVM: Fix kernel allocated memory slot Sheng Yang
2008-11-11 14:58   ` Hollis Blanchard
2008-11-12  1:52     ` Sheng Yang
2008-11-12  1:59       ` Anthony Liguori
2008-11-12 10:09     ` Avi Kivity
2008-11-12 10:07   ` Avi Kivity

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