Re: [ANNOUNCE] Native Linux KVM tool

2011-04-03 Thread Pekka Enberg
Hi Avi, On Sun, Apr 3, 2011 at 11:23 AM, Avi Kivity wrote: >> Note that this is a development prototype for the time being: there's no >> networking support and no graphics support, amongst other missing >> essentials. > > Mind posting a roadmap?  I would put smp support near the top.  This sort

Re: [ANNOUNCE] Native Linux KVM tool

2011-04-03 Thread Pekka Enberg
Hi, On Sun, Apr 3, 2011 at 11:24 AM, Avi Kivity wrote: > On 04/03/2011 09:21 AM, Ingo Molnar wrote: >> >> * Anthony Liguori  wrote: >> >> >  On 03/31/2011 12:30 PM, Pekka Enberg wrote: >> >  >  Hi all, >> >  > >> >  >  

Re: [ANNOUNCE] Native Linux KVM tool

2011-04-03 Thread Pekka Enberg
Hi Anthony, On Sat, Apr 2, 2011 at 11:38 PM, Anthony Liguori wrote: >> The goal of this tool is to provide a clean, from-scratch, lightweight >> KVM host tool implementation that can boot Linux guest images (just a >> hobby, won't be big and professional like QEMU) with no BIOS >> dependencies an

[ANNOUNCE] Native Linux KVM tool

2011-03-31 Thread Pekka Enberg
_FS or CONFIG_EXT4_FS if you use the above image. 5. And finally, launch the hypervisor: ./kvm --image=linux-0.2.img --kernel=../../arch/x86/boot/bzImage The tool has been written by Pekka Enberg, Cyrill Gorcunov, and Asias He. Special thanks to Avi Kivity for his help on KVM internals and In

Re: BUG: sleeping function called from invalid context at mm/slub.c:793

2011-01-11 Thread Pekka Enberg
On Tue, Jan 11, 2011 at 1:13 PM, Kirill A. Shutemov wrote: >> Please try out the attached patch. > > It helps. > > Reported-and-tested-by: Kirill A. Shutemov Acked-by: Pekka Enberg -- To unsubscribe from this list: send the line "unsubscribe kvm" in the

Re: KVM_EXIT_HALT and KVM_CREATE_IRQCHIP

2010-06-10 Thread Pekka Enberg
Hi Avi, On 06/10/2010 12:52 PM, Pekka Enberg wrote: How is the guest supposed to halt the hypervisor if KVM_CREATE_IRQCHIP is being used? The kvm_emulate_halt() function seems to handle the halt event completely if irqchip_in_kernel() returns true and thus never exits to the hypervisor. On 6

KVM_EXIT_HALT and KVM_CREATE_IRQCHIP

2010-06-10 Thread Pekka Enberg
Hi! How is the guest supposed to halt the hypervisor if KVM_CREATE_IRQCHIP is being used? The kvm_emulate_halt() function seems to handle the halt event completely if irqchip_in_kernel() returns true and thus never exits to the hypervisor. I see there's a KVM_GET_MP_STATE ioctl that can be u

Re: KVM_SET_MP_STATE is undocumented

2010-04-26 Thread Pekka Enberg
Hi Avi, Avi Kivity kirjoitti: I noticed that QEMU uses KVM_SET_MP_STATE but the ioctl() is completely undocumented. I assume it has something to do with multiprocessor but I am unable to work out the details unless I take a peek at arch/x86/kvm. Patch sent. Two more interesting but undocu

Re: [PATCH] KVM: Document KVM_GET_MP_STATE and KVM_SET_MP_STATE

2010-04-25 Thread Pekka Enberg
Avi Kivity wrote: Signed-off-by: Avi Kivity Acked-by: Pekka Enberg -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

KVM_SET_MP_STATE is undocumented

2010-04-22 Thread Pekka Enberg
Hi! I noticed that QEMU uses KVM_SET_MP_STATE but the ioctl() is completely undocumented. I assume it has something to do with multiprocessor but I am unable to work out the details unless I take a peek at arch/x86/kvm. Pekka -- To unsubscribe from this list: send the

Re: [PATCH] KVM: Fix MAXPHYADDR calculation when cpuid does not support it

2010-04-11 Thread Pekka Enberg
the bug doesn't trigger in practice. Acked-by: Pekka Enberg -- To unsubscribe from this list: send the line "unsubscribe kvm" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

Re: [PATCH] KVM: Fix MAXPHYADDR calculation when cpuid does not support it

2010-04-11 Thread Pekka Enberg
Avi Kivity wrote: On 04/11/2010 04:45 PM, Pekka Enberg wrote: Pekka Enberg wrote: Avi Kivity wrote: Hmm, doesn't seem to work here. I still that triple fault in guest. Can you add a printk to see what value is returned and why? Argh, it's a off-by one bug in my userspace tool

Re: [PATCH] KVM: Fix MAXPHYADDR calculation when cpuid does not support it

2010-04-11 Thread Pekka Enberg
Pekka Enberg wrote: Avi Kivity wrote: Hmm, doesn't seem to work here. I still that triple fault in guest. Can you add a printk to see what value is returned and why? Argh, it's a off-by one bug in my userspace tool... So the CPU really does support 0x8008 and I'

Re: [PATCH] KVM: Fix MAXPHYADDR calculation when cpuid does not support it

2010-04-11 Thread Pekka Enberg
Avi Kivity wrote: Hmm, doesn't seem to work here. I still that triple fault in guest. Can you add a printk to see what value is returned and why? Argh, it's a off-by one bug in my userspace tool... So the CPU really does support 0x8008 and I'm just an idiot. :-)

Re: [PATCH] KVM: Fix MAXPHYADDR calculation when cpuid does not support it

2010-04-11 Thread Pekka Enberg
Avi Kivity wrote: MAXPHYADDR is derived from cpuid 0x8008, but when that isn't present, we get some random value. Fix by checking first that cpuid 0x8008 is supported. Pekka Enberg Signed-off-by: Avi Kivity --- arch/x86/kvm/x86.c |4 1 files changed, 4 insertions(

Re: Problem with KVM guest switching to x86 long mode

2010-04-11 Thread Pekka Enberg
Avi Kivity wrote: On 04/11/2010 01:02 PM, Pekka Enberg wrote: It should work without 8008 set up - failure should happen only if it is setup incorrectly: int cpuid_maxphyaddr(struct kvm_vcpu *vcpu) { struct kvm_cpuid_entry2 *best; best = kvm_find_cpuid_entry(vcpu, 0x8008, 0

Re: Problem with KVM guest switching to x86 long mode

2010-04-11 Thread Pekka Enberg
Avi Kivity wrote: On 04/11/2010 12:48 PM, Pekka Enberg wrote: So the guest is in long mode, happily trying to access pci config space. MAXPHYADDR comes from cpuid 8008.eax[0:7]. Typical values are 36-40 (number of physical address bits supported by the processor). What value does your

Re: Problem with KVM guest switching to x86 long mode

2010-04-11 Thread Pekka Enberg
Avi Kivity wrote: Sorry for the delay. Here you go: Page Tables: pte4: 02403007 pte3: 02404007 pte2: 0183 These are all correct. The only thing I can think of, is that MAXPHYADDR is small value. And indeed, if I run it on an ept capable machine (which does t

Re: Problem with KVM guest switching to x86 long mode

2010-04-10 Thread Pekka Enberg
Avi Kivity wrote: The instruction at 0x28 is enabling paging, next insn fetch faults, so the paging structures must be incorrect. Questions: - what is the u64 at cr3? (call it pte4) - what is the u64 at (pte4 & ~0xfff)? (call it pte3) - what is the u64 at (pte3 & ~0xfff)? ("pte2") - what is th

Re: Problem with KVM guest switching to x86 long mode

2010-04-08 Thread Pekka Enberg
Avi Kivity wrote: These all look reasonable. Please add a gdtr dump and an idtr dump. Done. 2b:*cb lret<-- trapping instruction Post the two u32s at ss:rsp -> ss:rsp+8. That will tell us where the guest is trying to return. Actually, from the dump: 1a

Problem with KVM guest switching to x86 long mode

2010-04-08 Thread Pekka Enberg
Hi! I am working on a light-weight KVM userspace launcher for Linux and am bit stuck with a guest Linux kernel restarting when it tries to enter long mode. The register dump looks like this: penb...@tiger:~/vm$ ./kvm bzImage KVM exit reason: 8 ("KVM_EXIT_SHUTDOWN") Registers: rip: 00100

Re: KVM guest interrupts, traps, and, exceptions

2010-03-27 Thread Pekka Enberg
Hi Alexander, Alexander Graf wrote: I'm continuing my journey through the KVM API documentation and I'm now scratching my head on how interrupts, traps, and exceptions are supported by the API. I see KVM_CREATE_IRQCHIP and KVM_IRQ_LINE but I'm unable to work out how the host is notified of su

KVM guest interrupts, traps, and, exceptions

2010-03-27 Thread Pekka Enberg
Hi Avi, I'm continuing my journey through the KVM API documentation and I'm now scratching my head on how interrupts, traps, and exceptions are supported by the API. I see KVM_CREATE_IRQCHIP and KVM_IRQ_LINE but I'm unable to work out how the host is notified of such events. For example, if t

Re: pekka-vm and kvm documentation

2010-03-25 Thread Pekka Enberg
Hi Avi, Avi Kivity wrote: When you come up against something that is undocumented or badly described, please complain on k...@. We will then update the documentation. So one thing I'm wondering is in what mode do we enter the guest? Is that entirely specified with KVM_SET_REGS and KVM_SET_SR

Re: [PATCH 2/2] KVM: Document KVM_SET_TSS_ADDR

2010-03-25 Thread Pekka Enberg
Avi Kivity kirjoitti: On 03/25/2010 12:36 PM, Pekka Enberg wrote: +4.35 KVM_SET_TSS_ADDR + +Capability: KVM_CAP_SET_TSS_ADDR +Architectures: x86 +Type: vm ioctl +Parameters: unsigned long tss_address (in) +Returns: 0 on success, -1 on error + +This ioctl defines the physical address of a three

Re: [PATCH 2/2] KVM: Document KVM_SET_TSS_ADDR

2010-03-25 Thread Pekka Enberg
Hi Avi, Avi Kivity kirjoitti: Signed-off-by: Avi Kivity --- Documentation/kvm/api.txt | 16 1 files changed, 16 insertions(+), 0 deletions(-) diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt index 22af28a..8f45099 100644 --- a/Documentation/kvm/api.txt +++

Re: [PATCH 1/2] KVM: Document KVM_SET_USER_MEMORY_REGION

2010-03-25 Thread Pekka Enberg
Avi Kivity kirjoitti: Signed-off-by: Avi Kivity Acked-by: Pekka Enberg --- Documentation/kvm/api.txt | 43 +++ 1 files changed, 43 insertions(+), 0 deletions(-) diff --git a/Documentation/kvm/api.txt b/Documentation/kvm/api.txt index d170cb4

Re: [RFC] Unify KVM kernel-space and user-space code into a single project

2010-03-22 Thread Pekka Enberg
On Mon, Mar 22, 2010 at 8:04 PM, Avi Kivity wrote: >> That said, pulling 400 KLOC of code into the kernel sounds really >> excessive. Would we need all that if we just do native virtualization >> and no actual emulation? > > What is native virtualization and no actual emulation? What I meant with

Re: [RFC] Unify KVM kernel-space and user-space code into a single project

2010-03-22 Thread Pekka Enberg
Hi Avi, On Mon, Mar 22, 2010 at 7:32 PM, Avi Kivity wrote: >> It's kinda funny to see people argue that having an external >> repository is not a problem and that it's not a big deal if building >> something from the repository is slightly painful as long as it >> doesn't require a PhD when we ha

Re: [RFC] Unify KVM kernel-space and user-space code into a single project

2010-03-22 Thread Pekka Enberg
Hi Frank, On Mon, Mar 22, 2010 at 7:17 PM, Frank Ch. Eigler wrote: > In your very previous paragraphs, you enumerate two separate causes: > "repository structure" and "development/maintenance process" as being > sources of "fun".  Please simply accept that the former is considered > by many as ab

Re: [RFC] Unify KVM kernel-space and user-space code into a single project

2010-03-22 Thread Pekka Enberg
On Mon, Mar 22, 2010 at 6:16 PM, Avi Kivity wrote: >> You simply kept ignoring me when I said that if something can be kept out >> of the kernel without impacting performance, it should be.  I don't want >> emergency patches closing some security hole or oops in a kernel symbol >> server. > > Or r

Re: [RFC] Unify KVM kernel-space and user-space code into a single project

2010-03-22 Thread Pekka Enberg
Hi Avi, On Mon, Mar 22, 2010 at 2:49 PM, Avi Kivity wrote: > Seems like perf is also split, with sysprof being developed outside the > kernel.  Will you bring sysprof into the kernel?  Will every feature be > duplicated in prof and sysprof? I am glad you brought it up! Sysprof was historically o

Re: [RFC] Unify KVM kernel-space and user-space code into a single project

2010-03-22 Thread Pekka Enberg
On Mon, Mar 22, 2010 at 2:36 PM, Avi Kivity wrote: >> Here it is, repeated for the Nth time: >> >> Allow a guest to (optionally) integrate its VFS namespace with the host >> side >> as well. An example scheme would be: >> >>    /guests/Fedora-G1/ >> > > [...] > > You're missing something.  This su

Re: [RFC] Unify KVM kernel-space and user-space code into a single project

2010-03-22 Thread Pekka Enberg
Hi Daniel, (I'm getting slightly off-topic, sorry about that.) Daniel P. Berrange kirjoitti: Here it is, repeated for the Nth time: Allow a guest to (optionally) integrate its VFS namespace with the host side as well. An example scheme would be: /guests/Fedora-G1/ /guests/Fedora-G1/proc/

Re: [RFC] Unify KVM kernel-space and user-space code into a single project

2010-03-22 Thread Pekka Enberg
On Mon, Mar 22, 2010 at 1:48 PM, Ingo Molnar wrote: >> What about line number information?  And the source?  Into the kernel with >> them as well? > > Sigh. Please read the _very first_ suggestion i made, which solves all that. I > rarely go into discussions without suggesting technical solutions

Re: [RFC] Unify KVM kernel-space and user-space code into a single project

2010-03-18 Thread Pekka Enberg
On Thu, Mar 18, 2010 at 6:38 PM, Anthony Liguori wrote: There are all kernel space projects, going through Xorg would be a horrible waste of performance for full-screen virtualization. It's fine for the windowed or networked case (and good as a compatibility fallback), but very

Re: KVM usability

2010-03-07 Thread Pekka Enberg
Hi Avi, (slightly off-topic) On Sun, Mar 7, 2010 at 11:35 AM, Avi Kivity wrote: > perf really is wonderful, but to be really competitive, and usable to more > developers, it needs to be in a graphical environment.  I want 'perf report' > output to start out collapsed and drill down by clicking o

<    3   4   5   6   7   8